Skip to content

feat: promote codersdk chat API methods to Client - #28497

Merged
ibetitsmike merged 4 commits into
mainfrom
mike/chat-api-v2-sdk
Aug 26, 2026
Merged

feat: promote codersdk chat API methods to Client#28497
ibetitsmike merged 4 commits into
mainfrom
mike/chat-api-v2-sdk

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Stack context

This is the second PR in the 3-PR chat API promotion stack: server compatibility mounts (#28496), codersdk promotion (this PR), and frontend path updates (#28498).

Summary

Move the promoted chat and MCP SDK methods from ExperimentalClient to Client and update them to use /api/v2. Methods for routes that remain experimental stay on ExperimentalClient.

Update in-repository callers and generated types. The multi-replica chat stream relay dials /api/v2 directly: mixed-version replica sets are not a supported upgrade path, so no experimental-path fallback is kept (per review). Remote dogfood UAT passed for the composed stack.

Note

Xum acted on Mike's behalf in this pull request.

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c8984683d3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread enterprise/coderd/x/chatd/chatd.go
Comment thread enterprise/coderd/x/chatd/chatd.go
@ibetitsmike
ibetitsmike force-pushed the mike/chat-api-v2-sdk branch from c898468 to 437d032 Compare August 24, 2026 18:19
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 437d032b0e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike
ibetitsmike force-pushed the mike/chat-api-v2-sdk branch from 437d032 to 259fb81 Compare August 24, 2026 18:41
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 259fb8188e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike
ibetitsmike force-pushed the mike/chat-api-v2-sdk branch from 259fb81 to 0d3d823 Compare August 24, 2026 18:57
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 0d3d823b43

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike
ibetitsmike force-pushed the mike/chat-api-v2-sdk branch from 0d3d823 to 5ee8005 Compare August 25, 2026 01:08
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 5ee8005b70

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike
ibetitsmike force-pushed the mike/chat-api-v2-sdk branch from 5ee8005 to 025abd3 Compare August 25, 2026 02:12
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review current head 025abd334662f0a792a8a8a25c94ead6384dfaee.

Xum acted on Mike's behalf.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 025abd3346

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike
ibetitsmike force-pushed the mike/chat-api-v2-sdk branch from 025abd3 to 3fdbf8f Compare August 25, 2026 03:07
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

Xum acted on Mike's behalf in requesting a fresh Codex review for head 3fdbf8f1223c.

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 3fdbf8f122

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike
ibetitsmike force-pushed the mike/chat-api-v2-sdk branch from 3fdbf8f to 7339f6b Compare August 25, 2026 03:55
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review current head 7339f6b99a4c7b4132cae3d9229e42a81d5d2c6f.

Xum acted on Mike's behalf.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 7339f6b99a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike
ibetitsmike force-pushed the mike/chat-api-v2-sdk branch from 7339f6b to c032a19 Compare August 25, 2026 04:29
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review current head c032a19ac496daf991eae936c3ef9a3b629ff064.

Xum acted on Mike's behalf.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: c032a19ac4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike
ibetitsmike force-pushed the mike/chat-api-v2-sdk branch from c032a19 to 21b6086 Compare August 25, 2026 05:03
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review current head 21b6086d2a69f5b365bf79248b572bec2ce83e52.

Xum acted on Mike's behalf.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 21b6086d2a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike
ibetitsmike force-pushed the mike/chat-api-v2-sdk branch from 21b6086 to a57eda6 Compare August 25, 2026 09:51
@ibetitsmike
ibetitsmike force-pushed the mike/chat-api-v2-sdk branch from a57eda6 to b380c89 Compare August 25, 2026 16:26
@ibetitsmike
ibetitsmike marked this pull request as ready for review August 25, 2026 20:27
@ibetitsmike
ibetitsmike force-pushed the mike/chat-api-v2-sdk branch from b380c89 to 1ab6d80 Compare August 25, 2026 22:10
Comment thread enterprise/coderd/x/chatd/chatd.go Outdated
Base automatically changed from mike/chat-api-v2-server to main August 26, 2026 14:17
ibetitsmike added a commit that referenced this pull request Aug 26, 2026
## Stack context

This is the base of a 3-PR stack promoting the chat API from
`/api/experimental` to `/api/v2`: server compatibility mounts (this PR),
codersdk promotion (#28497), and frontend path updates (#28498).

## Summary

Double-mount the stable chat and MCP handlers under `/api/v2` while
retaining the existing experimental routes for the one-release
compatibility window decided in CODAGT-921. CODAGT-922 tracks removing
the compatibility mounts.

The shared route builders preserve existing authentication and
middleware behavior. Experiment-gated, debug, tombstone, and legacy
default-organization model routes remain experimental-only. Signed file
URLs, external OAuth callback URLs, and mixed-version replica relays
also remain on the experimental prefix during the transition.

Update Swagger and the generated API reference for the promoted routes,
including the workspace lookup and a runnable raw-body chat file upload
example. Retain internal endpoints outside the published reference,
share chat-file rate limits across both prefixes, enable CORS for the v2
MCP routes, and cover dual mounts plus exclusions with compatibility
tests. Remote dogfood UAT passed for the promoted chat, model, MCP, and
file flows.

> [!NOTE]
> Xum acted on Mike's behalf in this pull request.
<!-- xum-attribution: model=claude-fable-5 thinking=high -->
Peer replicas may run a pre-promotion release during a rolling
upgrade, so the internal parts relay keeps dialing /api/experimental
until CODAGT-922 removes the window.
GET /chats/models is no longer promoted to /api/v2 (superseded by the
organization-scoped collection; #28632 removes it), so point the
disclosure comparison back at the experimental path.
@ibetitsmike
ibetitsmike force-pushed the mike/chat-api-v2-sdk branch from 59a7d67 to 00207f2 Compare August 26, 2026 14:17
Reverts the rolling-upgrade defense added during PR review: mixed-version replica sets are not a supported upgrade path (replicas scale to zero during upgrades), and keeping the internal relay on /api/experimental would itself 404 once CODAGT-922 removes the experimental mounts. Requested by mafredri in review.
@ibetitsmike
ibetitsmike merged commit 973d5a4 into main Aug 26, 2026
32 checks passed
@ibetitsmike
ibetitsmike deleted the mike/chat-api-v2-sdk branch August 26, 2026 16:46
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants