Repository navigation
feat(ai-vault): add OMP sessions to the AI Vault session browser - #7618
Conversation
Adds OMP ("Oh My Pi") to the AI Vault/Agents catalog so historical
.omp/agent/sessions/**/*.jsonl transcripts are discovered, parsed, and
resumable from the right-sidebar session browser — locally and over SSH.
- Discovery mirrors Pi (OMP_CODING_AGENT_DIR env, WSL home roots, per-agent
limit) in both the local scanner and the remote/SSH scanner.
- Parses OMP's message-graph JSONL via the shared graph parser (new
MessageGraphAgent type), capturing the model from model_change.model (OMP's
key, not Pi's modelId) or the assistant message, and tokens from usage.
- Routes OMP through the incremental parse cache so ~5s rescans resume from
the last byte instead of re-reading whole transcripts.
- Resumes by absolute transcript path (`omp --resume <path>`) so it resolves
regardless of which session-dir root (custom OMP_CODING_AGENT_DIR / WSL
store) the file was discovered under; threaded through both the scanner and
the renderer's local resume/copy rebuild.
- Renderer reuses the existing OmpIcon/catalog/grouping; adds overflow-x-hidden
so long worktree chips never widen the sidebar.
Generalizes normalizePiSessionsDir -> normalizeAgentSessionsDir. Verified
end-to-end against 10 real ~/.omp transcripts and rendered in the app.
Co-authored-by: gatsby74 <166927047+gatsby74@users.noreply.github.com>
Real-data verification evidenceRan the actual In the running build, |
AmethystLiang
left a comment
There was a problem hiding this comment.
Reviewed the replacement for #7255 and added one small merge-readiness fix to make the AI Vault parse-cache agent switch explicit.\n\nValidated with the focused AI Vault/resume Vitest suite, typecheck, changed-file oxlint, switch-exhaustiveness, diff whitespace checks, and the Electron UI evidence captured during the #7255 review.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughChangesThis PR adds support for the Sequence Diagram(s)Not applicable. Compact metadata
Related issues: None provided Suggested labels: ai-vault, enhancement, omp-agent Suggested reviewers: None specified Poem 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 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.
🧹 Nitpick comments (1)
src/main/ai-vault/session-scanner-opencode-sqlite-coexistence.test.ts (1)
21-42: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDuplicate
isolatedScanRootsdrifting from the shared fixture.This file defines its own local
isolatedScanRootsthat duplicatessession-scanner-test-fixtures.ts's exported version. This PR had to addompSessionsDirin both places, and the two copies have already drifted: here it's appended afterkimiSessionsDir(Line 40), while the shared fixture inserts it right afterpiSessionsDir. Importing the sharedisolatedScanRootsinstead would prevent this kind of silent divergence when new agents are added.♻️ Proposed fix to reuse the shared fixture
-function isolatedScanRoots(root: string) { - return { - claudeProjectsDir: join(root, 'claude-projects'), - codexSessionsDir: join(root, 'codex-sessions'), - geminiSessionsDir: join(root, 'gemini-sessions'), - copilotSessionsDir: join(root, 'copilot-sessions'), - cursorProjectsDir: join(root, 'cursor-projects'), - opencodeStorageDir: join(root, 'opencode-storage'), - opencodeDbPaths: [] as readonly string[], - grokSessionsDir: join(root, 'grok-sessions'), - devinTranscriptsDir: join(root, 'devin-transcripts'), - hermesSessionsDir: join(root, 'hermes-sessions'), - rovoSessionsDir: join(root, 'rovo-sessions'), - openclawStateDir: join(root, 'openclaw-state'), - openclawLegacyStateDir: join(root, 'openclaw-legacy-state'), - piSessionsDir: join(root, 'pi-sessions'), - droidSessionsDir: join(root, 'droid-sessions'), - droidProjectsDir: join(root, 'droid-projects'), - kimiSessionsDir: join(root, 'kimi-sessions'), - ompSessionsDir: join(root, 'omp-sessions') - } -} +import { isolatedScanRoots } from './session-scanner-test-fixtures'
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: b9aea495-ce17-41d3-860d-f516e3526503
📒 Files selected for processing (19)
src/main/ai-vault/remote-session-scanner-sources.tssrc/main/ai-vault/session-scanner-accumulator.tssrc/main/ai-vault/session-scanner-agent-parser.tssrc/main/ai-vault/session-scanner-codex-workers.test.tssrc/main/ai-vault/session-scanner-graph-parsers.tssrc/main/ai-vault/session-scanner-incremental-fixtures.tssrc/main/ai-vault/session-scanner-opencode-sqlite-coexistence.test.tssrc/main/ai-vault/session-scanner-parse-cache.tssrc/main/ai-vault/session-scanner-source-discovery.tssrc/main/ai-vault/session-scanner-test-fixtures.tssrc/main/ai-vault/session-scanner-types.tssrc/main/ai-vault/session-scanner-values.test.tssrc/main/ai-vault/session-scanner-values.tssrc/main/ai-vault/session-scanner.test.tssrc/renderer/src/components/right-sidebar/AiVaultSessionVirtualList.tsxsrc/renderer/src/lib/ai-vault-resume-command.test.tssrc/renderer/src/lib/ai-vault-resume-command.tssrc/shared/ai-vault-resume-command.test.tssrc/shared/ai-vault-types.ts
…ts-to-mobile Reconciles the mobile aiVault.listSessions RPC with main's runtime-host scanning (#7631), OMP sessions (#7618/#7628), host-aware attribution (#7367), and zero-turn recovery (#7889): - One aiVault.listSessions serves mobile (no executionHostId), the desktop parent, and web clients: bounded params kept, results served from the shared host-local cache and restamped per-caller at the RPC edge. - Desktop's runtime-host RPC client caps scopePaths to the shared bound so large desktops degrade gracefully instead of failing validation. - Desktop IPC local scope delegates to the shared cache module (single cache with the RPC path); ssh/runtime/all merges keep main's outer cache. - Main's zero-turn empty-session semantics and ExecutionHostId-typed project attribution replayed onto the /shared lifted filter core. - Mobile resume forwards session.filePath so OMP resumes by absolute transcript path (desktop parity). Co-authored-by: Orca <help@stably.ai>
…blyai#7618) * feat(ai-vault): add OMP sessions to the AI Vault session browser Adds OMP ("Oh My Pi") to the AI Vault/Agents catalog so historical .omp/agent/sessions/**/*.jsonl transcripts are discovered, parsed, and resumable from the right-sidebar session browser — locally and over SSH. - Discovery mirrors Pi (OMP_CODING_AGENT_DIR env, WSL home roots, per-agent limit) in both the local scanner and the remote/SSH scanner. - Parses OMP's message-graph JSONL via the shared graph parser (new MessageGraphAgent type), capturing the model from model_change.model (OMP's key, not Pi's modelId) or the assistant message, and tokens from usage. - Routes OMP through the incremental parse cache so ~5s rescans resume from the last byte instead of re-reading whole transcripts. - Resumes by absolute transcript path (`omp --resume <path>`) so it resolves regardless of which session-dir root (custom OMP_CODING_AGENT_DIR / WSL store) the file was discovered under; threaded through both the scanner and the renderer's local resume/copy rebuild. - Renderer reuses the existing OmpIcon/catalog/grouping; adds overflow-x-hidden so long worktree chips never widen the sidebar. Generalizes normalizePiSessionsDir -> normalizeAgentSessionsDir. Verified end-to-end against 10 real ~/.omp transcripts and rendered in the app. Co-authored-by: gatsby74 <166927047+gatsby74@users.noreply.github.com> * fix: make AI Vault parse-cache agent switch explicit --------- Co-authored-by: gatsby74 <166927047+gatsby74@users.noreply.github.com> Co-authored-by: Jinjing <6427696+AmethystLiang@users.noreply.github.com>
Summary
Adds OMP ("Oh My Pi", a Pi fork) to the AI Vault / Agents session catalog so
historical
.omp/agent/sessions/**/*.jsonltranscripts are discovered, parsed,and resumable from the right-sidebar session browser — locally and over SSH.
This takes over and supersedes #7255 (thanks @gatsby74 — credited via
Co-authored-by). That branch was green against its own base but stale againstcurrent
main, which had since refactored the scanner. Rebuilt on currentmainand hardened via an adversarial multi-lens review.What it does
OMP_CODING_AGENT_DIRenv, WSL home roots,per-agent scan limit,
.jsonl) in the local scanner and the remote/SSHscanner.
MessageGraphAgenttype. Captures the model frommodel_change.model(OMP'skey — Pi uses
modelId) or the assistant message, and tokens fromusage.resume from the last byte instead of re-reading whole transcripts (STA-1278/1417).
omp --resume <path>) — it resolvesregardless of which session-dir root the file was discovered under (custom
OMP_CODING_AGENT_DIR/ WSL store), where an id-prefix lookup against thedefault store would miss. Threaded through both the scanner and the
renderer's local resume/copy rebuild.
OmpIcon/ agent catalog / dynamic grouping(OMP was already a first-class agent elsewhere); adds
overflow-x-hiddenso along worktree chip can't widen the sidebar.
Also generalizes
normalizePiSessionsDir→normalizeAgentSessionsDir(dir, home).Fixes found while taking over (not in #7255)
These would have shipped broken had #7255 merged onto current
main:mainhad added incremental parsing(
createMessageGraphSessionResumeState, etc.) typed'openclaw' | 'pi'; onlyone signature was widened. Fixed via a
MessageGraphAgentalias + routing OMPthrough the incremental cache.
normalizePiSessionsDirrename brokeremote-session-scanner-sources.ts(not in the PR's file set). Fixed + addedOMP remote discovery parity with Pi.
resume command for local sessions and never forwarded
filePath, so localOMP resumed by id instead of path. Now threads
resumeFilePaththroughbuildAiVaultResumeStartupForWorktree. (Caught by adversarial review.)Test coverage strengthened: the moved
buildAiVaultResumeCommandsuite now livesnext to the function (
src/shared/ai-vault-resume-command.test.ts), anincremental-parity fixture exercises the
ompbranch, and dedicated tests provemodel_change.modelcapture, explicit-total token capture, and local resume-by-path.Verification
pnpm typecheck,pnpm build:electron-vite, targetedvitest(ai-vault +shared + renderer resume) — all green (113 tests).
~/.omptranscripts —correct titles, cwd, model (
gpt-5.4-mini), token totals, andomp --resume '<absolute path>'commands.aiVault.listSessionsIPC returned all 10 OMP sessions in therunning build; the panel rendered an OMP row with the OMP icon + label + msg
count under its worktree group (screenshot in a comment).
Closes #7255.
Made with Orca 🐋