Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[T1][URGENT] Migrate coder-client Chats API to /api/v2 (chat lifecycle + events + org-scoped models) #187

Description

@NkwaTambe

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

  • All chat lifecycle calls hit /api/v2/chats (no /api/experimental/chats left in coder-client runtime code).
  • ChatStream connects to /api/v2/chats/{id}/events.
  • list_chat_models calls 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-features passes.

Blocked by

None (can start immediately). Highest priority — the models endpoint already fails against :latest (= v2.37.0).

Evidence

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions