fix(coderd/x/chatd): surface child error detail in wait_agent last_error - #27477
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4e8294b774
ℹ️ 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".
4e8294b to
de969b6
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: de969b63c3
ℹ️ 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".
de969b6 to
5a743ff
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5a743ff821
ℹ️ 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".
5a743ff to
f50e4ab
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f50e4ab27b
ℹ️ 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".
f50e4ab to
f221d4d
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
f221d4d to
87f065b
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 87f065bef1
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 87f065bef1
ℹ️ 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".
When a child subagent chat fails, its persisted
last_errorcarries both a normalizedmessageand an actionable providerdetail. Thewait_agenttool result returned only the message, which for unclassified failures is the generic fallback "The chat request failed unexpectedly." The detail (for examplereasoning model `max` not supported) never reached the parent model, so it retried blind instead of self-correcting (observed in dogfood chat37c516d2: the parent respawned a kimi-k3 child withmaxeffort twice and needed human intervention to switch toxhigh).Changes
subagentLastErrorMessagenow builds thelast_errorstring with the detail: detail alone when the message is empty or the generic fallback,message (detail)when both are meaningful, and message alone when there is no detail. This mirrors exactly what the chat UI already renders from the same persisted payload; no content is added or removed relative to what the user sees in the chat window.ChatError) no longer surface at all; the handler falls back to its status reason instead of exposing raw stored JSON.last_erroron both the normalwait_agentpoll path and the timeout TOCTOU recheck path.Both paths share the same response block, so no other tool payloads change.
An earlier revision added read-path credential redaction (auth-detail suppression plus scrubbing regexes) on top of this. It was removed: the same detail is already served verbatim to the same user through the chats API and rendered in the chat window, so a
wait_agent-only scrub added inconsistency without a security boundary, and its opaque-token heuristic destroyed useful diagnostics such as request IDs. If provider error bodies echoing credentials ever becomes a demonstrated problem, the fix belongs at classification/write time inchaterrorso every surface stays consistent.Validation
go test ./coderd/x/chatd/...,make lint/gogreen.wait_agentresult now carriesreasoning model `max` not supportedinstead of the generic message.