Skip to content

Add OMP sessions to AI Vault - #7255

Closed
mmarabel wants to merge 4 commits into
stablyai:mainfrom
mmarabel:feat/ai-vault-omp-sessions
Closed

mmarabel wants to merge 4 commits into
stablyai:mainfrom
mmarabel:feat/ai-vault-omp-sessions

Conversation

@mmarabel

@mmarabel mmarabel commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds OMP to the AI Vault/Agents session catalog so historical .omp/agent/sessions/**/*.jsonl transcripts can be discovered from the right-sidebar session browser.
  • Parses OMP JSONL/message-graph records through the same session scanner path used for Pi/OpenCode-style transcripts, including WSL home roots and per-agent scan limits.
  • Generates OMP resume commands with omp --resume <absolute-jsonl-path> because OMP's CLI rejects Orca's internal JSON session ids for these records.
  • Fixes the Agents session row layout so long worktree/repo chips truncate inside the pill instead of widening the whole right sidebar.

Screenshot

image

Verification

Run with Node 24.18.0 via fnm exec and a sanitized test environment that clears live Orca hook vars from WSLENV/SSH_ASKPASS:

  • pnpm lint
  • pnpm typecheck
  • pnpm test
  • pnpm build

Targeted checks also passed:

  • pnpm exec vitest run --config config/vitest.config.ts src/main/ai-vault/session-scanner.test.ts src/main/ai-vault/session-scanner-codex-workers.test.ts src/main/ai-vault/session-scanner-opencode-sqlite-coexistence.test.ts src/shared/ai-vault-resume-command.test.ts
  • pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/right-sidebar/ai-vault-session-display.test.ts src/renderer/src/components/right-sidebar/ai-vault-session-projects.test.ts src/renderer/src/components/right-sidebar/ai-vault-session-worktree.test.ts

AI-agent review summary

  • Cross-platform: OMP discovery follows existing local/WSL root handling; resume quoting goes through the existing platform-aware shell command builder.
  • SSH/remote: historical scanner changes are source-directory driven and do not assume a local-only terminal pane; the right-sidebar layout fix is renderer-only.
  • Git provider compatibility: no GitHub-specific source-control behavior added.
  • Performance: discovery reuses the existing per-agent limit and sorted-source scan path; no broad unbounded traversal beyond the explicit OMP session roots.
  • UI quality: row chips now remain content-sized and shrink-safe, preventing horizontal sidebar overflow on long repo/worktree labels.
  • Security: no secrets or user transcript contents are embedded; the screenshot uses sanitized mock data and was not committed.

@coderabbitai

coderabbitai Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds omp as a supported AI Vault agent across shared agent metadata, resume-command generation, directory normalization, session discovery, parser routing, and scanner tests. It also extends remote session scanning for OMP transcripts and adds OMP-specific renderer resume-command coverage. A small sidebar styling change adds horizontal overflow clipping to the virtualized session list.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding OMP sessions to AI Vault.
Description check ✅ Passed The description covers the required summary, screenshots, testing, AI review, and security sections, with only minor template mismatches.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

Actionable comments posted: 1

🧹 Nitpick comments (2)
src/shared/ai-vault-resume-command.test.ts (1)

43-57: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider covering the omp fallback path.

Only the "resumeFilePath provided" case is tested for omp. A test for resumeFilePath omitted/empty (falling back to sessionId) would close the coverage gap for the resumeTarget branch in buildAiVaultResumeCommand.

src/main/ai-vault/session-scanner-accumulator.ts (1)

73-80: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider a short comment on why resumeFilePath is threaded through.

The reasoning (OMP's CLI resumes via an explicit .jsonl path rather than Orca's internal session ID) isn't evident from this function alone.

📝 Proposed comment
     resumeCommand: buildAiVaultResumeCommand({
       agent: accumulator.agent,
       sessionId,
+      // Why: omp's CLI resumes via an explicit .jsonl path, not Orca's
+      // internal session id; other agents ignore this field.
       resumeFilePath: accumulator.filePath,
       cwd: accumulator.cwd,
       platform,
       codexHome: options.codexHome
     })
As per coding guidelines, "When writing or modifying code driven by a design doc or non-obvious constraint, add a comment explaining why the code behaves the way it does."

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 9503ac87-7a17-4220-bd58-312157e6df6f

📥 Commits

Reviewing files that changed from the base of the PR and between 1403467 and 5086acd.

