Skip to content

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

Draft
ibetitsmike wants to merge 1 commit into
mike/subagent-error-detailfrom
mike/wait-agent-error-fields
Draft

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

Conversation

@ibetitsmike

Copy link
Copy Markdown
Collaborator

Stacked on #27477. 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)
  • last_error stays a string with the semantics from fix(coderd/x/chatd): surface child error detail in wait_agent last_error #27477. Malformed payloads keep the raw-JSON string 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 malformed 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".

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant