Skip to content

fix(ai-vault): give Orca servers reached over SSH the 15 s all-hosts scan budget - #31226

Merged
nwparker merged 1 commit into
mainfrom
nwparker/ai-vault-ssh-server-scan-budget
Oct 20, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/ai-vault-ssh-server-scan-budget

Conversation

@nwparker

@nwparker nwparker commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​27 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​25
Prod 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​24 $\color{#cf222e}{\Huge{\mathbf{−}}}$​14 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​10

ELI5

In Agent Session History, All hosts asks every connected computer for its sessions and waits a fixed time for each. Computers Orca reaches over SSH only got 3 seconds, which is often not enough to read a large history over a tunnel, so they came back empty. They now get 15 seconds, the same budget the old SSH path had.

What Changed

  • Before: with All hosts selected, an SSH host (or any Orca server reached through an SSH tunnel) with a big history often showed no sessions at all, even though selecting that host on its own listed them fine.
  • After: those hosts get a 15 s scan budget in All hosts. Servers reached directly over the LAN or Tailscale keep 3 s, so one slow direct server still can't hold the merged list open.

Mechanism: the all-hosts fan-out (src/main/ipc/ai-vault.ts) gave every Orca server runtimeScan = 3 s. Since #27214 removed the SSH relay client, every SSH host is served by a managed Orca server through an SSH tunnel, so the 15 s sshScanRelay budget in ai-vault-all-host-timeouts.ts was no longer used by anything and SSH hosts silently fell to 3 s. The saved environment record already says how a server is reached: connectionDependency: 'ssh-tunnel' is required by the schema for every server with SSH access or a managed SSH deployment (src/shared/runtime-environments.ts). getSavedRuntimeAiVaultHostInfos now copies that field onto the host info, and allHostsRuntimeScanTimeoutMs picks 15 s for tunnelled servers and 3 s otherwise. I also folded a duplicate RuntimeAiVaultHostInfo type into one and dropped the two dead SSH constants.

Why

The environment's own connectionDependency is the record the rest of the app uses to decide "this server needs an SSH tunnel" (the settings row, the status owner, the managed-tunnel checks), so the budget follows the same source of truth rather than guessing from endpoints or ports. Alternatives considered: raising the budget for every server (makes one dead LAN server stall All hosts for 15 s) and returning partial results on timeout (a bigger protocol change; worth doing separately).

Linked Issue

Part of #31139 (item 5, "All hosts with an Orca server reached over SSH"). Reported, with this approach, by @quzard. The issue stays open for the remaining items.

Visual Proof

N/A: no UI change; the same list now fills in for SSH hosts instead of timing out.

Testing

  • src/main/ipc/ai-vault.test.ts: All hosts with one direct and one tunnelled server passes 3 s and 15 s respectively (fails on main: both get 3 s).

  • src/main/ai-vault/runtime-session-scanner.test.ts: the saved environment's connectionDependency reaches the host info (fails on main).

  • Full static-analysis job run locally on this head (all steps, including ratchets, anti-slop and localization), plus the orcad terminal smoke.

  • Verified only in tests; not exercised against a live SSH host.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

AI Disclosure

Review

Codex review (gpt-6.1-sol, high): clean. Independent Opus review: no P0-P2 findings.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platoform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

No wire change: the field is read from the desktop's own saved environments. WSL deployments carry no dependency value and keep 3 s.

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)

…scan budget (#31139)

All hosts gave every Orca server a 3 s scan, including the managed servers
Orca reaches through an SSH tunnel, which now serve every SSH host. A healthy
SSH host walking a large home timed out and showed up empty. The saved
environment's connectionDependency now picks the 15 s budget for tunnelled
servers; direct LAN/Tailscale servers keep 3 s.

Reported, with the proposed approach, by @quzard in #31139.
@coderabbitai

coderabbitai Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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: 3487d192-8546-4fe6-a027-d827fd92dfd5
📥 Commits

Reviewing files that changed from the base of the PR and between 3be5039 and ae0edf5.

📒 Files selected for processing: 6
  • src/main/ai-vault/runtime-session-scanner.test.ts
  • src/main/ai-vault/runtime-session-scanner.ts
  • src/main/ipc/ai-vault-all-host-timeouts.ts
  • src/main/ipc/ai-vault-runtime-scan.ts
  • src/main/ipc/ai-vault.test.ts
  • src/main/ipc/ai-vault.ts

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

📝 Walkthrough

Runtime host records now include the optional connection dependency when present. The all-host runtime scan path selects a 15-second timeout for SSH-tunneled hosts and a 3-second timeout for direct hosts. Tests verify dependency propagation and timeout selection.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to ae0ed

All-host scans now allow more time for SSH-tunneled servers while retaining the direct-host budget. No merge-blocking issue is established; normal checks remain appropriate.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 6 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: increasing the all-hosts scan budget to 15 seconds for Orca servers reached over SSH.
Description check Passed The description is complete and focused. It explains the problem, user-visible behavior, implementation, rationale, linked issue, testing, lack of live SSH testing, and checklist status. It also corre…
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.
Full details: Description check

Explanation

The description is complete and focused. It explains the problem, user-visible behavior, implementation, rationale, linked issue, testing, lack of live SSH testing, and checklist status. It also correctly marks visual proof as not applicable and explains why manual testing was not performed.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

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.

1 participant