Summary
Claude ACP sessions can appear to stall in sandbox-agent after Claude transitions into background task notifications.
On the stable sandbox-agent v0.4.2 line, the observed failure mode is:
- long-running Claude turns stop producing persisted ACP updates after background task activity begins
sandbox-agent can still be working underneath, but downstream consumers only see a stale event stream
- this leads to stalled turns and transcript-only recovery paths instead of normal ACP completion
Root Cause
The installed Claude ACP adapter drops these Claude system events instead of surfacing them as ACP session/update notifications:
task_started
task_notification
task_progress
hook_progress
files_persisted
That means sandbox-agent persistence receives no new ACP envelopes while Claude is still actively working in the background.
Separately, older Claude ACP installs also need to opt into session_state_changed so idle can terminate the turn cleanly.
Repro Shape
- Run
sandbox-agent stable v0.4.2 with a Claude agent process install from the older Zed package line.
- Start a Claude session that runs long enough to hand work to background tasks.
- Observe that normal assistant text may have already streamed, but persisted ACP events stop advancing during the background-task window.
- Downstream consumers see an apparently stalled session until transcript-based recovery or manual intervention.
Expected
- Claude background task activity continues to arrive via ACP
session/update
- session persistence keeps advancing during background work
- the turn finishes via normal ACP completion (
end_turn / idle path), without transcript-only recovery
Proposed Fix
In the stable line installer path:
- patch installed Claude ACP adapter builds to opt into
CLAUDE_CODE_EMIT_SESSION_STATE_EVENTS=1 when needed
- forward dropped Claude background-task system events as ACP
session/update notifications instead of discarding them
- keep the fallback Claude ACP pin current enough to include the idle/end-turn behavior (
0.23.1 instead of 0.20.0)
I have a fork-side patch prepared for this and will open a PR linked to this issue.
Summary
Claude ACP sessions can appear to stall in
sandbox-agentafter Claude transitions into background task notifications.On the stable
sandbox-agentv0.4.2line, the observed failure mode is:sandbox-agentcan still be working underneath, but downstream consumers only see a stale event streamRoot Cause
The installed Claude ACP adapter drops these Claude system events instead of surfacing them as ACP
session/updatenotifications:task_startedtask_notificationtask_progresshook_progressfiles_persistedThat means
sandbox-agentpersistence receives no new ACP envelopes while Claude is still actively working in the background.Separately, older Claude ACP installs also need to opt into
session_state_changedsoidlecan terminate the turn cleanly.Repro Shape
sandbox-agentstablev0.4.2with a Claude agent process install from the older Zed package line.Expected
session/updateend_turn/ idle path), without transcript-only recoveryProposed Fix
In the stable line installer path:
CLAUDE_CODE_EMIT_SESSION_STATE_EVENTS=1when neededsession/updatenotifications instead of discarding them0.23.1instead of0.20.0)I have a fork-side patch prepared for this and will open a PR linked to this issue.