You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: typed AgentErrorUpdate session/update kind for non-tool LLM failures #26378
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
When a non-tool LLM call in an ACP session exhausts retries (AI_RetryError: maxRetriesExceeded or any unhandled error from the model stream), session/processor.tshalt() writes the failure to the local logfile and updates the assistant message's internal error field, but it never emits an ACP frame back to the client.
On the wire this looks like silence — the assistant message persists with parts: [] and no stopReason, and a connected ACP client has no way to distinguish "still streaming" from "the call failed."
Tool-call failures don't have this problem because they ride tool_call / tool_call_update shapes. But turn-level errors (rate limits, provider 5xx, context-overflow rejections, budget gates, auth failures, etc.) currently have no typed channel back to the client.
Reproduction
Connect an ACP client and start a session.
Trigger a turn that exhausts retries against the model provider (e.g. force a 429 or a bad API key).
Observe: the client never receives any frame indicating the turn ended with an error. The watchdog (or a long human wait) is the only way to notice the turn is dead.
Proposal
Add a new session/update kind, agent_error, carrying a small closed vocabulary of error categories so clients can render a typed banner / retry affordance instead of guessing from a watchdog timeout.
The contract can land first as a type-only addition (no behaviour change, nothing imports the new module yet); the actual emit at halt() would be a follow-up so the wire contract is frozen before the producer change rolls out.
Why a new local type rather than extending @agentclientprotocol/sdk
The SDK's SessionUpdate is a closed type alias (discriminated union), not an interface. TypeScript declaration merging only works on interfaces, so the union can't be extended via an ambient .d.ts patch. A local extended union SessionUpdateWithAgentError = SessionUpdate | AgentErrorUpdate is the clean TS-native approach. If the SDK ever adopts agent_error as a first-class kind, the local alias can be deleted and the SDK literal imported directly — no other code needs to change.
If these are intentionally separate (e.g. wire-contract first, then emit wiring as a follow-up), please add a cross-reference comment linking them so reviewers can see the full picture.
Activity
github-actions commentedon May 8, 2026
This issue might be a duplicate of (or very closely related to) existing issues. Please check:
end_turn).If these are intentionally separate (e.g. wire-contract first, then emit wiring as a follow-up), please add a cross-reference comment linking them so reviewers can see the full picture.
github-actions commentedon Jul 9, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.