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]: emit agent_error session/update from acp/agent.ts when LLM call fails after retries #26379
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
This is the producer-side companion to the typed AgentErrorUpdatesession/update kind: actually emit the frame from acp/agent.tshandleEvent() when a non-tool LLM call fails after retries.
Background
The agent's event loop in acp/agent.tshandleEvent() already routes message.updated and tool-call events to the connected ACP client. Currently, when session/processor.tshalt() writes an error field on the assistant message after retries are exhausted, the agent loop has no case for surfacing it as an ACP frame — so the failure stays local to the agent process and the client sees a stalled turn.
Proposal
Add a case "session.error": (or equivalent) branch in handleEvent() that converts halt()'s recorded error into an AgentErrorUpdate frame and dispatches it on the existing session/update channel. With the typed kind in place, this is a small wiring change: read the error category from the recorded state, build the payload, send.
Out of scope
Defining the wire contract for AgentErrorUpdate itself — that should land first as a type-only addition (the closed-by-bot-but-still-relevant discussion in the related typed-kind issue covers the rationale).
The classification logic on the producer side (proxy / model adapter that decides "this is a budget error vs rate_limit vs unknown") — out of scope for this change; consumers can fall back to unknown until the producer side is wired.
Why this matters
Without this emit, an ACP client connected to opencode has no programmatic way to render "retry exhausted, call failed" — it has to rely on its own watchdog timeout, which is brittle and produces a UX of "the agent just stopped responding." Tool-call failures already have a typed channel; turn-level errors deserve the same.
This issue might be a duplicate of existing issues. Please check:
ACP adapter returns end_turn even when assistant message has internal error #24494: Same underlying problem — ACP adapter not surfacing turn-level errors to the client when LLM calls fail, with source-level analysis of acp/agent.ts and session/processor.ts. That issue also proposes returning a protocol-visible failure instead of a silent end_turn.
Closing as duplicate of #24494, which is the canonical issue for the ACP-side silent-failure problem (with source-level evidence pointing to session/processor.ts). Apologies for the noise.
PR #26352 implements the wiring change on the agent-loop side; I've updated that PR's body to point at #24494 and credit @hancengiz.
Activity
github-actions commentedon May 8, 2026
This issue might be a duplicate of existing issues. Please check:
acp/agent.tsandsession/processor.ts. That issue also proposes returning a protocol-visible failure instead of a silentend_turn.AgentErrorUpdatesession/update kind that this issue proposes emitting. These two issues appear to be intentionally split, but reviewers may want to track them together.truenorth-lj commentedon May 8, 2026
Closing as duplicate of #24494, which is the canonical issue for the ACP-side silent-failure problem (with source-level evidence pointing to
session/processor.ts). Apologies for the noise.PR #26352 implements the wiring change on the agent-loop side; I've updated that PR's body to point at #24494 and credit @hancengiz.