Repository navigation
Conversation
📝 WalkthroughWalkthroughThe adapter adds a typed exit-listener payload, centralized payload creation, and snapshot-based listener fan-out. Synthetic exits, daemon exits, data events, background stream events, and write-unavailable events use the shared dispatch helper. Tests cover listener unsubscription during dispatch, payload mutation isolation, and matching synthetic and daemon exit payloads including 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 7ede8368-b499-47b0-af39-44b1470504a0
📒 Files selected for processing (2)
src/main/daemon/daemon-pty-adapter.test.tssrc/main/daemon/daemon-pty-adapter.ts
|
Closing to reduce review load; happy to reopen if this is useful. |
Consolidate snapshot-safe daemon PTY listener delivery and exit payload construction. Reuse listener removal and event types while preserving callback ordering, payload isolation, optional exit fields, and recovery exception handling. Fixes #10984. Adapted from #11119. Co-authored-by: MumuTW <[email protected]>
…ai#20945) Consolidate snapshot-safe daemon PTY listener delivery and exit payload construction. Reuse listener removal and event types while preserving callback ordering, payload isolation, optional exit fields, and recovery exception handling. Fixes stablyai#10984. Adapted from stablyai#11119. Co-authored-by: MumuTW <[email protected]>
Summary
DaemonPtyAdapter.Closes #10984.
Screenshots
No visual change.
Testing
pnpm lintpnpm typecheckpnpm testpnpm buildTargeted validation:
daemon-pty-adapter.test.ts: 138 tests passedoxlintandoxfmt --checkpassedgit diff --checkpassed after rebasing onto currentorigin/mainThe full Node typecheck was attempted but the isolated worktree environment was missing unrelated existing
esbuildmodules referenced by plugin/relay test files.AI Review Report
The adversarial review checked listener mutation, unsubscribe-during-emission behavior, payload parity, and exception semantics. It caught that an initial abstraction shared one mutable payload across listeners where the old loops created one per listener. The implementation now accepts a payload factory, and a regression test proves one listener cannot mutate the next listener's payload.
Cross-platform compatibility was reviewed for macOS, Linux, and Windows. This change does not alter shortcuts, labels, paths, shells, Electron platform branches, or host-specific behavior.
Security Audit
No input parsing, command execution, path handling, authentication, secrets, dependencies, or IPC contracts changed. Listener exceptions still propagate with the same semantics, and fanout still snapshots before callbacks can unsubscribe.
Notes
Current main contains five listener-fanout sites in this adapter; all five now use the common primitive.