fix(orchestration): deliver replyable messages to background PTYs - #8057
fix(orchestration): deliver replyable messages to background PTYs#8057bbingz wants to merge 1 commit into
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds routing guidance and tests that select 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: e2227787-aa5e-4d19-a772-5c0fba6f46ae
📒 Files selected for processing (8)
config/scripts/orca-cli-skill-guidance.test.mjsconfig/scripts/orchestration-skill-guidance.test.mjsdocs/reference/2026-07-10-replyable-agent-review-routing-design.mddocs/reference/2026-07-10-replyable-agent-review-routing-implementation-plan.mdskills/orca-cli/SKILL.mdskills/orchestration/SKILL.mdsrc/main/runtime/orca-runtime.test.tssrc/main/runtime/orca-runtime.ts
a324bc9 to
b8c57ce
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: be45841f-0f7f-4035-9f2c-cee72a1c0ff0
📒 Files selected for processing (8)
config/scripts/orca-cli-skill-guidance.test.mjsconfig/scripts/orchestration-skill-guidance.test.mjsdocs/reference/2026-07-10-replyable-agent-review-routing-design.mddocs/reference/2026-07-10-replyable-agent-review-routing-implementation-plan.mdskills/orca-cli/SKILL.mdskills/orchestration/SKILL.mdsrc/main/runtime/orca-runtime.test.tssrc/main/runtime/orca-runtime.ts
✅ Files skipped from review due to trivial changes (3)
- docs/reference/2026-07-10-replyable-agent-review-routing-implementation-plan.md
- docs/reference/2026-07-10-replyable-agent-review-routing-design.md
- skills/orchestration/SKILL.md
🚧 Files skipped from review as they are similar to previous changes (4)
- config/scripts/orca-cli-skill-guidance.test.mjs
- config/scripts/orchestration-skill-guidance.test.mjs
- src/main/runtime/orca-runtime.test.ts
- src/main/runtime/orca-runtime.ts
2147e6b to
3e193a3
Compare
|
Rebased onto latest |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
Rebased onto current |
cdd9892 to
504a83c
Compare
Restack noteRebased onto latest
No intentional behavior change vs pre-restack tip beyond resolving main drift. |
504a83c to
fea5063
Compare
Restack + review guide (community, awaiting maintainer)Rebased onto latest What this PR still uniquely doesMain can deliver replyable orchestration messages to renderer leaf handles when the pane is already idle. It does not push to synthetic background PTY handles ( This PR adds:
Not in scope / already on main
Depends on
Suggested review focus
Tests (local)
We cannot merge; ready for upstream review when convenient. |
fea5063 to
f5b7e87
Compare
Push-on-idle only resolved renderer leaves, so orchestration mail to synthetic background-PTY handles stayed parked until a manual check. Fall through to live connected idle PTYs; keep coordinator/Cursor no-auto-Enter and delivered-vs-read stamping.
f5b7e87 to
d91064a
Compare
Summary
An orchestration message sent to a background agent silently never arrives in the pane — the decision gate stores the row without push-on-idle injection.
Repro (two lines):
createTerminal/ CLI without a renderer leaf) and leave it idle.check.deliverPendingMessagesForHandleonly resolved renderer leaves. Synthetic background-PTY handles (tabIdpty:<id>) never mint a leaf, so push-on-idle parked forever. This minimal re-cut:getLivePtyForHandlewhen the leaf path missesOld branch docs (
docs/reference/2026-07-10-*.md) and the multi-commit stack are dropped; one commit on currentmain.Screenshots
No visual change.
Testing
pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orca-runtime.test.tsfiltered to delivery regressions: 12 passed (3 new background cases + existing already-idle / coordinator / Cursor / no-replay / non-Cursor auto-submit)pnpm lint(not re-run in this re-cut session)pnpm typecheck(not re-run)pnpm test(full suite not re-run)pnpm build(not re-run)AI Review Report
Self-review of the re-cut: compared against main's modern leaf
deliverPendingMessages(flight map, settle, Enter delay) rather than the July dual-path refactor. Verified Enter is a real'\r', leaf-first then background fallthrough, and leaf-owns-same-handle skip so adopted PTYs do not double-inject. Cross-platform: delivery is main-process PTY write only — no shortcuts, paths, or shell differences.Security Audit
No new surface. Continues writing orchestration-formatted payloads into PTYs the runtime already owns; no new IPC, auth, path, or dependency surface. Cursor/coordinator no-auto-Enter paths preserved so injected text is not auto-submitted into user-owned prompts.
Notes
notifyMessageArrivedon its own branch — orthogonal semantics (that guard decides when to push; this PR extends where delivery can resolve to), same function neighborhood. Whichever merges second needs a trivial rebase.origin/maintip (PR fix(orchestration): deliver replyable messages to background PTYs #8057 thread kept).ELI5
Mail to a background agent used to sit in the inbox forever. Now Orca also looks up the background terminal and types the message in when the agent is idle, without double-sending if the pane is already on screen.