Before submitting
Area
apps/server
Steps to reproduce
- Connect to OpenCode as a provider (via ACP)
- Have an active conversation with context
- Either: restart the computer / quit and reopen T3 Code, or simply leave the thread idle for some time (~30+ minutes)
- Send a follow-up message in the same thread
Expected behavior
T3 Code should call resumeSession (ACP protocol) with the previous session ID, restoring conversation context. OpenCode's ACP agent supports resumeSession and will replay the last 20 messages to restore context.
Actual behavior
T3 Code calls newSession instead of resumeSession, creating a fresh session with no context. The AI responds with "I don't have context from a previous conversation." The old session still exists in OpenCode's database (visible in OpenCode's own UI as a separate session).
This happens both after app/system restart and after the session is reaped due to inactivity. In both cases, the next message creates a new ACP session rather than resuming the existing one.
Root cause analysis
T3 Code's session reaping (provider.session.reaped, reason: inactivity_threshold) kills the provider connection after idle time. When the user sends a new message, T3 Code reconnects but calls newSession instead of resumeSession with the previous ACP session ID.
Looking at T3 Code's session docs, resumeCursor is persisted and used for Codex provider sessions. However, for ACP providers (like OpenCode), the session resume path doesn't appear to persist or pass the ACP session ID on reconnect.
OpenCode's ACP agent advertises sessionCapabilities: { resume: {} } in its initialize response and implements resumeSession which loads the session from SQLite and replays messages. T3 Code just needs to:
- Persist the ACP session ID (e.g.,
ses_19567fd2affe3jFlm4rRaKT5AO)
- Call
resumeSession({ sessionId, cwd }) instead of newSession when reconnecting to an ACP agent after transport disconnect, inactivity reap, or app restart
Impact
Blocks work completely — all conversation context is lost after any interruption.
Version or commit
Latest (v0.0.28)
Environment
macOS, OpenCode provider via ACP
Related issues
Workaround
After context is lost, open the original session directly in OpenCode's own UI (where the full context is preserved) instead of continuing through T3 Code.
Before submitting
Area
apps/server
Steps to reproduce
Expected behavior
T3 Code should call
resumeSession(ACP protocol) with the previous session ID, restoring conversation context. OpenCode's ACP agent supportsresumeSessionand will replay the last 20 messages to restore context.Actual behavior
T3 Code calls
newSessioninstead ofresumeSession, creating a fresh session with no context. The AI responds with "I don't have context from a previous conversation." The old session still exists in OpenCode's database (visible in OpenCode's own UI as a separate session).This happens both after app/system restart and after the session is reaped due to inactivity. In both cases, the next message creates a new ACP session rather than resuming the existing one.
Root cause analysis
T3 Code's session reaping (
provider.session.reaped,reason: inactivity_threshold) kills the provider connection after idle time. When the user sends a new message, T3 Code reconnects but callsnewSessioninstead ofresumeSessionwith the previous ACP session ID.Looking at T3 Code's session docs,
resumeCursoris persisted and used for Codex provider sessions. However, for ACP providers (like OpenCode), the session resume path doesn't appear to persist or pass the ACP session ID on reconnect.OpenCode's ACP agent advertises
sessionCapabilities: { resume: {} }in itsinitializeresponse and implementsresumeSessionwhich loads the session from SQLite and replays messages. T3 Code just needs to:ses_19567fd2affe3jFlm4rRaKT5AO)resumeSession({ sessionId, cwd })instead ofnewSessionwhen reconnecting to an ACP agent after transport disconnect, inactivity reap, or app restartImpact
Blocks work completely — all conversation context is lost after any interruption.
Version or commit
Latest (v0.0.28)
Environment
macOS, OpenCode provider via ACP
Related issues
Workaround
After context is lost, open the original session directly in OpenCode's own UI (where the full context is preserved) instead of continuing through T3 Code.