Repository navigation
Fix AI Vault scanning for runtime hosts - #7631
Conversation
📝 WalkthroughWalkthroughThis PR adds runtime AI Vault session listing and resume support across the main process, renderer, and web preload layers. It introduces runtime session scanning utilities, extends AI Vault IPC and RPC handling to route runtime execution hosts, wires the core handlers to discover and scan runtime hosts, updates renderer host-scope selection and resume logic for runtime targets, and adds preload API plus localization changes for runtime-host availability messages. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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.
Actionable comments posted: 1
🧹 Nitpick comments (2)
src/main/runtime/rpc/methods/ai-vault.ts (1)
6-11: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueAvoid double-computing
normalizeExecutionHostId.
refineandtransformeach callnormalizeExecutionHostId(value)independently, computing the same result twice per parse.♻️ Compute once
const executionHostIdSchema = z .string() - .refine((value) => normalizeExecutionHostId(value) !== null, { - message: 'Invalid execution host id' - }) - .transform((value) => normalizeExecutionHostId(value) as ExecutionHostId) + .transform((value) => normalizeExecutionHostId(value)) + .refine((value): value is ExecutionHostId => value !== null, { + message: 'Invalid execution host id' + })src/main/ipc/register-core-handlers.ts (1)
211-213: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winUnvalidated cast of remote RPC response.
response.result as AiVaultListResulttrusts the remote Orca server's payload shape without runtime validation. Since the client and paired server can run different app versions, a shape drift could pass malformed session data straight to the renderer.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 5469c5e6-7d8b-4ec1-b5a6-6f09b15535c1
📒 Files selected for processing (7)
src/main/ipc/ai-vault.test.tssrc/main/ipc/ai-vault.tssrc/main/ipc/register-core-handlers.test.tssrc/main/ipc/register-core-handlers.tssrc/main/runtime/rpc/methods/ai-vault.test.tssrc/main/runtime/rpc/methods/ai-vault.tssrc/main/runtime/rpc/methods/index.ts
|
Addressed the two CodeRabbit items in 162af99. The runtime RPC host-id schema now normalizes once before refining, and the runtime AI Vault bridge now validates the remote \ payload before passing it through. Invalid runtime responses now degrade into a scan issue instead of trusting a mismatched shape.\n\nVerification run locally:\n- \undefined |
|
Addressed the two CodeRabbit items in 162af99. The runtime RPC host-id schema now normalizes once before refining, and the runtime AI Vault bridge now validates the remote aiVault.listSessions payload before passing it through. Invalid runtime responses now degrade into a scan issue instead of trusting a mismatched shape. Verification run locally:
The repo hook tried to reinstall dependencies during commit and was blocked by DNS/network access in this environment, so I used the already-passing focused verification above for this change. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/main/ipc/register-core-handlers.test.ts (1)
507-524: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winBrittle exact-match on Zod's internal error message text.
Line 520 asserts the literal message
'Invalid input: expected array, received string', which is Zod's own generated error text. This couples the test to Zod's internal wording/format rather than the app's own validation logic — a Zod version bump (e.g., v3→v4 changed default messages from "Expected array, received string" to "Invalid input: expected array, received string") would break this test even though nothing inregister-core-handlers.tschanged.Consider asserting only on the fields your code controls (
executionHostId,agent,path) and using a looser matcher formessage(e.g.,expect.stringContaining('Invalid aiVault.listSessions response')).♻️ Suggested loosened assertion
).resolves.toEqual({ sessions: [], issues: [ - { + expect.objectContaining({ executionHostId: 'runtime:env-123', agent: 'codex', path: 'env-123', - message: 'Invalid aiVault.listSessions response: Invalid input: expected array, received string' - } + message: expect.stringContaining('Invalid aiVault.listSessions response') + }) ], scannedAt: expect.any(String) })
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: e9398b08-12f4-40c2-9b6b-1dcfe78a506b
📒 Files selected for processing (4)
src/main/ipc/register-core-handlers.test.tssrc/main/ipc/register-core-handlers.tssrc/main/runtime/rpc/methods/ai-vault.test.tssrc/main/runtime/rpc/methods/ai-vault.ts
🚧 Files skipped from review as they are similar to previous changes (3)
- src/main/runtime/rpc/methods/ai-vault.test.ts
- src/main/runtime/rpc/methods/ai-vault.ts
- src/main/ipc/register-core-handlers.ts
|
Addressed the follow-up CodeRabbit note in a57619d by loosening the runtime-response assertion so it no longer depends on Zod's exact error wording. The assertion now checks the fields we own plus an Invalid aiVault.listSessions response prefix. I could not rerun the focused Vitest command in this worktree after the earlier Husky reinstall attempt removed the local vitest package from node_modules. git diff --check still passes, and the code change is limited to the assertion shape. |
Co-authored-by: Orca <[email protected]>
Co-authored-by: Orca <[email protected]>
Jinwoo-H
left a comment
There was a problem hiding this comment.
Thanks, this is ready to land. I pushed two follow-up commits to harden the runtime-host scan path and enable runtime-host resume parity.
Validated locally:
- focused AI Vault/runtime tests and typecheck passed before ship
- paired \ e2e: runtime RPC \ returned a seeded Codex session stamped as , and \ created an active runtime terminal from the resume command
- SSH e2e: throwaway Linux Docker target, real Orca SSH relay deploy on linux-arm64, remote git repo at , and AI Vault scan returned the seeded remote Codex session stamped as \
Performance risk checked: runtime scans remain bounded by the requested limit/cache and use one RPC per active runtime host, with the existing all-host timeout.
|
Correction to my approval note above: the inline-code snippets were mangled by my shell quoting. The intended validation evidence is:
The approval stands. |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (4)
src/main/ai-vault/session-list-results.ts (1)
28-48: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd direct unit tests for
mergeAiVaultListResults.This is the core merge/dedupe/sort/limit logic behind the new "All hosts" combined AI Vault scan (dedup by session id, sort by
sessionSortTime, and clamp tolimit), but there's no dedicated test file for it in this PR. Coverage exists indirectly viaipc/ai-vault.test.ts, but a focused unit test here would pin down edge cases (duplicate ids across hosts,limit <= 0, emptyresults) independent of the IPC wiring.src/main/ai-vault/runtime-session-scanner.ts (1)
159-176: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winReuse
aiVaultScanIssueResultinstead of duplicating it.
runtimeScanIssueResultre-implements the same shape asaiVaultScanIssueResultexported fromsession-list-results.ts(empty sessions, one issue with hardcodedagent: 'codex',scannedAttimestamp) — only the field name (pathvsenvironmentId) differs. Reusing the shared helper avoids two places drifting apart if the issue shape changes.♻️ Proposed refactor to reuse the shared helper
+import { aiVaultScanIssueResult } from './session-list-results' + function runtimeScanIssueResult(args: { executionHostId: `runtime:${string}` environmentId: string message: string }): AiVaultListResult { - return { - sessions: [], - issues: [ - { - executionHostId: args.executionHostId, - agent: 'codex', - path: args.environmentId, - message: args.message - } - ], - scannedAt: new Date().toISOString() - } + return aiVaultScanIssueResult({ + executionHostId: args.executionHostId, + path: args.environmentId, + message: args.message + }) }src/main/ai-vault/runtime-session-scanner.test.ts (1)
29-111: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd tests for the RPC-failure and invalid-response branches.
All tests here exercise the successful
response.ok === true+ valid-schema path. There's no test forresponse.ok === false(transport/server failure) or for a malformedresponse.resultfailingaiVaultListResultSchema.safeParse— both of which are the specific fix highlighted in this PR's comments ("Invalid runtime responses now become a scan issue instead of trusting a mismatched shape"). Without a test, a future refactor could silently reintroduce trusting a mismatched shape.🧪 Suggested additional test cases
it('returns an issue result when the runtime call fails', async () => { mocks.callRuntimeEnvironment.mockResolvedValueOnce({ ok: false, error: { message: 'Remote Orca server is unavailable.' } }) const scanResult = await scanRuntimeAiVaultSessions('/user-data', 'env-1', {}) expect(scanResult.sessions).toEqual([]) expect(scanResult.issues).toEqual([ expect.objectContaining({ executionHostId: 'runtime:env-1', message: 'Remote Orca server is unavailable.' }) ]) }) it('returns an issue result when the response fails schema validation', async () => { mocks.callRuntimeEnvironment.mockResolvedValueOnce({ ok: true, result: { sessions: 'not-an-array', issues: [], scannedAt: '2026-07-04T00:00:00.000Z' } }) const scanResult = await scanRuntimeAiVaultSessions('/user-data', 'env-1', {}) expect(scanResult.sessions).toEqual([]) expect(scanResult.issues[0]).toEqual( expect.objectContaining({ executionHostId: 'runtime:env-1' }) ) })src/renderer/src/components/tab-group/AiVaultSessionDropLayer.tsx (1)
202-235: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider extracting the runtime launch result handling into a shared helper.
The
launchResult→tabId === null→runtimeLaunch.then(...)→ toast pattern is duplicated between this file (lines 202-235) andai-vault-session-launch-actions.ts(lines 103-136). A shared helper would ensure consistent error handling (including the missing.catch()) and reduce drift risk.♻️ Example helper extraction
// e.g. in ai-vault-session-launch-actions.ts or a focused module export function handleAiVaultLaunchResult( launchResult: { tabId: string | null; runtimeLaunch: Promise<boolean> }, options: { agentLabel: string onQueued: () => void } ): void { const showError = (): void => { toast.error( translate( 'auto.lib.launch.agent.in.new.tab.11cce5cc77', 'Could not launch {{value0}} in a new terminal.', { value0: options.agentLabel } ) ) } if (launchResult.tabId === null) { void launchResult.runtimeLaunch .then((created) => { if (!created) { showError() return } options.onQueued() }) .catch(() => { showError() }) return } options.onQueued() }
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 6d090906-939b-4fcf-856f-9d7a5b01d19f
📒 Files selected for processing (28)
src/main/ai-vault/runtime-session-scanner.test.tssrc/main/ai-vault/runtime-session-scanner.tssrc/main/ai-vault/session-list-results.tssrc/main/ipc/ai-vault.test.tssrc/main/ipc/ai-vault.tssrc/main/ipc/register-core-handlers.test.tssrc/main/ipc/register-core-handlers.tssrc/main/runtime/rpc/methods/ai-vault.test.tssrc/main/runtime/rpc/methods/ai-vault.tssrc/renderer/src/components/right-sidebar/AiVaultPanel.tsxsrc/renderer/src/components/right-sidebar/AiVaultPanelControls.tsxsrc/renderer/src/components/right-sidebar/AiVaultPanelHeader.tsxsrc/renderer/src/components/right-sidebar/ai-vault-host-scope.test.tssrc/renderer/src/components/right-sidebar/ai-vault-host-scope.tssrc/renderer/src/components/right-sidebar/ai-vault-session-launch-actions.tssrc/renderer/src/components/right-sidebar/ai-vault-session-resume.test.tssrc/renderer/src/components/tab-group/AiVaultSessionDropLayer.tsxsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/lib/ai-vault-resume-target.test.tssrc/renderer/src/lib/ai-vault-resume-target.tssrc/renderer/src/lib/launch-ai-vault-session.test.tssrc/renderer/src/lib/launch-ai-vault-session.tssrc/renderer/src/web/web-preload-api.test.tssrc/renderer/src/web/web-preload-api.ts
✅ Files skipped from review due to trivial changes (2)
- src/renderer/src/i18n/locales/en.json
- src/renderer/src/i18n/locales/zh.json
🚧 Files skipped from review as they are similar to previous changes (3)
- src/main/runtime/rpc/methods/ai-vault.test.ts
- src/main/runtime/rpc/methods/ai-vault.ts
- src/main/ipc/register-core-handlers.test.ts
| export function getSavedRuntimeAiVaultHostInfos( | ||
| userDataPath: string | ||
| ): readonly RuntimeAiVaultHostInfo[] { | ||
| return listEnvironments(userDataPath).map((environment) => ({ | ||
| environmentId: environment.id, | ||
| executionHostId: toRuntimeExecutionHostId(environment.id) | ||
| })) | ||
| } |
There was a problem hiding this comment.
🚀 Performance & Scalability | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Confirm whether getSavedRuntimeAiVaultHostInfos is filtered to active hosts
# before being wired as getActiveRuntimeAiVaultHostInfos.
rg -n -C4 'getActiveRuntimeAiVaultHostInfos|getSavedRuntimeAiVaultHostInfos' --type=tsRepository: stablyai/orca
Length of output: 151
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n## files\n'
git ls-files | rg '(^|/)(ipc/ai-vault\.ts|register-core-handlers\.ts|runtime-session-scanner\.ts|session-list-results\.ts|.*ai-vault.*|.*runtime.*scanner.*|.*core-handlers.*)$'
printf '\n## symbol search\n'
rg -n -C3 'ai-vault|runtime session|runtimeAiVault|get.*Runtime.*HostInfos|host infos|active.*host' --type=ts .
printf '\n## targeted tree around likely files\n'
for f in $(git ls-files | rg '(^|/)(ipc/ai-vault\.ts|register-core-handlers\.ts|runtime-session-scanner\.ts|session-list-results\.ts)$'); do
echo "\n### $f"
wc -l "$f"
ast-grep outline "$f" --view expanded || true
doneRepository: stablyai/orca
Length of output: 50370
🏁 Script executed:
#!/bin/bash
set -euo pipefail
for f in src/main/ai-vault/runtime-session-scanner.ts src/main/ipc/ai-vault.ts src/main/register-core-handlers.ts src/main/session-list-results.ts; do
if [ -f "$f" ]; then
echo "### $f"
wc -l "$f"
cat -n "$f" | sed -n '1,260p'
echo
fi
doneRepository: stablyai/orca
Length of output: 16022
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n## assignments and registrations\n'
rg -n -C4 'handlerOptions\s*=|getActiveRuntimeAiVaultHostInfos|scanRuntimeAiVaultSessions|registerCoreHandlers|register-core-handlers|ai-vault' src/main
printf '\n## likely core handler file(s)\n'
for f in $(git ls-files | rg '(^|/)register-core-handlers\.ts$|(^|/)ipc/ai-vault\.ts$|(^|/)main\.ts$|(^|/)index\.ts$'); do
echo "\n### $f"
wc -l "$f"
ast-grep outline "$f" --view expanded || true
doneRepository: stablyai/orca
Length of output: 50369
Filter runtime hosts before exposing All hosts register-core-handlers.ts wires getActiveRuntimeAiVaultHostInfos to getSavedRuntimeAiVaultHostInfos(...), so All hosts scans every saved runtime environment, including disconnected ones. Narrow this to currently reachable hosts, or each offline environment will consume the 3s timeout on every scan.
| if (launchResult.tabId === null) { | ||
| void launchResult.runtimeLaunch.then((created) => { | ||
| if (!created) { | ||
| toast.error( | ||
| translate( | ||
| 'auto.lib.launch.agent.in.new.tab.11cce5cc77', | ||
| 'Could not launch {{value0}} in a new terminal.', | ||
| { value0: payload.agent } | ||
| ) | ||
| ) | ||
| return | ||
| } | ||
| showQueuedToast() | ||
| }) |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Inspect the target file and the related launch-actions file for comparable promise handling.
git ls-files 'src/renderer/src/components/tab-group/AiVaultSessionDropLayer.tsx' \
'src/renderer/src/components/tab-group/ai-vault-session-launch-actions.ts' \
'src/renderer/src/components/tab-group/*launch*' \
'src/renderer/src/components/tab-group/*AiVault*' \
| sed 's#^`#FILE` #'
echo
echo '--- outline: AiVaultSessionDropLayer.tsx ---'
ast-grep outline src/renderer/src/components/tab-group/AiVaultSessionDropLayer.tsx --view expanded || true
echo
echo '--- outline: ai-vault-session-launch-actions.ts ---'
ast-grep outline src/renderer/src/components/tab-group/ai-vault-session-launch-actions.ts --view expanded || true
echo
echo '--- search for runtimeLaunch.then usage ---'
rg -n "runtimeLaunch\\.then|runtimeLaunch" src/renderer/src/components/tab-group -SRepository: stablyai/orca
Length of output: 993
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Read the relevant slice of the target file with line numbers.
FILE='src/renderer/src/components/tab-group/AiVaultSessionDropLayer.tsx'
wc -l "$FILE"
echo
sed -n '180,270p' "$FILE" | cat -n
echo
echo '--- related file slice ---'
FILE2='src/renderer/src/components/tab-group/ai-vault-session-launch-actions.ts'
wc -l "$FILE2"
echo
sed -n '1,260p' "$FILE2" | cat -nRepository: stablyai/orca
Length of output: 3838
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Find the definition of runtimeLaunch and inspect its error handling contract.
rg -n "runtimeLaunch\s*[:=]" src/renderer/src src/main src -S || true
echo
echo '--- broader usages ---'
rg -n "\.runtimeLaunch\b" src -S || trueRepository: stablyai/orca
Length of output: 1030
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Inspect the runtimeLaunch contract and the other caller with the same pattern.
FILE='src/renderer/src/lib/launch-ai-vault-session.ts'
wc -l "$FILE"
echo
sed -n '1,220p' "$FILE" | cat -n
echo
echo '--- right-sidebar caller ---'
FILE2='src/renderer/src/components/right-sidebar/ai-vault-session-launch-actions.ts'
wc -l "$FILE2"
echo
sed -n '80,170p' "$FILE2" | cat -nRepository: stablyai/orca
Length of output: 7750
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Find any existing catch/await handling around runtimeLaunch in the renderer.
rg -n "runtimeLaunch.*catch|catch\\(.*runtimeLaunch|await .*runtimeLaunch|then\\(\\(created\\).*catch" src/renderer/src -SRepository: stablyai/orca
Length of output: 269
Add a rejection handler to runtimeLaunch.
void launchResult.runtimeLaunch.then(...) can reject without surfacing any user feedback here. Add a .catch() and show the same error toast.
| import { getRuntimeEnvironmentIdForWorktree } from '@/lib/worktree-runtime-owner' | ||
| import { | ||
| createWebRuntimeSessionTerminal, | ||
| isWebRuntimeSessionActive | ||
| } from '@/runtime/web-runtime-session' | ||
| import type { AiVaultAgent } from '../../../shared/ai-vault-types' | ||
| import type { SleepingAgentLaunchConfig } from '../../../shared/agent-session-resume' | ||
| import type { TabSplitDirection } from '@/store/slices/tabs' | ||
|
|
||
| export type LaunchAiVaultSessionInNewTabResult = | ||
| | { tabId: string; groupId?: string } | ||
| | { tabId: null; groupId?: string; runtimeLaunch: Promise<boolean> } | ||
|
|
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# 1. Find all callers of launchAiVaultSessionInNewTab and check how they handle the result.
rg -n 'launchAiVaultSessionInNewTab' --type=ts -g '!**/*.test.ts' -C10
# 2. Check if createWebRuntimeSessionTerminal can reject (look for throw/reject in its body).
rg -n 'export.*createWebRuntimeSessionTerminal' --type=ts -A30
# 3. Check if isWebRuntimeSessionActive handles null/undefined input.
rg -n 'export.*isWebRuntimeSessionActive' --type=ts -A15
# 4. Check how callers handle the runtimeLaunch promise (look for .catch, try/catch, or await).
rg -n 'runtimeLaunch' --type=ts -g '!**/*.test.ts' -C5Repository: stablyai/orca
Length of output: 151
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Locate the target file and nearby callers/usages.
git ls-files | rg 'launch-ai-vault-session|ai-vault-session-launch-actions|web-runtime-session|agent-session-resume|ai-vault-types'
# Read the target file with line numbers.
sed -n '1,220p' src/renderer/src/lib/launch-ai-vault-session.ts | cat -n
# Find all references to the launch helper and the runtime launch promise.
rg -n --context 4 'launchAiVaultSessionInNewTab|runtimeLaunch|createWebRuntimeSessionTerminal|isWebRuntimeSessionActive' src/renderer/srcRepository: stablyai/orca
Length of output: 50370
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Show the caller that consumes launchAiVaultSessionInNewTab.
sed -n '180,245p' src/renderer/src/components/tab-group/AiVaultSessionDropLayer.tsx | cat -n
# Inspect the runtime-session helper implementation and its rejection paths.
sed -n '1,260p' src/renderer/src/runtime/web-runtime-session.ts | cat -n
# Inspect the specific createWebRuntimeSessionTerminal test cases for failure/resolve behavior.
sed -n '403,620p' src/renderer/src/runtime/web-runtime-session.test.ts | cat -nRepository: stablyai/orca
Length of output: 21486
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Check whether splitDirection is used anywhere for web-runtime terminal creation.
rg -n --context 3 'splitDirection|targetGroupId' src/renderer/src/lib/launch-ai-vault-session.ts src/renderer/src/components/tab-group/AiVaultSessionDropLayer.tsx src/renderer/src/runtime/web-runtime-session.ts src/renderer/src/components/tab-group/useTabGroupWorkspaceModel.ts src/renderer/src/components/Terminal.tsx
# Find any other callers of launchAiVaultSessionInNewTab.
rg -n --context 3 'launchAiVaultSessionInNewTab\(' src/renderer/srcRepository: stablyai/orca
Length of output: 26021
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Inspect the second caller that consumes the union result.
sed -n '80,170p' src/renderer/src/components/right-sidebar/ai-vault-session-launch-actions.ts | cat -n
# Inspect the launch-helper tests around the runtime branch and split handling.
sed -n '120,190p' src/renderer/src/lib/launch-ai-vault-session.test.ts | cat -n
# Inspect any direct expectations around tabId/runtimeLaunch shape.
sed -n '1,140p' src/renderer/src/lib/launch-ai-vault-session.test.ts | cat -nRepository: stablyai/orca
Length of output: 12320
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Find whether splitDirection is used for runtime-hosted AI Vault launches anywhere else.
rg -n --context 3 'splitDirection' src/renderer/src/lib src/renderer/src/components src/renderer/src/runtime src/shared
# Check if any runtime-session helper or test expects splitDirection for terminal creation.
rg -n --context 3 'createWebRuntimeSessionTerminal\(|session\.tabs\.createTerminal|rightSplit|leftSplit' src/renderer/src/runtime src/renderer/src/lib src/renderer/src/components/tab-groupRepository: stablyai/orca
Length of output: 30912
Preserve splitDirection for runtime-hosted launches
src/renderer/src/lib/launch-ai-vault-session.ts:29-56 — the web-runtime branch returns before the split-group creation, so drops onto a split target ignore the split and open in the existing group. Route the runtime path through the same split logic, or create the split before the early return.
| it('routes session scans through the paired runtime host', async () => { | ||
| const runtimeCalls: { method: string; params: unknown }[] = [] | ||
| const scanResult = { |
There was a problem hiding this comment.
🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win
Duplicate const runtimeCalls declaration — syntax error.
Both new tests declare const runtimeCalls: { method: string; params: unknown }[] = [] twice in the same scope. This is a duplicate-identifier syntax error that would prevent this test file from being parsed at all, failing the whole suite rather than just these two tests.
🐛 Proposed fix
it('routes session scans through the paired runtime host', async () => {
const runtimeCalls: { method: string; params: unknown }[] = []
- const runtimeCalls: { method: string; params: unknown }[] = []
const scanResult = { it('returns unavailable history for explicit non-runtime host scopes', async () => {
const runtimeCalls: { method: string; params: unknown }[] = []
- const runtimeCalls: { method: string; params: unknown }[] = []
vi.doMock('./web-runtime-client', () => ({Also applies to: 654-656
…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 <[email protected]>
* Fix AI Vault runtime host scanning * fix runtime ai vault response validation * test runtime ai vault validation more loosely * fix(ai-vault): harden runtime host scanning Co-authored-by: Orca <[email protected]> * fix(ai-vault): resume runtime host sessions Co-authored-by: Orca <[email protected]> --------- Co-authored-by: Jinwoo-H <[email protected]> Co-authored-by: Orca <[email protected]>
Summary
runtime:*hosts when AI Vault scans "All hosts".Fixes #7589
Test plan
PATH=/Users/dhilipsubramanian/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin:$PATH pnpm test src/main/ipc/ai-vault.test.ts src/main/runtime/rpc/methods/ai-vault.test.ts src/main/ipc/register-core-handlers.test.tsPATH=/Users/dhilipsubramanian/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin:$PATH pnpm run typecheckPATH=/Users/dhilipsubramanian/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin:$PATH pnpm exec oxlint src/main/ipc/ai-vault.ts src/main/ipc/ai-vault.test.ts src/main/ipc/register-core-handlers.ts src/main/ipc/register-core-handlers.test.ts src/main/runtime/rpc/methods/ai-vault.ts src/main/runtime/rpc/methods/ai-vault.test.ts src/main/runtime/rpc/methods/index.tsPATH=/Users/dhilipsubramanian/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin:$PATH pnpm exec oxfmt --check src/main/ipc/ai-vault.ts src/main/ipc/ai-vault.test.ts src/main/ipc/register-core-handlers.ts src/main/ipc/register-core-handlers.test.ts src/main/runtime/rpc/methods/ai-vault.ts src/main/runtime/rpc/methods/ai-vault.test.ts src/main/runtime/rpc/methods/index.tspnpm run build:nativewith normal compiler cache permissionsNot fully clean locally:
pnpm lintcurrently fails outside this change insrc/renderer/src/components/right-sidebar/source-control-manual-review-url.tson an existing switch-exhaustiveness issue.pnpm testis not usable in my sandbox: unrelated daemon/socket/browser integration suites hit local environment failures such as Unix socketEPERMand long timeouts.pnpm buildpassed desktop/web stages, then the native stage initially failed because the sandbox blocked Swift's clang module cache under~/.cache; rerunningpnpm run build:nativewith normal cache permissions passed.Review notes
All hostsalready fans out scans; this adds one scan per saved paired runtime host and keeps the existing AI Vault cache keying.