Summary
After restarting sandbox-agent, gateway, or rivetkit, native session continuity appears broken for prompt execution in our Sprite environment:
promptSameHandleAfterRestart times out
resumeSession + getEvents can succeed
promptAfterResume still times out
Environment
- sandbox-agent CLI/server:
0.2.0
- SDK:
sandbox-agent TypeScript package 0.2.0
- Agent under test:
opencode
- Sandbox provider: Sprites (Fly)
- Gateway route:
https://<sprite>.sprites.app/sandbox
Repro (phase-level)
- Create session and prompt successfully.
- Restart one target (
sandbox-agent OR gateway OR rivetkit).
- Prompt on same session handle (
promptSameHandleAfterRestart) -> timeout.
- Reconnect + call
getEvents -> success.
- Call
resumeSession -> success.
- Prompt after resume (
promptAfterResume) -> timeout.
Observed signatures
TypeError: terminated (unhandled rejection around restart window)
ACP client is closed
Results (inline)
Native continuity diagnostic (1 run/target)
- total:
0/3 success
- failure boundary phase:
promptSameHandleAfterRestart in 3/3
- per target:
sandbox-agent: same-handle prompt ❌, reconnect/getEvents ✅, resumeSession ✅, post-resume prompt ❌
gateway: same-handle prompt ❌, reconnect/getEvents ✅, resumeSession ✅, post-resume prompt ❌
rivet: same-handle prompt ❌, reconnect/getEvents ✅, resumeSession ✅, post-resume prompt ❌
Fallback contrast (recreate + rehydrate)
If we do not reuse the pre-restart session handle, and instead:
- create a fresh post-restart session
- rehydrate from a client-side transcript envelope
then matrix result is 6/6 success (sandbox-agent 2/2, gateway 2/2, rivet 2/2).
Minimal log excerpts
Error: promptSameHandleAfterRestart timed out after 60000ms
TypeError: terminated
ACP write error: Error: ACP client is closed
Error: promptAfterResume timed out after 60000ms
(recreate + rehydrate path)
createAfter: ok
promptRehydrate: ok (stopReason=end_turn)
Note on prior links
The previous issue body included links to a private repo by mistake. I removed those and pasted the key evidence inline here.
Ask
Can you confirm whether this is expected in 0.2.0 during restart transport churn, or a bug in native session continuity/rebind after restart? If helpful, I can provide a standalone public repro script with no private dependencies.
Summary
After restarting
sandbox-agent,gateway, orrivetkit, native session continuity appears broken for prompt execution in our Sprite environment:promptSameHandleAfterRestarttimes outresumeSession+getEventscan succeedpromptAfterResumestill times outEnvironment
0.2.0sandbox-agentTypeScript package0.2.0opencodehttps://<sprite>.sprites.app/sandboxRepro (phase-level)
sandbox-agentORgatewayORrivetkit).promptSameHandleAfterRestart) -> timeout.getEvents-> success.resumeSession-> success.promptAfterResume) -> timeout.Observed signatures
TypeError: terminated(unhandled rejection around restart window)ACP client is closedResults (inline)
Native continuity diagnostic (1 run/target)
0/3successpromptSameHandleAfterRestartin3/3sandbox-agent: same-handle prompt ❌, reconnect/getEvents ✅, resumeSession ✅, post-resume prompt ❌gateway: same-handle prompt ❌, reconnect/getEvents ✅, resumeSession ✅, post-resume prompt ❌rivet: same-handle prompt ❌, reconnect/getEvents ✅, resumeSession ✅, post-resume prompt ❌Fallback contrast (recreate + rehydrate)
If we do not reuse the pre-restart session handle, and instead:
then matrix result is
6/6success (sandbox-agent 2/2,gateway 2/2,rivet 2/2).Minimal log excerpts
Note on prior links
The previous issue body included links to a private repo by mistake. I removed those and pasted the key evidence inline here.
Ask
Can you confirm whether this is expected in
0.2.0during restart transport churn, or a bug in native session continuity/rebind after restart? If helpful, I can provide a standalone public repro script with no private dependencies.