Repository navigation
fix(agents): refresh remote detection on new launch surfaces - #21659
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthrough
Priority: ➖ Normal Severity of issue fixed: Medium 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
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.
ℹ️ No critical issues — the fix is well-scoped and the new tests genuinely exercise it. One stale test title and an FYI on probe cadence below.
Reviewed changes
- Non-empty remote cache now refreshes — when a newly observed SSH or runtime target already has a non-empty cached list,
useDetectedAgentsnow callsrefreshRemoteDetectedAgents/refreshRuntimeDetectedAgentsinstead of doing nothing. This is the actual bug from #20383: the previous gate only retried on an empty result, so an agent installed after the first probe stayed invisible. - Empty-result retry preserved — empty caches still route through
ensureRemoteDetectedAgents/ensureRuntimeDetectedAgents, keeping the once-per-mounted-surface retry and the no-spin guarantee. - Refresh reuses existing host-owned RPCs — SSH refresh wraps
ensureRemoteDetectedAgents(force:true); runtime refresh usespreflight.refreshAgentswith themethod_not_foundfallback topreflight.detectAgents. A failed refresh preserves the cached list, which is the right behavior for the automatic path. - Tests — added SSH and runtime cases that assert exactly one refresh per mount; reworked the runtime "explicit refresh finds no agents" case.
I verified the new tests can fail: restoring the pre-PR detectedIds.length === 0 gate makes all three new/changed cases red, while the head state is green (34 tests across the hook and store slice).
ℹ️ Nitpicks
- Stale test name —
does not re-probe after an explicit refresh finds no agents(src/renderer/src/hooks/useDetectedAgents.test.tsx:352) no longer callsrefresh(); it now asserts the automatic refresh path. Rename it to match. While you're there, consider keeping one explicit-refresh()assertion so the "cache becomes empty on the same mounted surface, do not fall through todetect" case stays covered at the hook level — the reopened-surface test only covers the new-mount path. - Probe cadence FYI —
QuickLaunchAgentMenuItemsis rendered inside the dropdown content, so every open of a remote worktree's+menu remounts the hook and now fires one host probe (concurrent in-flight calls still dedupe, and a failure keeps the cached list). This is the intended once-per-surface trade-off and matches the pre-existing empty-host behavior, but a short per-target cooldown would bound SSH/runtime round-trips if rapid open/close becomes hot.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
Upstream stablyai#21274 split auto-ack into per-surface adapters (terminal and structured chat). The grid target now carries surfaceKind: 'terminal', the parked-card BEL check (group-level unread) moves into acknowledgeViewedAutoAckTarget, and the sessions view branch no longer sits behind the terminal-view early return. stablyai#21659 chains .finally on ensureRemoteDetectedAgents; the launch picker test stubs it with a resolved promise like upstream's own tests.

ELI5
Orca remembered the agents it saw on a remote host and treated that list as permanent. If you installed a new CLI afterward, opening another launch surface still showed the old list until restarting Orca.
When a new remote launch surface first sees a host, Orca now asks that host for one fresh agent list. Empty lists keep their existing retry behavior, and a mounted surface does not poll repeatedly.
Fixes #20383.
What changed
orca serveruntime agent lists through the owning runtime.Verification
pnpm test src/renderer/src/hooks/useDetectedAgents.test.tsx src/renderer/src/store/slices/detected-agents.test.ts— 34 tests passed.pnpm tc:web— passed.pnpm run check:code-quality:changed— 0 findings across 2 changed files.Visual proof is not included because this is a cache and host-probe behavior fix; the regression tests exercise the SSH and runtime launch-surface paths directly.
Merge risk
Low. The change is limited to remote agent discovery refresh policy, uses existing host-owned refresh RPCs, and leaves local detection unchanged. No persisted state, wire format, or agent launch behavior changes.