🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

feat(coderd/x/chatd): add structured error fields to wait_agent error payload - #27478

Merged
ibetitsmike merged 1 commit into
mainfrom
mike/wait-agent-error-fields
Jul 25, 2026
Merged

feat(coderd/x/chatd): add structured error fields to wait_agent error payload#27478
ibetitsmike merged 1 commit into
mainfrom
mike/wait-agent-error-fields

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #27477 (now merged into main); this branch was rebased onto main accordingly. That PR puts the actionable provider detail into the wait_agent last_error string; this PR additionally exposes the decoded ChatError fields as structured siblings so the parent model does not have to parse prose to decide whether respawning makes sense.

Changes

  • Terminal wait_agent error payloads gain, when the persisted last_error decodes as a ChatError:
    • last_error_kind (defaults to generic when empty)
    • last_error_retryable (explicit bool)
    • last_error_detail (only when non-empty, verbatim as stored and as the chat UI renders it)
  • last_error stays a string with the semantics from fix(coderd/x/chatd): surface child error detail in wait_agent last_error #27477. Unrecognized payloads fall back to the status reason and get none of the structured fields.
  • subagentLastErrorMessage becomes subagentLastError, returning the decoded payload alongside the display string so decoding happens once for both the poll and timeout-recheck paths.
  • Exact assertions for populated, message-only, and unrecognized cases on both paths.

No other tool payloads change, and no repository consumer parses the wait_agent response shape, so the fields are additive.

Validation

  • go test ./coderd/x/chatd/..., make lint/go green.
  • Dogfood UAT on a dev instance: parent wait_agent results carried last_error_kind/last_error_retryable/last_error_detail for a detail fixture, and correctly omitted last_error_detail for a message-only fixture.

This PR was authored by Mux, an AI coding agent, operating on Mike's behalf.

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: cfb6d18dcf

ℹ️ 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/subagent-error-detail branch from 4e8294b to de969b6 Compare July 23, 2026 23:53
@ibetitsmike
ibetitsmike force-pushed the mike/wait-agent-error-fields branch from cfb6d18 to b46a779 Compare July 23, 2026 23:53
@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: b46a7793d7

ℹ️ 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/subagent-error-detail branch from de969b6 to 5a743ff Compare July 24, 2026 00:03
@ibetitsmike
ibetitsmike force-pushed the mike/wait-agent-error-fields branch from b46a779 to ed49709 Compare July 24, 2026 00:03
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: ed49709852

ℹ️ 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/subagent-error-detail branch from 5a743ff to f50e4ab Compare July 24, 2026 00:18
@ibetitsmike
ibetitsmike force-pushed the mike/wait-agent-error-fields branch from ed49709 to b3885ed Compare July 24, 2026 00:18
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: b3885ede18

ℹ️ 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/subagent-error-detail branch from f50e4ab to f221d4d Compare July 24, 2026 00:30
@ibetitsmike
ibetitsmike force-pushed the mike/wait-agent-error-fields branch from b3885ed to 8581cd8 Compare July 24, 2026 00:30
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 8581cd8751

ℹ️ 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 marked this pull request as ready for review July 24, 2026 15:51
@ibetitsmike
ibetitsmike force-pushed the mike/subagent-error-detail branch from f221d4d to 87f065b Compare July 24, 2026 18:01
@ibetitsmike
ibetitsmike force-pushed the mike/wait-agent-error-fields branch from 8581cd8 to f9d37ea Compare July 24, 2026 18:02
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: f9d37ea8ad

ℹ️ 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".

Base automatically changed from mike/subagent-error-detail to main July 24, 2026 19:01
@ibetitsmike
ibetitsmike force-pushed the mike/wait-agent-error-fields branch from f9d37ea to bfd2e8e Compare July 24, 2026 19:03
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: bfd2e8e80c

ℹ️ 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 merged commit 6159eb4 into main Jul 25, 2026
32 checks passed
@ibetitsmike
ibetitsmike deleted the mike/wait-agent-error-fields branch July 25, 2026 13:30
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 25, 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.

2 participants