Skip to content

feat(ai-vault): support Qoder CLI session history and search - #24167

Closed
Soperf wants to merge 6 commits into
stablyai:mainfrom
Soperf:feat/qoder-ai-vault-session-search
Closed

Soperf wants to merge 6 commits into
stablyai:mainfrom
Soperf:feat/qoder-ai-vault-session-search

Conversation

@Soperf

@Soperf Soperf commented Sep 30, 2026 •

Copy link
Copy Markdown

ELI5

Allow users to browse, search, and resume their Qoder CLI conversation sessions from Orca's AI Vault (Agent Session History), across local workspaces and remote SSH hosts.

What Changed

  • Before: Qoder sessions stored in ~/.qoder/projects were invisible in AI Vault. Searching across agent history never included Qoder interactions, and users could not resume them from the history list.
  • After: AI Vault automatically discovers Qoder sessions from ~/.qoder/projects (including WSL home directories and remote SSH hosts). Users can full-text search prompts and responses, view conversation previews, and activate cards to launch qodercli --resume <sessionId>. Subagent runs under <session>/subagents are pruned from top-level discovery to avoid duplicate coordinator cards.
  • Mechanism:
    • Registered qoder in AI_VAULT_AGENTS, AI_VAULT_AGENT_LABELS, and AI_VAULT_AGENT_SOURCES (with subagents/ pruning predicate and WSL/qoderProjectsDir override support).
    • Added remote/SSH session source in remoteSessionSources and implemented parseQoderSessionContent for streaming remote transcripts.
    • Built a streaming append-only JSONL session parser (session-scanner-qoder-parser.ts) that extracts the session start cwd from workspace-directories, sets the first user message as the session title, and pushes clean user/assistant text into the full-text search sink while dropping thinking blocks and tool_result output.
    • Added incremental resume state (createQoderSessionResumeState) hooked into the session parse cache.
    • Mapped qoder in ai-vault-resume-command.ts to output qodercli --resume <sessionId>.
    • Wired Qoder into all-agent scan and capture test fixtures.

Why

Orca recently added support for running the Qoder CLI (#23581). Integrating Qoder sessions into AI Vault completes the native workflow, enabling history retrieval and one-click session resumption consistent with other supported CLI agents (such as Claude, Codex, CodeBuddy).

Linked Issue

Follow-up to #23581 (Qoder CLI integration). Refs #12279 #7480

Visual Proof

N/A (AI Vault session listing and search card presentation follow existing agent card styles).

Testing

  • I manually tested these changes locally
  • Automated tests added/updated:
    • src/main/ai-vault/session-scanner-qoder-source.test.ts (discovery root, extension, subagents filter)
    • src/main/ai-vault/session-scanner-qoder-parser.test.ts (streaming parsing, noise filtering, incremental resumable state)
    • src/main/ai-vault/remote-session-scanner-sources.test.ts (remote discovery across win32, linux, darwin)
    • src/shared/ai-vault-resume-command.test.ts (resume command generation)
    • src/main/ai-vault/session-scanner.test.ts & src/main/ai-vault/session-transcript-every-agent-capture.test.ts (all-agent guard coverage)
  • Quality gates verified: pnpm run check:code-quality:changed, pnpm tc:node, and unit test suite passing.

AI Disclosure

Generated and developed with assistance from Gemini.

Review

All review feedback from Pullfrog and Greptile addressed. Remote/SSH discovery and injectability fixtures added in follow-up commit 3469e87.

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Follows the existing AI Vault session scanning patterns across macOS, Linux, Windows, and remote SSH hosts.
  • Compatible with existing JSONL streaming transcript parser architecture.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@greptile-apps

greptile-apps Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Adds support for scanning Qoder CLI session history.

The PR appears safe to merge; both previously reported discovery gaps are addressed and no new actionable issue was established.

Summary

The PR adds Qoder CLI sessions to AI Vault discovery, parsing, previews, and resume commands. Changes since the previous review add WSL roots and an SSH source with a remote content parser, addressing both earlier findings.

Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Local, WSL, or SSH Qoder projects] --> B[Discover JSONL sessions]
  B --> C[Parse conversation and workspace]
  C --> D[AI Vault list and preview]
  C --> E[Searchable transcript text]
  D --> F[qodercli --resume sessionId]
