Repository navigation
fix(omp): preserve recorded transcript paths when resuming - #20634
Conversation
Based on the resume-locator proposal in #16276 by @CodeHourra. Retains UUID-based ownership and existing reattach behavior.
📝 WalkthroughWalkthroughThe OMP resume argument now falls back from an explicit transcript path to the recorded provider Priority: ⬇️ Low Merge Risk: 🟡 Moderate · up to OMP sessions stored outside the default session location can still fall back to UUID resumption and fail. Propagate the recorded transcript path before merging. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 5 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
⚠️ Outside diff range comments (1)
src/shared/agent-session-resume.ts (1)
229-230: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winPropagate the OMP
session_filelocator.The OMP extension currently posts only
session_id(src/main/pi/agent-status-extension-source.ts:64-87), and the runtime-routed OMP path also omitssession_file(:38-47). When an OMP payload does containsession_file,extractAgentProviderSessionstill drops it (src/shared/agent-session-resume.ts:227-230), so the resume builder falls back to the UUID and cannot resume sessions outside the default store.Emit
session_filefrom the OMP hook, pass it through withwithTranscriptPath(..., ['session_file']), and add hook-emission and extraction tests.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 9e63cdda-8ead-4d4e-a806-3905790974c2
📒 Files selected for processing (6)
docs/reference/omp-resume-transcript-locator.mdsrc/renderer/src/lib/resume-sleeping-agent-session-provider-claim.test.tssrc/renderer/src/lib/sleeping-agent-session-launch-windows-quoting.test.tssrc/shared/agent-session-resume.test.tssrc/shared/agent-session-resume.tstests/tools/omp-resume-transcript-locator-smoke.mjs
Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review.
There was a problem hiding this comment.
Important
The new OMP fallback cannot fire as written: nothing in the tree ever populates providerSession.transcriptPath for agent: 'omp', so this change does not fix the custom-session-folder resume the PR describes. It is behavior-preserving (falls back to the id), but it lands a dead branch plus a doc asserting a hook flow that does not exist.
Reviewed changes
- OMP resume precedence —
getAgentResumeArgvnow selectsompResumeFilePath?.trim()→providerSession.transcriptPath?.trim()→ session id (src/shared/agent-session-resume.ts:279). - Builder tests — a precedence table for explicit/recorded/blank/UUID (
agent-session-resume.test.ts), Windows cmd/PowerShell quoting and a remote POSIX path that must not use the local shell (sleeping-agent-session-launch-windows-quoting.test.ts), and provider-claim stability when a later record adds a path (resume-sleeping-agent-session-provider-claim.test.ts). - Reference doc + smoke tool —
docs/reference/omp-resume-transcript-locator.mdandtests/tools/omp-resume-transcript-locator-smoke.mjs, which drives a real OMPSessionManagerand asserts the generated argv round-trips the original session.
ℹ️ Nitpicks
resume-sleeping-agent-session-provider-claim.test.ts:147-153passes with the source change reverted:getProviderSessionClaimKeyonly foldstranscriptPathin forpi/prime-agent(sleeping-agent-pane-ownership.ts:13-18), so the OMP equality holds trivially. Fine as an invariant guard, but it is not coverage for this change.docs/reference/omp-resume-transcript-locator.mdis not added to the.gitignoreallow-list; this matches repo norms and is non-blocking.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| ? [ | ||
| 'omp', | ||
| '--resume', | ||
| ompResumeFilePath?.trim() || providerSession.transcriptPath?.trim() || id |
There was a problem hiding this comment.
This fallback is unreachable for OMP in the current tree: no production path ever sets transcriptPath on an OMP providerSession, so the branch cannot address the custom-session-folder resume the PR describes. The OMP hook extractor drops any transcript field, and the bundled OMP extension deliberately sends only session_id.
Technical details
# OMP transcript path has no producer
## Affected sites
- `src/shared/agent-session-resume.ts:228-231` — `case 'omp'` returns `{ key: 'session_id', id }`; `withTranscriptPath` is only invoked for claude/codex (`:192`) and pi/prime-agent (`:215`).
- `src/main/pi/agent-status-extension-source.ts:64-82` — the `kind === 'omp'` branch builds `{ session_id }` only; `updateRuntimeOmpSessionMetadata` (`:43`) also strips `session_file`, and `:83` documents "OMP resumes directly by session id (#8962)". `agent-status-extension-source.test.ts:266` asserts `session_file` is absent.
- `src/renderer/src/lib/ai-vault-resume-command.ts:253-268` — `getAiVaultAgentProviderSession` attaches `transcriptPath` only for pi/prime-agent; OMP's locator travels separately as `ompResumeFilePath` (`:178-180`).
- `src/main/runtime/agent-session-claim-identity.ts:67` and `src/renderer/src/lib/sleeping-agent-pane-ownership.ts:13-18` — both also special-case only pi/prime-agent.
- `normalizeAgentProviderSession` (`:145-162`) and the sleeping schema are pass-through hydration, not producers.
## Required outcome
- Either land a producer with this change (e.g. the OMP extension reports `session_file` and `extractAgentProviderSession('omp', …)` captures it, the resume-locator portion of PR #16276), or have the AI Vault OMP path populate `transcriptPath`; or
- Drop/annotate the dead branch so the change does not imply a fix it cannot deliver.
## Open questions for the human
- Which code path populates `providerSession.transcriptPath` for OMP in the runtime validation you ran? The bundled extension and extractor in this commit both exclude it.
- If a producer is landing in a separate PR, is this meant to merge ahead of it as a no-op prep step?| A sleeping OMP session can retain its transcript path from a hook without an | ||
| explicit `launchConfig.ompResumeFilePath`. Both cold-restore startup and generic | ||
| sleeping-session launch already forward the provider metadata to | ||
| `getAgentResumeArgv`; that builder must keep the recorded path. |
There was a problem hiding this comment.
This premise does not hold in this commit: the bundled OMP extension sends only session_id (agent-status-extension-source.ts:64-82) and extractAgentProviderSession('omp', …) ignores transcript fields (agent-session-resume.ts:228-231), so a sleeping OMP record never has a transcriptPath to retain. If a producer is landing separately, describe the fallback as forward-compatible; otherwise this claim is inaccurate.
|
Risk-reduction review at 58 tests + actual OMP custom-root path smoke pass; main and #20611/#20615 inspected to confirm missing producer. Remaining user-facing consequence: Cannot deliver the complete resume fix alone. Producer dependencies remain in the excluded native-chat group; no automatic expansion of scope. |

ELI5
OMP cannot resume a conversation by ID when its file lives outside the normal session folder. Orca already remembers the file path, but dropped it while building the resume command. It now uses that recorded path.
What Changed
Select the OMP resume target in this order: explicit launch override, recorded provider transcript path, session ID. Reuse existing shell quoting and keep conversation ownership keyed by ID.
Why
Actual OMP runtime validation reproduces ID lookup failure for a custom session folder. The absolute path and corrected Orca command both resume the original conversation.
Linked Issue
Related PR #16276 by @CodeHourra; credits its resume-locator proposal. This is a bounded correction from that proposal, not adoption of its replay-based command injection or title changes.
Visual Proof
N/A — resume command construction only. Actual before/after runtime evidence: custom-root ID lookup throws not-found; absolute-path and generated-argv resume both return the original session identity, with zero model calls. No rendered terminal-launch proof claimed.
Testing
ORCA_BACKGROUND_LAUNCH=1 bun tests/tools/omp-resume-transcript-locator-smoke.mjs /path/to/oh-my-pi.Review
Independently reviewed. The upstream OMP checkout was read-only.
Agent skill upstream boundary
Notes
No new wire fields, execution-host routing or reattach behavior. Older metadata without a transcript path retains ID fallback. Native Windows/SSH execution was not rerun; shell selection is covered by builder tests.
Checklist
Merge dependency discovered in final review
This consumer is not a standalone end-to-end fix at
8618cbfe4e14. The production OMP transcript-path producer is in #20615, stacked on #20611. Merge order: #20611 → #20615 → #20634. The runtime smoke proves the resume consumer with populated metadata; it does not establish that this branch alone produces that metadata. The original #16276 also contains broader sleep/replay/title behavior that this bounded replacement does not adopt.Contributor credit for the resume-locator proposal in #16276 (@CodeHourra), verified against its Git commit author:
Co-authored-by: stevelliu [email protected]