refactor(codersdk): use shared error helpers in chat endpoints - #27858
Merged
Conversation
Contributor
Author
This was referenced Aug 4, 2026
dylanhuff-at-coder
force-pushed
the
dylan/plat-378-chats-read-body-as-json
branch
from
August 5, 2026 17:52
c50480e to
8708970
Compare
dylanhuff-at-coder
force-pushed
the
dylan/plat-378-codersdk-read-body-as-json
branch
from
August 5, 2026 17:52
a08a60d to
0f4d0e0
Compare
dylanhuff-at-coder
added a commit
that referenced
this pull request
Aug 5, 2026
This PR migrates 224 typed JSON response sites across 46 files to `codersdk.ReadBodyAsJSON`, so invalid 2xx bodies return structured errors while preserving URL credential redaction. It intentionally excludes agent-direct HTTP, Azure IMDS, `UseNumber`, and chat paths; stacked on #27804, with chat and lint follow-ups in #27858 and #27859. Refs #27044. Reviewed and updated by Coder Agents on behalf of @dylanhuff-at-coder.
Base automatically changed from
dylan/plat-378-codersdk-read-body-as-json
to
main
August 5, 2026 20:22
dylanhuff-at-coder
marked this pull request as ready for review
August 5, 2026 20:22
dylanhuff-at-coder
requested review from
ibetitsmike and
johnstcn
as code owners
August 5, 2026 20:22
dylanhuff-at-coder
force-pushed
the
dylan/plat-378-chats-read-body-as-json
branch
from
August 5, 2026 20:31
8708970 to
c844638
Compare
dylanhuff-at-coder
marked this pull request as draft
August 5, 2026 20:50
dylanhuff-at-coder
marked this pull request as ready for review
August 5, 2026 20:54
dylanhuff-at-coder
marked this pull request as draft
August 5, 2026 21:02
dylanhuff-at-coder
marked this pull request as ready for review
August 5, 2026 21:12
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

Migrate chat endpoint response decoding to
ReadBodyAsJSONand consolidateReadBodyAsErrorconstruction throughnewResponseError, so empty-body and non-JSON errors consistently include the request method and URL.Stacked on #27857, with the lint rule following in #27859. Refs #27044.
Reviewed and updated by Coder Agents on behalf of @dylanhuff-at-coder.