Skip to content

feat(ai-vault): add OMP sessions to the AI Vault session browser - #7618

Merged
nwparker merged 2 commits into
mainfrom
nwparker/omp-vault
Jul 7, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/omp-vault

Conversation

@nwparker

@nwparker nwparker commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds OMP ("Oh My Pi", a Pi fork) to the AI Vault / Agents session catalog so
historical .omp/agent/sessions/**/*.jsonl transcripts 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 against
current main
, which had since refactored the scanner. Rebuilt on current
main and hardened via an adversarial multi-lens review.

What it does

  • Discovery mirrors Pi exactly (OMP_CODING_AGENT_DIR env, WSL home roots,
    per-agent scan limit, .jsonl) in the local scanner and the remote/SSH
    scanner.
  • Parsing goes through the shared message-graph parser via a new
    MessageGraphAgent type. Captures the model from model_change.model (OMP's
    key — Pi uses modelId) or the assistant message, and tokens from usage.
  • Incremental parse cache: OMP joins the openclaw/pi branch so ~5s rescans
    resume from the last byte instead of re-reading whole transcripts (STA-1278/1417).
  • Resume by absolute transcript path (omp --resume <path>) — it resolves
    regardless of which session-dir root the file was discovered under (custom
    OMP_CODING_AGENT_DIR / WSL store), where an id-prefix lookup against the
    default store would miss. Threaded through both the scanner and the
    renderer's local resume/copy rebuild.
  • Renderer reuses the existing OmpIcon / agent catalog / dynamic grouping
    (OMP was already a first-class agent elsewhere); adds overflow-x-hidden so a
    long 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:

  1. Type-widening / incremental gaps — main had added incremental parsing
    (createMessageGraphSessionResumeState, etc.) typed 'openclaw' | 'pi'; only
    one signature was widened. Fixed via a MessageGraphAgent alias + routing OMP
    through the incremental cache.
  2. Remote/SSH scanner build break — the normalizePiSessionsDir rename broke
    remote-session-scanner-sources.ts (not in the PR's file set). Fixed + added
    OMP remote discovery parity with Pi.
  3. Local resume bypassed the feature (major) — the renderer rebuilds the
    resume command for local sessions and never forwarded filePath, so local
    OMP resumed by id instead of path. Now threads resumeFilePath through
    buildAiVaultResumeStartupForWorktree. (Caught by adversarial review.)

Test coverage strengthened: the moved buildAiVaultResumeCommand suite now lives
next to the function (src/shared/ai-vault-resume-command.test.ts), an
incremental-parity fixture exercises the omp branch, and dedicated tests prove
model_change.model capture, explicit-total token capture, and local resume-by-path.

Verification

  • pnpm typecheck, pnpm build:electron-vite, targeted vitest (ai-vault +
    shared + renderer resume) — all green (113 tests).
  • Real data: ran the actual scanner against 10 real ~/.omp transcripts —
    correct titles, cwd, model (gpt-5.4-mini), token totals, and
    omp --resume '<absolute path>' commands.
  • In-app: aiVault.listSessions IPC returned all 10 OMP sessions in the
    running 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 🐋

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>
@nwparker

nwparker commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Real-data verification evidence

Ran the actual scanAiVaultSessions against 10 real ~/.omp/agent/sessions
transcripts (all other agents isolated to empty dirs). Sample rows:

title  : Inspect the OMP sidebar status path and explain it in one paragraph.
model  : gpt-5.4-mini | tokens: 1195914 | msgs: 20
resume : cd '/Users/.../https-github.1485827954.workers.dev-stablyai-orca-pull-2662' \
         && omp --resume '/Users/.../.omp/agent/sessions/-orca-.../2026-05-26T04-17-18-908Z_019e6280-....jsonl'

title  : say hi
model  : gpt-5.4-mini | tokens: 28487 | msgs: 2
resume : cd '/Users/.../pierre-trees' \
         && omp --resume '/Users/.../.omp/agent/sessions/-orca-workspaces-orca-pierre-trees/2026-05-26T04-58-46-297Z_019e62a6-....jsonl'

In the running build, window.api.aiVault.listSessions returned all 10 OMP
sessions with correct titles/model/tokens/resume commands, and the right-sidebar
panel rendered an OMP row (OMP icon + "OMP" label + msg count) under its worktree
group. omp --resume <path> was confirmed against the real omp v15.3.2 CLI
(--resume accepts by ID prefix, path, or picker; a stray --export probe was
cleaned up).

@AmethystLiang AmethystLiang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@coderabbitai

coderabbitai Bot commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: df9fbee0-acb1-446a-a586-b7b58dce3025

📥 Commits

Reviewing files that changed from the base of the PR and between 15c072b and 03d7468.

📒 Files selected for processing (1)
  • src/main/ai-vault/session-scanner-parse-cache.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/ai-vault/session-scanner-parse-cache.ts

📝 Walkthrough

Walkthrough

Changes

This PR adds support for the omp agent across AI Vault types, resume-command construction, session discovery and parsing, incremental fixtures, and test coverage. It also generalizes session-directory normalization for .pi and .omp, updates cache/resume handling to treat OMP like message-graph agents, and adds a sidebar overflow style adjustment.

Sequence Diagram(s)

Not applicable.

Compact metadata

  • Files changed: 20
  • Estimated review effort: Medium

Related issues: None provided
Related PRs: None provided

Suggested labels: ai-vault, enhancement, omp-agent

Suggested reviewers: None specified

Poem
A rabbit hops through session logs anew,
omp joins the paths the scanners knew,
File paths now guide the resume cue,
and tests confirm the routes ring true.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: adding OMP sessions to the AI Vault session browser.
Description check ✅ Passed The description covers the summary, implementation details, verification, and follow-up notes, but it omits some template sections like Screenshots and Security Audit.
Linked Issues check ✅ Passed The PR implements OMP discovery, parsing, incremental caching, absolute-path resume commands, and the sidebar layout fix required by #7255.
Out of Scope Changes check ✅ Passed The changes stay focused on OMP session support and related tests/UI updates; no unrelated code paths appear introduced.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/main/ai-vault/session-scanner-opencode-sqlite-coexistence.test.ts (1)

21-42: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicate isolatedScanRoots drifting from the shared fixture.

This file defines its own local isolatedScanRoots that duplicates session-scanner-test-fixtures.ts's exported version. This PR had to add ompSessionsDir in both places, and the two copies have already drifted: here it's appended after kimiSessionsDir (Line 40), while the shared fixture inserts it right after piSessionsDir. Importing the shared isolatedScanRoots instead 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

📥 Commits

Reviewing files that changed from the base of the PR and between 9a3bf12 and 15c072b.

📒 Files selected for processing (19)
  • src/main/ai-vault/remote-session-scanner-sources.ts
  • src/main/ai-vault/session-scanner-accumulator.ts
  • src/main/ai-vault/session-scanner-agent-parser.ts
  • src/main/ai-vault/session-scanner-codex-workers.test.ts
  • src/main/ai-vault/session-scanner-graph-parsers.ts
  • src/main/ai-vault/session-scanner-incremental-fixtures.ts
  • src/main/ai-vault/session-scanner-opencode-sqlite-coexistence.test.ts
  • src/main/ai-vault/session-scanner-parse-cache.ts
  • src/main/ai-vault/session-scanner-source-discovery.ts
  • src/main/ai-vault/session-scanner-test-fixtures.ts
  • src/main/ai-vault/session-scanner-types.ts
  • src/main/ai-vault/session-scanner-values.test.ts
  • src/main/ai-vault/session-scanner-values.ts
  • src/main/ai-vault/session-scanner.test.ts
  • src/renderer/src/components/right-sidebar/AiVaultSessionVirtualList.tsx
  • src/renderer/src/lib/ai-vault-resume-command.test.ts
  • src/renderer/src/lib/ai-vault-resume-command.ts
  • src/shared/ai-vault-resume-command.test.ts
  • src/shared/ai-vault-types.ts

@nwparker
nwparker merged commit f615002 into main Jul 7, 2026
1 check passed
@nwparker
nwparker deleted the nwparker/omp-vault branch July 7, 2026 01:03
brennanb2025 added a commit that referenced this pull request Jul 10, 2026
…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>
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants