mirror of
https://github.com/coder/coder.git
synced 2026-10-16 14:48:56 +08:00
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 onb008976a4d. 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 onb008976a4d(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.