Repository navigation
fix(terminal): phone wake reaches hibernated agent panes in place - #27450
Conversation
The pane listener subscribed to 'orca:wake-hibernated-agents-worktree' while the
dispatcher fires WAKE_HIBERNATED_AGENTS_WORKTREE_EVENT ('orca-wake-...'), so the
in-place wake never ran. Extract the listener and bind it to the shared constant;
the dispatcher test now drives the real listener instead of a stand-in.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to This change fixes the event-name mismatch so hibernated agents wake in their existing panes. No actionable merge risk was found. Pre-merge checks |
|
ELI5
When you open a worktree on your phone, Orca is supposed to wake any sleeping agents in it right where they were. The part that sends the "wake up" signal and the part that listens for it were using two slightly different names for the signal, so the listener never heard it.
What Changed
Before: opening a worktree from the phone did not wake its already-mounted, hibernated agent panes in place. The wake code still ran its fallback path, which resumes sessions into fresh tabs, so an agent could come back in a new tab instead of in the pane it was sleeping in.
After: the mounted panes receive the wake signal, wake in place, and report which sessions they took, so the fallback doesn't resume those a second time.
Mechanism: the sender fires
WAKE_HIBERNATED_AGENTS_WORKTREE_EVENT(orca-wake-hibernated-agents-worktree). The pane listener subscribed to a hand-typedorca:wake-hibernated-agents-worktree(colon instead of a dash). That literal came from an earlier refactor that split a large file and replaced the shared constant with a mistyped string. This PR moves the listener into a smallhibernated-agent-wake-listener.tsthat imports the same constant the sender uses, and removes two type casts along the way.Why
Using one shared constant means the sender and listener can't drift apart again. The dispatcher test used to register its own stand-in listener with the correct name, which is why it missed the bug. It now registers the real pane listener, so a mismatch fails the test. I confirmed the test fails before the fix and passes after it.
I also scanned the renderer for other custom events where a hand-typed listener or sender name has no matching counterpart. This was the only one. The other unmatched names are built-in webview events.
Linked Issue
N/A (maintainer fix)
Visual Proof
N/A. This is a signal-name fix with no visual change, and the dispatcher-to-listener test covers it.
Testing
wake-sleeping-agents-in-background.test.tsnow drives the real pane listener. It checks that the targeted worktree's pane wakes, that another worktree's pane does not, and that the woken session is skipped by the fallback resume. I also ranpnpm tc,oxlint,pnpm run check:code-quality:changedandpnpm lint.Review
Agent skill upstream boundary
Notes
This is renderer-only and the event never leaves the window. SSH, mobile and other platforms are unaffected except that the phone wake now works as intended.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)