Remove the `/api/experimental` duplicates of the promoted chat API. #28496 double-mounted the chat, organization chat and MCP server, member model-override, AI provider key, and MCP OAuth2 disconnect routes under both prefixes for the one-release compatibility window decided in CODAGT-921; that window closed with v2.37.0, so these routes now answer only on `/api/v2`. The change also deletes what existed only for the dual mount: the `chatAPIPrefix` plumbing, the shared cross-prefix files rate limiter (`RateLimitByAPICompatibilityEndpoint`), the 410 tombstones for the legacy `chats/providers` and `chats/user-provider-configs` collections with their `ExperimentalClient` SDK methods, and the `/providers` and `/user-provider-configs` 404 reservations on `/api/v2`. Signed chat file download URLs now point at `/api/v2`. Routes that were never promoted stay on `/api/experimental`: the experiment-gated `chats/config/advisor` and `chats/config/computer-use-provider`, `chats/{chat}/stream/desktop`, `chats/{chat}/debug/runs`, and the MCP OAuth2 callback, whose path is pinned as a registered redirect URI with external providers. The frontend already calls `/api/v2` for every promoted route, so only `typesGenerated.ts` changes. Because the experimental mount no longer reserves the removed collection segments, requests such as `GET /api/experimental/chats/models` now fall into the `{chat}` wildcard and return 400 instead of 404; the experimental prefix carries no stability guarantee and the compatibility window is over, so no new reservations were added. `coderd/x/chatd/ARCHITECTURE.md` now describes the single `/api/v2` mount and the remaining experimental routes, and its endpoint headings use the `/api/v2` paths. Closes CODAGT-922 (https://linear.app/codercom/issue/CODAGT-922/remove-experimental-chats-api-paths-after-transition-window). Refs #28496. ## Delivery record - Remote dogfood UAT (Coder Agents chat https://dogfood.cdr.dev/agents/c016b549-201a-4eca-a50f-3c0b7c339db6): verdict PASS on b008976a4dfba3524b220ca846ea3c3492e9cc9c. The branch was since rebased onto main (which had a duplicate migration 000596 until #29568) and gained one docs-only commit (`coderd/x/chatd/ARCHITECTURE.md` only); the current head666332f579carries the same code diff, so the tested branch code is unchanged. Covered the Agents UI end to end on `/api/v2` (chat, streaming reply, reload mid-stream, file upload and download, debug runs panel), the admin AI settings pages with persisted saves, 45 curl route checks across both prefixes, websocket handshakes, the frozen MCP callback redirect URI, and the files rate limiter. One low-severity note: the 400-versus-404 behavior for removed experimental collection paths described above. - Codex review on b008976a4d (draft marked ready): no findings. Codex review on the current head666332f579(requested via `@codex review`): one P1 thread asking for TODO markers instead of the direct `ARCHITECTURE.md` edit; replied and resolved because the PR author reviewed the earlier TODO markers and directed this replacement text. No unresolved threads. CI is green on666332f579(run 35376339802; `test-go-pg-17` passed on rerun after a Docker Hub timeout in `TestSSH_Container/OK`). > [!NOTE] > Xum acted on @ibetitsmike's behalf in this pull request.
2.3 KiB
title
| title |
|---|
| Advisor |
Note
This feature is experimental. Pin a release before broad rollout and review the release notes before upgrading.
Enable the experiment
coder server --experiments=chat-advisor
Or set the environment variable:
CODER_EXPERIMENTS=chat-advisor
What it does
Lets a root agent pause its current turn and request strategic guidance from a separate, single-step model call. The advisor sees recent conversation context, runs without any tools, and returns concise advice for the root agent rather than the end user. While active, it is the only tool the root agent can call for that turn.
Useful for planning ambiguity, architectural tradeoffs, debugging strategy after repeated failures, or risk reduction before a destructive operation.
Configuration
Once the experiment is enabled, configure the advisor's runtime limits under Admin settings > AI > Coder Agents > Deployment settings. Use the Advisor card. These limits apply deployment-wide.
| Field | Default | Notes |
|---|---|---|
| Max uses per turn | 0 (unlimited) |
Caps how many times the root agent can call the advisor in a single chat turn. Must be a non-negative integer. |
| Max output tokens | 0 (server default) |
Caps the advisor model's response length. 0 uses the server default of 16,384 tokens. Must be a non-negative integer. |
The advisor model and its reasoning effort are organization-scoped model overrides. Configure them in the Organization settings section of Admin settings > AI > Coder Agents for the selected organization. When no override is set, the advisor reuses the root agent's model.
The advisor is not available in plan mode or to subagents. Failed advisor invocations refund the per-turn budget.
The same configuration is available through the API: runtime limits at
GET/PUT /api/experimental/chats/config/advisor, and the advisor
model override at
PUT /api/v2/organizations/{organization}/chats/model-overrides/advisor.