Repository navigation
Fix status bar render loop in runtime target hook - #18685
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe runtime target hook now selects the execution host ID and memoizes the derived runtime target with Merge Risk: ⚪ Minimal · up to This stabilizes status-bar runtime target rendering while preserving routing behavior, with regression coverage for the previous render-loop failure. No current merge-blocking risk remains. 🚥 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 new issues found.
Reviewed changes
- Status bar render-loop fix —
useWorktreeRuntimeTargetnow subscribes to the primitive execution-host ID and memoizes the derivedRuntimeClientTarget, removing the fresh-object-per-snapshot that drove the infinite re-render. - Render-stability regression oracle — a new
PortsStatusSegment.render-stability.test.tsxmounts the segment under its real error boundary and asserts both the boundary text and theMaximum update depth exceededexception stay absent.
The fix is correct at the seams that matter: ExecutionHostId is a string union ('local' | 'ssh:*' | 'runtime:*'), so the selector is now referentially stable, and the useMemo keeps the derived target stable for the downstream useCallback deps in PortsStatusSegment, PortRow, and WorktreePortRow. I verified the test is a genuine oracle by reverting the production change locally — all three soft assertions fail with the exact Maximum update depth exceeded boundary log — and it passes with the fix restored.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
|
Thank you for catching and fixing the issue |
cherry-picked from upstream stablyai/orca 5412276 (author: Jinwoo Hong)
…tablyai#18625) stablyai#18685 landed the fix (select the host id, derive in useMemo) without a regression guard. This is that guard: it drives 50 unrelated store writes and asserts the consumer re-renders once and the returned target keeps its identity. Confirmed to fail against the pre-stablyai#18685 hook (51 renders).

ELI5
The status bar asked Zustand for a newly created runtime-target object on every store snapshot. React treated each object as a different snapshot, rendered forever, and eventually replaced the status bar with its error boundary. This changes the subscription to the stable execution-host ID and derives the runtime target afterward.
What Changed
useWorktreeRuntimeTarget.RuntimeClientTargetoutside the Zustand selector.Why
The runtime-target hook owns the conversion from worktree host ownership to the RPC target. Fixing it there protects every consumer while preserving local, paired-runtime, direct-SSH, and folder-workspace routing. A call-site workaround or selector cache would leave the unstable ownership boundary in place.
Linked Issue
Visual Proof
Before
After
Testing
Reproduced on untouched
origin/mainwith the visible status-bar boundary andMaximum update depth exceeded.Identical deterministic oracle: good hourly passed; PR fix(ports): route the status-bar popover scan to the workspace's host #17048 merge, bad hourly, and baseline main failed; candidate passed; candidate with the fix disabled failed.
pnpm tc54 relevant test files / 383 tests
Final status-bar render-stability and host-routing suites: 11/11
Post-commit render-stability oracle: 1/1
pnpm run check:code-quality:changedElectron/Playwright CDP on macOS with an isolated profile: correct worktree identity, Ports control visible, boundary text absent, zero renderer console errors.
Linux, Windows, and SSH were assessed structurally; no platform or wire behavior changed. CI will cover the full platform/build matrix.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Fresh performance, architecture/adversarial, and regression reviews were clean. The internal review-until-clean loop completed with no in-scope findings.
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
No persisted state, IPC/RPC payload, polling, retry, or wire contract changed. Direct SSH still resolves to no runtime client target.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)