mirror of
https://github.com/turnstonelabs/turnstone.git
synced 2026-08-12 23:12:23 -06:00
main
4 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
12bd848c68 |
feat(providers): anthropic-compatible lane for local /v1/messages servers
Add provider id "anthropic-compatible": the existing AnthropicProvider pointed at Anthropic-compatible local servers (vLLM /v1/messages), mirroring the openai/openai-compatible split. Registry-only — configured via the admin Models tab or [models.*] toml, not exposed on the bare --provider flag, so the CLI/server prod-URL defaults are unreachable for the lane and real-Anthropic behavior is untouched. Lane behavior (live-verified against vLLM 0.22.1rc1 + DeepSeek-V4-Flash): - Capability defaults replace the Claude static table: token_param max_tokens, thinking_mode none, web_search/tool_search/vision off, reasoning replay on. vLLM rejects Anthropic server-side tool types (tools require input_schema) and ignores the thinking request param, so neither is sent; thinking blocks still stream back and round-trip through the native lane verbatim. - Reasoning toggles via server_compat extra_body chat_template_kwargs (first-class vLLM request field; request-level keys beat server defaults). _build_thinking_and_kwargs forwards non-internal extra_params as SDK extra_body; thinking_budget_tokens stays internal. - No temperature force: thinking_mode none skips the Claude-only temperature=1.0 requirement. Admin UI: provider option + URL placeholder (base_url without /v1 — the SDK appends /v1/messages); the server-compat section shows only the extra-body field for the lane. thinking_mode round-trips through the form dropdown for every provider except anthropic-compatible, where it stays in the raw capabilities JSON — the edit-load lift and save restore use the same predicate so stored overrides are never silently dropped. Docs: architecture.md gains the lane subsection incl. verified quirks (thinking param dropped by vLLM; stop_sequences cut inside thinking and report end_turn; usage has no cache fields; images need a multimodal model; mid-conversation system turns are per-model opt-in). Negative-tested: removing the _INTERNAL_EXTRA_PARAMS exclusion fails test_internal_keys_not_leaked; the live test drives a streamed turn with the chat_template_kwargs toggle and asserts no reasoning deltas. |
||
|
|
110d44b07e |
refactor(tools): remove man, math, and plan_agent built-in tools
`man` and `math` duplicated capabilities already reachable through `bash`; `plan_agent` is better expressed as a `task_agent` running a planning skill, and carried a large amount of special-case machinery (plan-review gate, refinement loop, per-kind model routing). Removing all three shrinks the tool surface and cuts per-call token cost. Also removed, as dead-once-the-tools-are-gone: - the `math` sandbox executor (`turnstone.core.sandbox`) and its `[sandbox]` extra; the eval analyst now runs bash-only - the read-only `AGENT_TOOLS` sub-agent tool set and the `agent` tool-metadata key (`task_agent`/`TASK_AGENT_TOOLS` retained) - the plan-review protocol end to end: the `on_plan_review` UI hook, `resolve_plan`, `POST /v1/api/plan` + `POST /v1/api/route/plan`, the `plan_review`/`plan_resolved` SSE events, and their Python SDK / TypeScript SDK / OpenAPI / frontend / Discord+Slack bindings - the `model.plan_alias` / `model.plan_effort` settings and the registry `plan_model` / `plan_effort` routing fields TOOLS 31->28, TASK_AGENT_TOOLS 13->11; COORDINATOR_TOOLS unchanged. BREAKING CHANGE: removes the `man`, `math`, `plan_agent` tools, the plan-review SSE/HTTP/SDK surface, and the plan_* model-routing settings from the experimental 1.6 line. |
||
|
|
75d0b81b07 |
feat(console-ui): home composer placeholders, toggle component, admin polish
Bundles the click-around polish on the console admin UX. Home composer + schedule modals - /v1/api/models now exposes coordinator_default_alias + judge_default_alias, resolved through the same chain console/session_factory.py uses. Both the home composer's MODEL / JUDGE MODEL placeholders and the schedule create / edit modal model placeholders rewrite to "Default — alias (model)" once the API responds. The `models_changed` SSE refresh keeps placeholders current as operators edit per-role assignments. - Composer.setOptionPlaceholder added so callers can update just the first option's text without disturbing the rest of the choice list. Admin → Models → Roles - Channel adapter row added (channels.default_model_alias) — the migration to the Roles sub-tab missed it. Key added to _MODEL_AFFECTING_SETTING_KEYS so edits fire the SSE refresh, and to the settings-tab roleKeys skip-list so it only renders in one place. - Plan/Task agent rows now display "(inherit)" instead of the misleading "(default — <alias>)" — those roles cascade through plan_model → agent_model → session model, not a single concrete default. - coordinator.reasoning_effort accepts "" (inherit), matching model.plan_effort / model.task_effort. - Blank options in each role's MODEL select now match the "alias (model)" shape used by the other rows. Toggle-switch component - New .toggle-switch component (visually-hidden native checkbox + styled track + label). 40×22 hit target meets WCAG 2.5.5 (AAA), inset ring on the off state for ≥1.5:1 contrast against the modal surface. - .toggle-stack groups toggles in a column with .toggle-group-divider for conceptual grouping (used in the Add Model modal between "Active" and the paired Reasoning toggles). - .toggle--flush modifier zeroes the default top margin for toggles that sit flush against a heading or a dynamically-rendered row. Sweep — every admin-modal boolean checkbox is now a toggle: schedule (cs/es-autoapprove, es-enabled), policy (ep/epp-enabled), tool-mode (ctm/etm-default), skill (csk/esk-auto-approve, csk/esk-enabled), MCP (mcp-auto-approve, mcp-enabled), Add Model (Active, surface-persisted- reasoning, replay-reasoning), judge bool settings (cancel_on_approval et al.), and the user-roles-modal role assignment list. The two ogp-cred / eogp-cred inline credential checkboxes stay as compact inline boxes since they sit beside text inputs in tight horizontal rows. Add Model modal — the "Enabled" toggle promoted to "Active" and moved to the very top of the form. Tooltip explains it gates dropdown visibility without removing the definition. MCP authorization — the three radio buttons replaced with a vertical .segmented-control option list. Selected row paints --accent-dim plus a filled .segmented-indicator; focus ring uses --accent so it stays visible on the currently-selected option. Role permissions modal — the 19 permission checkboxes are now .toggle-switch.perm-toggle (monospace lowercase identifiers preserved). The permissions are split into Scopes / Admin / Workstreams & Tools sections under caps-styled section headers so the row-flow grid no longer slices `admin.*` mid-column. Judge bool toggles use a static "Enabled" caption rather than flipping text on `.checked`; flipping lagged 50–300 ms behind the slider position because the caption was sourced from the post-save reload. CSS cleanup — dead `.admin-checkbox` / `.perm-checkbox` rules removed. Specificity audit (scripts/css_specificity_audit.py) returns no conflicts on any new component class. Tests — 525 pass on the affected slices; new tests/test_console_available_ models.py pins each branch of the resolution chain in /v1/api/models so the home composer placeholder stays correct as precedence rules evolve. |
||
|
|
7db7f99dd8 |
fix(console): address Copilot feedback on Models → Roles sub-tab
Three changes from PR review: - Permission gating: hide the Roles sub-tab button when the user lacks ``admin.settings``. The sub-tab loads/saves through ``/v1/api/admin/settings``, so an admin with ``admin.models`` but no ``admin.settings`` would otherwise see a perpetual 403 loader. When Roles is the active sub-tab and the permission check fails, snap the panel back to Definitions so the user lands somewhere usable. - Drop the redundant ``/v1/api/admin/model-definitions`` fetch from ``loadAdminModelRoles``. Both entry points (initial Models-tab open + ``models_changed`` SSE refresh) flow through ``loadAdminModels`` first, which already populates ``_modelDefs`` + ``_modelDefaultAlias``; ``_saveModelRole`` doesn't touch model definitions, so the cached snapshot stays accurate when the save chains back here. Halves the per-render request count and removes a wasted round-trip on every cluster-wide model edit. - Add ``test_models_changed_event.py`` covering the SSE fanout the prior commit introduced: each model-definition CRUD endpoint emits exactly one ``models_changed``, settings PUT/DELETE only emit for keys in ``_MODEL_AFFECTING_SETTING_KEYS`` (parametrised over all eight), and unrelated settings (e.g. ``session.retention_days``) don't trigger spurious refreshes. The expected key set is pinned in the test so a stray addition to the allowlist doesn't silently bypass coverage. |