Loading

Reviews (3) · Last reviewed commit: "feat(ai-vault): support remote SSH qoder..."

@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: f776062d-e87e-498c-a55f-3e9167b87f8e

📥 Commits

Reviewing files that changed from the base of the PR and between 5e740fc and 3469e87.

📒 Files selected for processing (7)
  • src/main/ai-vault/remote-session-scanner-sources.test.ts
  • src/main/ai-vault/remote-session-scanner-sources.ts
  • src/main/ai-vault/session-scanner-log-agent-fixtures.ts
  • src/main/ai-vault/session-scanner-qoder-parser.test.ts
  • src/main/ai-vault/session-scanner-qoder-parser.ts
  • src/main/ai-vault/session-scanner-test-fixtures.ts
  • src/main/ai-vault/session-scanner.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The change adds Qoder to AI Vault agent registration and configures discovery of .jsonl files under ~/.qoder/projects, including WSL roots. Discovery excludes subagents directories and supports a custom projects directory. A new parser reads local and remote transcript lines, extracts session metadata and user or assistant text, and supports resumable parsing. The scanner dispatches Qoder candidates to this parser. Resume commands use qodercli --resume with the session ID.

Priority: ➖ Normal

Merge Risk: 🔵 Low · up to 3469e

Qoder session support looks mergeable. In rare cases, messages containing Unicode line-separator characters may be missing from local previews or search. This is a minor edge case that can be fixed in a follow-up.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 3469e

The integration reuses existing discovery, host-selection, and command-quoting controls. No new privilege escalation or boundary bypass was established. Remaining uncertainty concerns transcript identity consistency and downstream handling of interrupted reads and session activation.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The newly reachable input surface is Qoder transcript content within configured local, WSL, and connected remote project roots. A writer of those transcripts can influence displayed metadata, searchable text, and the resume target. The inspected flow does not derive execution-host identity from transcript content.

Security Findings and Attack Paths

  • inferred — The reviewed attack path is transcript-authored session ID and working directory flowing into a user-initiated resume command. Existing centralized quoting and host attribution are counterevidence to a new command-execution boundary bypass. No introduced security finding was established; downstream CLI and launcher authority remain only partially assessed.

Trust Boundaries and Controls

  • observed — Local discovery passes source-root, extension, and directory predicates into the common discovery routine. Remote discovery remains provider-backed. Local pruning and remote transcript partitioning exclude subagent transcripts from independently resumable top-level candidates.

Resilience and Maintainability Implications

  • observed — The shared message channel isolates consumer exceptions from session listing, drops a throwing consumer without recording a successful cursor, and clears attached readers when a read finishes. These are failure-containment controls, not proof that every downstream index transaction rolls back partial publication.

Hardening Proposals

  • proposed — If Qoder's format guarantees a stable session ID per transcript, enforce that guarantee before search publication and resume generation. Treat mismatched identity as invalid or as an explicit replacement transition rather than silently changing an incremental session's identity. This is a hardening proposal, not a verified privilege-boundary failure.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 17.65% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 17 functions across 15 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly and concisely describes the primary change: adding Qoder CLI session history and search support to AI Vault.
Description check ✅ Passed The description covers the required user impact, implementation, rationale, issue references, visual proof, testing, AI disclosure, compatibility considerations, and checklist items. It is complete an…
  • Fix all pre-merge checks with AI
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 630c3034-51eb-47b7-af16-663b8516da3d

📥 Commits

Reviewing files that changed from the base of the PR and between d74388f and 493a18e.

📒 Files selected for processing (9)
  • src/main/ai-vault/session-scanner-agent-parser.ts
  • src/main/ai-vault/session-scanner-agent-sources.ts
  • src/main/ai-vault/session-scanner-parse-cache.ts
  • src/main/ai-vault/session-scanner-qoder-parser.test.ts
  • src/main/ai-vault/session-scanner-qoder-parser.ts
  • src/main/ai-vault/session-scanner-qoder-source.test.ts
  • src/shared/ai-vault-resume-command.test.ts
  • src/shared/ai-vault-resume-command.ts
  • src/shared/ai-vault-types.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

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

Important

