Repository navigation
Keep automation sends working during phone terminal control - #34675
Conversation
|
No actionable comments were generated in the recent review.
|
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
7729b7fd-c355-4fe0-b044-3a391d9d7ce2
Files selected for processing: 25-
src/main/ipc/pty/ipc/write-input-user-input.test.tssrc/main/ipc/pty/ipc/write-input.tssrc/main/runtime/mobile-presence-lock.test.tssrc/main/runtime/rpc/methods/terminal/terminal-claude-agent-view-method.tssrc/main/runtime/rpc/methods/terminal/terminal-input-delivery.tssrc/main/runtime/rpc/methods/terminal/terminal-multiplex-input-frame.tssrc/main/runtime/rpc/methods/terminal/terminal-send-method.tssrc/main/runtime/rpc/terminal-agent-prompt-send.test.tssrc/main/runtime/rpc/terminal-agent-prompt-socket.test.tssrc/main/runtime/rpc/terminal-claude-agent-view.test.tssrc/main/runtime/rpc/terminal-multiplex-ack-output-budget.test.tssrc/main/runtime/rpc/terminal-multiplex-ack-overflow-recovery.test.tssrc/main/runtime/rpc/terminal-multiplex-desktop-resize-routing.test.tssrc/main/runtime/rpc/terminal-multiplex-input-sequence-replay.test.tssrc/main/runtime/rpc/terminal-multiplex-input-write-rejection.test.tssrc/main/runtime/rpc/terminal-multiplex-output-pause-and-viewport.test.tssrc/main/runtime/rpc/terminal-output-batching.test.tssrc/main/runtime/rpc/terminal-send.test.tssrc/main/runtime/runtime-terminal-writer.test.tssrc/main/runtime/runtime-terminal-writer.tssrc/main/runtime/terminal-input-admission.tssrc/main/runtime/terminal/input/terminal-agent-prompt.tssrc/main/runtime/terminal/input/terminal-input-dispatch.tssrc/main/runtime/terminal/layout/terminal-view-presence.tssrc/main/runtime/terminal/wait/terminal-wait-permission.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
-
|
The full review loop completed two rounds. When a phone controlled a terminal, script sends could return “0 bytes written” while orchestration messages still typed. This replacement allows both forms of automation and pauses only direct desktop typing. The check runs before new input starts; text and Enter already accepted finish normally. Fixed: one shared input decision, paired CLI recognition using its existing request information, late phone takeover before the first write, and dropped desktop typing that must not replay. Older callers retain their formats and permission checks. No setting or saved state was added. The unused refusal explanation from #33455 is omitted because scripts are now allowed; thanks to @thefrikidude for the original diagnosis. Verified: real paired CLI and orchestration commands, desktop/script/phone/older-caller combinations, late takeover, accepted Enter after disconnect, and dropped typing without replay. At the reviewed source commit, 14 changed test files passed 206 tests. Later test-only corrections passed 13 tests in the IPC suite and 23 tests in the preview suite, with normal hooks passing. Nine unchanged suites and the retained original fenced-input test carry from the earlier 24-file/303-test run; these are separate candidate runs, not additive totals. CI is green on b1484dc, including static analysis/typecheck, unit tests and packaging. QA classification: Final correctness and independent reference/readiness reviews found no open P0/P1. Intended: phone control, mixed client versions, permission/target checks and accepted prompt completion remain supported. Temporary: separate simultaneous-write ordering is unchanged, tracked in #26676. No implementation fixes remain deferred. For Brennan’s review:
Evidence carry from b37fd90 to the current head:
|
The problem
When your phone controlled a terminal, a script using
orca terminal sendcould be refused with “0 bytes written,” while an orchestration message could still type into the same terminal. These different rules made automation unpredictable.What this PR changes
--environmentor--pairing-code.One shared decision on the machine running the terminal uses where the input came from. The terminal’s agent does not change the rule.
What stays the same
Intended: Your phone keeps control of typing and terminal size; automation does not take that control away. Direct desktop typing remains paused until control changes.
Older phones and clients keep their request formats and existing permitted paths. Permission, stopped-terminal and stale-target checks still apply. Prompt delivery and retry protections remain in place. There is no new setting or saved state.
Temporary: Separate simultaneous writes retain their existing ordering; further work is tracked in #26676.
How it was tested
AI assistance: implementation and review used Codex, with an independent Claude plan review.
Tracked in
Tracked in STA-12083 and STA-12096.
Supersedes #33455. Thanks to @thefrikidude for the original diagnosis and diagnostic fix. The chosen behavior removes the CLI refusal their patch explained, so this replacement starts from main without retaining that diagnostic code.