t3code
t3code copied to clipboard
OpenCode 2: harden native lifecycle integration end to end
Problem
OpenCode 2 lifecycle state can diverge across volatile SSE reconnects, runtime requests, shell processes, and root or child sessions.
Scope
- Settle successful runtime replies locally after the provider HTTP reply succeeds. Treat late SSE events as no-ops.
- Make shell lifecycle state authoritative. Validate shell create/remove responses, process
shell.deleted, and connect active shell work to Stop, quarantine, and recovery. - Normalize supported
session.next.shellpayloads at the wire boundary. - Preserve native session and turn ownership across root or child sessions, reconnects, and finalization.
- Keep watchdog, stall recovery, and terminal cleanup consistent with the native state.
Done when
- A lost SSE reply cannot leave an accepted runtime request pending.
- Failed shell cleanup cannot clear quarantine.
- Supported shell event shapes do not crash the event pump.
- Root and child finalization does not orphan or cancel unrelated work.
- Focused replay scenarios cover lost replies, failed cleanup, shell deletion, child sessions, and reconnects.
Related: https://github.com/pingdotgg/t3code/pull/5251