Adding qoder to AI_VAULT_AGENTS breaks two existing all-agent guard tests, because the shared every-agent vault fixture was not extended and qoder.rootDirs is not injectable. Both fail on a clean checkout.

Reviewed changes

  • Agent registration — qoder added to AI_VAULT_AGENTS, AI_VAULT_AGENT_LABELS, and AI_VAULT_AGENT_SOURCES.
  • Discovery source — walks ~/.qoder/projects for .jsonl, pruning subagents/ directories.
  • Streaming parser — new session-scanner-qoder-parser.ts sets the title from the first user text and the start cwd from workspace-directories, publishes user/assistant text into the FTS sink, and drops thinking/tool_result; wired into the agent-dispatch switch and the resumable parse cache.
  • Resume command — qodercli --resume <sessionId>.
  • Tests — qoder parser, qoder source registration, and resume command.

ℹ️ Remote/SSH discovery never lists qoder sessions

remoteSessionSources() is the registry scanRemoteAiVaultSessions consumes, and it has no qoder entry, so ~/.qoder/projects is never walked on an SSH/runtime host. Qoder sessions are therefore absent from Agent Session History for remote workspaces even though local discovery and resume work. This may be intentional scope — kimi and grok are likewise local-only — but it is worth confirming, since there is no all-agent guard for the remote table.

Technical details
# Remote source table omits qoder

## Affected sites
- `src/main/ai-vault/remote-session-scanner-sources.ts:48-156` — `remoteSessionSources()` lists claude, codebuddy, antigravity, gemini, copilot, cursor, cline, hermes, devin, pi, omp, prime-agent, muse, droid, opencode, openclaw; no qoder.
- `src/main/ai-vault/remote-session-scanner-sources.test.ts` — only asserts devin roots, so this gap is silent.

## Required outcome
- Either add a qoder remote source (root `~/.qoder/projects`, `.jsonl`, `subagents/` pruning) with a remote content parser, or state explicitly that remote qoder is out of scope.

## Open questions for the human
- Is remote/SSH qoder discovery intended for this PR, or a follow-up?

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

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

Important

The new commit makes the qoder root injectable, but the two all-agent guard tests still fail: writeEveryAgentVault still has no qoder fixture and isolatedScanRoots still has no qoderProjectsDir key, so no qoder session ever lands in the temp vault.

Reviewed changes

  • Incremental (5e740fc) — qoder.rootDirs now takes (options, wslHomeDirs), honoring a new qoderProjectsDir override and appending WSL home roots via sessionRootDirs; AiVaultScanOptions gains qoderProjectsDir; source test asserts both the WSL and override cases.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

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

✅ No new issues found.

Reviewed changes

The delta since the prior pullfrog review (5e740fc) is 3469e87, which closes both previously-raised threads and adds remote/SSH support for Qoder sessions.

  • Remote/SSH qoder discovery — added a qoder source to remoteSessionSources (root ~/.qoder/projects, .jsonl, subagent pruning via partitionSubagentTranscriptPaths), plus a new remote-source test covering win32/linux/darwin roots.
  • Remote content parsing — extracted the shared line loop parseQoderSessionLines and added parseQoderSessionContent accepting RemoteSessionContent (string or cancellable async line stream), mirroring the other remote .jsonl parsers.
  • All-agent vault fixture wiring — writeLogAgentFixtures now writes a qoder session under roots.qoderProjectsDir, and isolatedScanRoots gained the matching key, so both all-agent guard tests are satisfied.
  • Resume command assertion — the all-agent scan test now asserts qodercli --resume 'qoder-session'.

Both guard tests (session-scanner.test.ts and session-transcript-every-agent-capture.test.ts) pass on this head, as do the new qoder parser/source/resume tests (41 tests across 6 files). pnpm tc:node and pnpm run check:code-quality:changed are clean.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@nwparker

nwparker commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Thanks @Soperf for the original proposal. The credited successor #24614 has now merged into main at f97ca2a49d9c711dab54a656a7f8a47ae6c6749c after all checks passed. The landed scanner/search/resume path includes old-client and old-host compatibility, with the actual Qoder history/resume proof attached to the successor. Closing this predecessor now that the successor is merged.

@nwparker nwparker closed this Oct 3, 2026
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