Repository navigation
fix: call the chat API on /api/v2 after the experimental mounts were removed - #43
Merged
nickvigilante merged 1 commit intoSep 22, 2026
Conversation
…removed coder/coder#29548 removed the /api/experimental duplicates of the promoted chat API once the one-release compatibility window from coder/coder#28496 closed with v2.37.0. The client still pointed at the old prefix, so every run against an up-to-date deployment failed. The reuse lookup runs before chat creation, so listChats was the first call to 404 and the failure surfaced as "Failed to look up chats by reuse labels ... Coder API error: Not Found". createChat, getChat, and createChatMessage were equally dead, which is why force-new-chat was not a workaround. listChats was only ever exercised through the fake client in test-helpers, so no test pinned its URL and the drift went unnoticed. Add coverage against RealCoderClient for both the route and the label/archived query construction. Fixes CODAGT-1136.
nickvigilante
marked this pull request as ready for review
September 22, 2026 14:36
ibetitsmike
approved these changes
Sep 22, 2026
nickvigilante
added a commit
to coder/coder
that referenced
this pull request
Sep 22, 2026
…/v2 fix (#29732) ## Summary Bump the pinned `coder/agents-chat-action` SHA so doc-check actually runs the `/api/v2` fix. [#29548](#29548) removed the `/api/experimental` chat mounts, and the action still called them. [coder/agents-chat-action#43](coder/agents-chat-action#43) repointed the client at `/api/v2` and is merged, but this workflow pins the action by commit SHA, so doc-check kept running the broken v0.5.0 bundle. ## Changes - `.github/workflows/doc-check.yaml`: `coder/agents-chat-action@3e20636` (v0.5.0) to `@9b3ac42` (v0.5.1). `v0.5.1` is a new tag cut at the post-merge commit of coder/agents-chat-action#43. The pin is the commit SHA, matching the existing convention for every pinned action in this workflow. ## Evidence Of the eight most recent `doc-check.yaml` runs, seven failed with the stale action: ``` Failed to look up chats by reuse labels [...]: Coder API error: Not Found ``` ## This does not fix every doc-check failure The eighth recent failure has a different cause and survives this change: ``` doc-check-pr-29440 is dormant since 2026-09-18T20:25:12Z. The review cannot run, because a chat cannot start its own dormant workspace ``` That is the `Check the review workspace is usable` step failing per [CODAGT-1025](https://linear.app/codercom/issue/CODAGT-1025), which is deliberate: the step fails loudly rather than letting a review silently read nothing. Individual pull requests whose review workspace has gone dormant will keep going red until CODAGT-1025 is addressed. ## Testing - `make lint/actions/actionlint`: pass (via pre-commit). - Full `pre-commit-light` suite: pass. - Verified `v0.5.1` dereferences to commit `9b3ac42d568e9206f9cd51a97789820d6935cc8d`, which is the SHA pinned here. End-to-end verification needs this merged, since the workflow runs the pinned SHA from the base branch. <details> <summary>Investigation notes</summary> ### Why the earlier fix did not take effect The action fix merged at 14:39 UTC, but GitHub Actions resolves `uses:` against the pinned SHA, not the default branch. Nothing in coder/coder changed when the action merged, so every subsequent run still executed the v0.5.0 bundle. ### Failure classification, eight most recent runs | Run | Failing step | Cause | | --- | --- | --- | | 35742517848 | Check the review workspace is usable | CODAGT-1025, dormant workspace | | 35741492350 | Run doc-check via Coder Agent Chat | stale pin, reuse label 404 | | 35741372081 | Run doc-check via Coder Agent Chat | stale pin, reuse label 404 | | 35741334633 | Run doc-check via Coder Agent Chat | stale pin, reuse label 404 | | 35741253070 | Run doc-check via Coder Agent Chat | stale pin, reuse label 404 | | 35740876746 | Run doc-check via Coder Agent Chat | stale pin, reuse label 404 | | 35740802233 | Run doc-check via Coder Agent Chat | stale pin, reuse label 404 | | 35740674362 | Run doc-check via Coder Agent Chat | stale pin, reuse label 404 | ### Note on the floating tag The repository also carries a `v0` tag, but it still points at `v0.1.0` and is unmaintained. This workflow pins exact SHAs, so that tag is not used here and was left alone. </details> Refs [DOCS-987](https://linear.app/codercom/issue/DOCS-987/bump-the-pinned-agents-chat-action-sha-in-doc-checkyaml-to-pick-up-the). > [!NOTE] > Coder Agents generated this pull request on Nick Vigilante's behalf.
Member
|
Solid!! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Repoint the Coder chat API client at
/api/v2.coder/coder#29548 removed the
/api/experimentalduplicates of the promoted chat API once the one-release compatibility window from coder/coder#28496 closed with v2.37.0, so every run of this action against an up-to-date deployment currently fails.This has the
AI Documentation Checkworkflow red on all coder/coder pull requests:The error names the reuse labels, but the labels are fine.
The reuse lookup is simply the first call to hit the dead prefix.
Changes
src/coder-client.ts: movelistChats,createChat,getChat, andcreateChatMessagefrom/api/experimental/chats…to/api/v2/chats….updateChatACLwas already on/api/v2, so its now-obsolete comment about the older prefix is dropped.src/coder-client.test.ts: update the endpoint assertions, and add alistChatsblock covering the route and thelabel/archivedquery construction.src/action.ts,README.md,AGENTS.md: correct stale prose references to the experimental prefix.dist/index.js: rebuilt.Why the new test
listChatswas the method that broke, and it was the only chat method with no coverage againstRealCoderClient.It was exercised solely through the fake client in
test-helpers.ts, so nothing pinned its URL and the drift shipped silently.The other four methods already had endpoint assertions, which is why this adds coverage rather than only updating it.
Testing
Run locally against bun 1.3.14, matching CI:
make build,make fmt-check,make lint(biome +tsc --noEmit): pass.make test: 231 pass, 0 fail../check_unstaged.shequivalent:dist/index.jsis rebuilt and committed.Verified the committed
distis reproducible by rebuilding pristineHEADwith bun 1.3.14 and getting a byte-identical file, so this diff contains only the intended change.api/experimentalreferences in source, docs, ordist.Not exercised against a live deployment from CI; that happens when the follow-up SHA bump lands in coder/coder.
Investigation notes and decision log
How the root cause was established
The error string comes from
findReuseMatchinsrc/action.ts, which wraps anylistChatsfailure.The wrapper names the labels, which made the report look like a label or reuse-scope bug.
listChatsinsrc/coder-client.tscallsGET /api/experimental/chats.coderd/chat_routes_test.goin coder/coder asserts thatGET /api/experimental/chatsnow returns 404, under the comment "Promoted routes no longer answer on /api/experimental."coderd/chat_routes.goconfirms the surviving experimental surface.registerExperimentalChatRoutesmounts only:/chats/config/computer-use-provider/chats/config/advisor/chats/{chat}/stream/desktop/chats/{chat}/debug/runsand/chats/{chat}/debug/runs/{debugRun}Everything else moved to
/api/v2viaregisterChatAPIRoutes.Scope: four methods, not one
Because the experimental
/chatsgroup no longer registersGET /,POST /,GET /{chat}, orPOST /{chat}/messages, all four of the action's chat calls were broken, not just the reuse lookup.This ruled out the obvious stopgap: setting
force-new-chat: trueskips the reuse lookup, butcreateChatthen hits the same removed prefix and the run fails anyway.It also means a narrow one-line fix to
listChatswould have moved the failure rather than fixed it.Corroboration
On coder/coder#29625, the
Analyze PR for Documentation Updates Neededcheck failed after 7 seconds (10:58:15 to 10:58:22 UTC).That duration is consistent with dying at the reuse lookup, before any chat is created or polled.
Timeline caveat
coder/coder#29548 merged 2026-09-21 15:42 UTC, so this breakage is about a day old.
The original report described the check as red "for a while", which suggests an earlier, separate cause may also be in play:
doc-check.yamlhard-fails when thedoc-check-pr-<n>workspace goes dormant, per CODAGT-1025.This PR does not address that failure mode.
Follow-up
After release, bump the pinned action SHA in
.github/workflows/doc-check.yamlin coder/coder.That repo pins by commit SHA (currently
3e20636, v0.5.0), so this fix does not reach doc-check until that bump lands.Resolves CODAGT-1136.
Note
Coder Agents generated this pull request on Nick Vigilante's behalf.