📒 Files selected for processing (17)
  • 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-opencode-sqlite-coexistence.test.ts
  • src/main/ai-vault/session-scanner-source-discovery.ts
  • src/main/ai-vault/session-scanner-types.ts
  • src/main/ai-vault/session-scanner.test.ts
  • src/renderer/src/components/right-sidebar/AiVaultSessionRow.tsx
  • src/renderer/src/components/right-sidebar/AiVaultSessionVirtualList.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/shared/ai-vault-resume-command.test.ts
  • src/shared/ai-vault-types.ts

@mmarabel

mmarabel commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Fixed CodeRabbit's OMP root normalization note in 3f72448. OMP now uses the shared agent-session root normalizer with '.omp', so OMP_CODING_AGENT_DIR=/path/to/.omp expands to /path/to/.omp/agent/sessions. Added regression coverage in session-scanner-values.test.ts and reran lint, typecheck, and targeted scanner tests.

@mmarabel

mmarabel commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

…p-sessions

# Conflicts:
#	src/main/ai-vault/session-scanner.test.ts
#	src/renderer/src/components/right-sidebar/AiVaultSessionRow.tsx
#	src/renderer/src/i18n/locales/es.json
@nwparker
nwparker requested review from nwparker and removed request for AmethystLiang July 7, 2026 00:02
@nwparker nwparker assigned nwparker and unassigned brennanb2025 Jul 7, 2026

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

Thanks! I reviewed this and added a small follow-up fix before landing.\n\n- Covered local and remote OMP AI Vault scanning.\n- Fixed OMP resume/copy paths to use the transcript file path instead of the internal session id.\n- Fixed queued Windows resume command quoting for the configured shell.\n- Added regression coverage for remote OMP parsing, local resume command generation, and Windows shell variants.\n\nValidated with targeted Vitest, typecheck, changed-file lint, switch exhaustiveness, reliability/localization gates, and Electron UI validation.

@nwparker

nwparker commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Thanks a lot for this, @gatsby74 — great feature and a clean approach. 🙏

I've taken it over in #7618 (you're credited via Co-authored-by). The reason
for a fresh PR rather than pushing here: main had refactored the AI Vault
scanner since this branch's base (incremental parse cache, remote/SSH sources,
message-graph typing), so rebasing needed real changes beyond this diff —
widening the graph-parser typing, routing OMP through the incremental cache,
fixing the normalizePiSessionsDir rename in the SSH scanner (+ OMP remote
parity), and threading the resume-by-path through the renderer's local rebuild
(it was otherwise resuming local OMP sessions by id).

Closing in favor of #7618. Really appreciate the contribution!

@nwparker nwparker closed this Jul 7, 2026

@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/remote-session-scanner-sources.ts (1)

229-233: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Unnecessary indirection through normalizeAgentSessionsDir.

Since agentHomeDirName is always .pi or .omp and the constructed path is always /${agentHomeDirName}/agent/sessions, normalizeAgentSessionsDir will always hit the leaf === 'sessions' branch and return the input unchanged — the round-trip through path normalization/splitting is a no-op. This also fabricates a path using a hardcoded / separator purely to split it back apart, which is easy to misread as touching a real filesystem path.

♻️ Simplify to a direct segment array
-function remoteAgentSessionsSegments(agentHomeDirName: '.pi' | '.omp'): string[] {
-  return normalizeAgentSessionsDir(`/${agentHomeDirName}/agent/sessions`, agentHomeDirName)
-    .split('/')
-    .filter(Boolean)
-}
+function remoteAgentSessionsSegments(agentHomeDirName: '.pi' | '.omp'): string[] {
+  return [agentHomeDirName, 'agent', 'sessions']
+}

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: f0c2b86d-68cc-4f94-899f-cc467fff607a

📥 Commits

Reviewing files that changed from the base of the PR and between caa5cce and c0a9764.

📒 Files selected for processing (9)
  • src/main/ai-vault/remote-session-scanner-sources.ts
  • src/main/ai-vault/remote-session-scanner.test.ts
  • src/main/ai-vault/session-scanner-graph-parsers.ts
  • src/main/ai-vault/session-scanner-scope.test.ts
  • src/main/ai-vault/session-scanner-values.test.ts
  • src/main/ai-vault/session-scanner-values.ts
  • src/renderer/src/lib/ai-vault-resume-command.test.ts
  • src/renderer/src/lib/ai-vault-resume-command.ts
  • src/shared/ai-vault-types.ts
✅ Files skipped from review due to trivial changes (1)
  • src/main/ai-vault/session-scanner-scope.test.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/main/ai-vault/session-scanner-values.test.ts
  • src/main/ai-vault/session-scanner-graph-parsers.ts
  • src/shared/ai-vault-types.ts

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.

4 participants