[Bug]: OMP terminals are excluded from cold session restoration
Operating system
macOS
Orca version
1.4.124
Details
OMP terminals report status through Orca's managed Pi-compatible extension, but Orca never records OMP's provider session ID. When a restart or crash requires a cold terminal restore (the prior PTY cannot be reattached), Claude is relaunched with claude --resume <session-id>, while OMP cannot enter the same restoration path and falls back to an unresumed terminal.
omp v17.0.1 --help confirms the supported interface is:
-r, --resume=<value> Resume a session (by ID prefix, path, or picker if omitted)
Reproduction
- Open an Orca terminal and launch
omp. - Send at least one prompt so OMP creates a persisted session.
- Restart Orca in a way that forces cold restoration, such as terminating the PTY daemon with the app rather than allowing warm daemon reattachment.
- Reopen the workspace and restored terminal.
Expected: Orca starts omp --resume <session-id> in the existing pane and shows the session-restored banner, matching Claude/Codex behavior.
Actual: no OMP sleeping-session record exists, so pty-connection.ts has no provider session from which to build a cold-resume startup command.
Code path and root cause
The general restoration pipeline is already present:
agent-hook-listener.tscallsextractAgentProviderSession(...)and attaches the result to the agent status row.agent-status.tsonly creates aSleepingAgentSessionRecordwhen the agent is resumable, hasproviderSession, andgetAgentResumeArgv(...)succeeds.pty-connection.tsconsumes that record only on cold restore and builds the replacement startup command. This preserves the #5232/#5240 invariant: warm reattachment must not launch a duplicate agent tab/session.
OMP is blocked at every input to that pipeline in agent-session-resume.ts:
export const RESUMABLE_TUI_AGENTS = [
'claude',
'codex',
// ...
'devin'
] as const
omp is absent from RESUMABLE_TUI_AGENTS; extractAgentProviderSession explicitly returns null for it; and getAgentResumeArgv has no OMP case.
The missing source fact is visible in the generated managed extension. agent-status-extension-source.ts posts the supplied extra object unchanged:
payload: { hook_event_name: hookEventName, ...extra }
agent-status-handler-source.ts registers handlers without the extension context and only posts prompt/tool/message fields:
pi.on('before_agent_start', (event) => {
post('before_agent_start', { prompt: event.prompt ?? '' })
})
OMP's extension API already exposes the authoritative ID as ctx.sessionManager.getSessionId(). The CLI accepts that ID through omp --resume <id>, so Orca does not need to infer a session from paths, titles, or process state.
Possible fix
- In
agent-status-handler-source.ts, accept the secondctxargument for each status handler and attachsession_id: ctx.sessionManager.getSessionId()to every posted snapshot. Attach it to every event rather than only the first because the transport intentionally keeps only the latest pending post, and sessions can switch within a process. - In
agent-session-resume.ts:- add
'omp'toRESUMABLE_TUI_AGENTS; - parse OMP's
session_idinto{ key: 'session_id', id }; - return
['omp', '--resume', id]fromgetAgentResumeArgv.
- add
- Keep
piunsupported unless its CLI resume contract is independently verified; this issue only needs the explicit OMP contract. - Add focused coverage:
- the generated OMP hook payload includes
session_idfrom the extension context; extractAgentProviderSession('omp', ...)andgetAgentResumeArgv('omp', ...)round-trip the ID;- quit/live capture persists an OMP sleeping record and cold restore launches
omp --resume <id>in the same pane; - warm daemon reattachment still does not launch a duplicate OMP process.
- the generated OMP hook payload includes
This should reuse the existing sleeping-session schema and cold-restore flow rather than adding an OMP-specific restoration path.
🤖 Agent handoff — reproduction kit
Status: REPRODUCED · GitHub label has_repro
Writeup (branch): docs/bug-reproductions/8962.md
Branch with tests + docs: nwparker/bug-repro-handoffs
Summary
OMP posts agent-status hooks through the managed Pi-compatible extension, but Orca never records an OMP provider session ID. Cold restore therefore cannot build omp --resume <id> and falls back to an unresumed shell. Claude/Codex/etc. already go through the sleeping-session + cold-resume path.
Automated re-run
git fetch origin nwparker/bug-repro-handoffs
git checkout nwparker/bug-repro-handoffs
# or: git worktree add /tmp/orca-repro-8962 origin/nwparker/bug-repro-handoffs
# See writeup on branch: docs/bug-reproductions/8962.md
Code / evidence files
- (no automated test file yet — use writeup steps)
How another agent should use this
- Check out
nwparker/bug-repro-handoffs(or cherry-pick therepro-*test for this issue). - Run the command(s) above — green documents the bug (or
cannot_reproproves current tree does not show it). - Implement the fix on a new branch from
main; keep/adapt the repro test as a regression test that should flip behavior or stay as a guard. - Open a PR with: Description, Evidence, ELI5, User-regression-tradeoffs.
Posted by bug-repro orchestration so work is not trapped in a local worktree only.
Independent cross-platform confirmation on Windows 11 with a WSL2 / Ubuntu 24.04 project runtime, using Orca v1.4.146 and OMP v17.0.5.
The two restart paths behave differently:
- When Orca restarts itself during an application update, the previously open OMP session is restored and remains attached.
- When Orca is fully closed and then launched again, the same pane returns only as a plain terminal; OMP is not relaunched or resumed.
This is a useful differential reproduction of warm PTY reattachment versus cold restoration and matches the root cause described here. Please include this Windows/WSL scenario in validation for #8991: a full quit and relaunch should restore the pane by running omp --resume <session-id>, while an update-time warm reattachment must continue to avoid launching a duplicate process.
will be in next release, usually within 24 hours