Parent
Epic: #186
What to build
Migrate the coder-client crate's Coder Chats API integration off the experimental paths and onto the GA /api/v2 surface introduced in Coder v2.37.0. This is the urgent, code-correctness half of the migration.
- Chat lifecycle (REST):
create_chat, get_chat, get_chat_opt, list_chats, send_chat_message, get_chat_messages, archive_chat, interrupt_chat → change the base path from /api/experimental/chats to /api/v2/chats (crates/coder-client/src/lib.rs).
- Chat events (WebSocket):
ChatStream::connect → change the stream path from /api/experimental/chats/{id}/events to /api/v2/chats/{id}/events (crates/coder-client/src/chat_stream.rs).
- Model resolution (URGENT — already broken):
list_chat_models currently calls GET /api/experimental/chats/models, which was removed immediately in v2.37 (PR #28632). Re-point it to GET /api/v2/organizations/{organization}/chats/models, resolving the organization via the client's existing get_default_organization_id and keeping the response-shape parsing consistent.
Acceptance criteria
Blocked by
None (can start immediately). Highest priority — the models endpoint already fails against :latest (= v2.37.0).
Evidence
Parent
Epic: #186
What to build
Migrate the
coder-clientcrate's Coder Chats API integration off the experimental paths and onto the GA/api/v2surface introduced in Coder v2.37.0. This is the urgent, code-correctness half of the migration.create_chat,get_chat,get_chat_opt,list_chats,send_chat_message,get_chat_messages,archive_chat,interrupt_chat→ change the base path from/api/experimental/chatsto/api/v2/chats(crates/coder-client/src/lib.rs).ChatStream::connect→ change the stream path from/api/experimental/chats/{id}/eventsto/api/v2/chats/{id}/events(crates/coder-client/src/chat_stream.rs).list_chat_modelscurrently callsGET /api/experimental/chats/models, which was removed immediately in v2.37 (PR #28632). Re-point it toGET /api/v2/organizations/{organization}/chats/models, resolving the organization via the client's existingget_default_organization_idand keeping the response-shape parsing consistent.Acceptance criteria
/api/v2/chats(no/api/experimental/chatsleft incoder-clientruntime code).ChatStreamconnects to/api/v2/chats/{id}/events.list_chat_modelscalls the org-scoped v2 models endpoint using a resolved org id, and still returns the model list used for the model hint.cargo check --workspace --all-featurespasses.Blocked by
None (can start immediately). Highest priority — the models endpoint already fails against
:latest(= v2.37.0).Evidence
/api/v2(PR #28496, one-month window, removed in v2.38): feat: mount chat API routes under /api/v2 coder/coder#28496docs/architecture/coder-v2.37-migration.md§1.3