Repository navigation
Conversation
…write OMP holds a bracketed paste as a draft until Enter arrives in the same input read: for a paste at paste.largeMenuThreshold lines (default 100) it opens its "Pasted N lines" menu first, and the separate Enter Orca writes after the settle delay then accepts that menu instead of submitting the Task. A worker Task prompt reaches that size because Orca's dispatch preamble alone is ~64 lines, so the Dispatch reports input_accepted while the pane sits on a collapsed paste chip. Write the submit with the paste frame for OMP only and skip the settle delay for it; every other agent keeps the existing delayed Enter, and codex (which misreads a paste carrying its own Enter, stablyai#11343) stays out. Fixes stablyai#21248
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- One-write submit for OMP —
writeTerminalAgentPromptnow writes${pastePayload}${AGENT_PROMPT_SUBMIT}in the existing single PTY write and skips the render-gate/delay wait plus the separate suffix submit when the predicate is on (src/main/runtime/orca-runtime-write-terminal-agent-prompt.ts). - Per-agent predicate — new
agentPromptSubmitJoinsPasteFrame(agent)returnstrueonly foromp, keeping the prior two-write behavior for every other agent (src/shared/agent-prompt-injection.ts:97). - Regression tests — the runtime test pins exactly one PTY write containing the paste frame plus
'\r'for anomplaunchAgent; the shared test pins the predicate's per-agent scope.
I checked the omp-only scope against the upstream TUI forks: the large-paste menu and submitAfterPaste handling live in OMP's fork (@oh-my-pi/pi-tui), while Pi core (@earendil-works/pi-tui) and Prime Agent have only the inline [paste #N +M lines] marker path and no largeMenuThreshold, so leaving pi/prime-agent on the delayed Enter is correct. The getPtyAgent precedence (launchAgent ?? foregroundAgent) also matches the render gate's, so no gated render gate is created for an omp pane. Behavioral changes are confined to omp; the joined path still runs the pre-write permission/gate checks and the request-bound verification, so the receipt semantics are unchanged.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe change adds Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to OMP prompt submission now sends the paste and Enter together without changing the non-OMP submission flow. No actionable merge-blocking risk was identified. 🚥 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: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: f47088db-eb3f-46c2-bf9f-bbb2d91ca6a7
📒 Files selected for processing (4)
src/main/runtime/agent-prompt-submission-runtime.test.tssrc/main/runtime/orca-runtime-write-terminal-agent-prompt.tssrc/shared/agent-prompt-injection.test.tssrc/shared/agent-prompt-injection.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
…it path review feedback (CodeRabbit): the joined OMP path skipped the only renderGate.dispose() call. The render gate is only created for claude/codex panes and the join only applies to omp, so the two are disjoint today and no listener leaks yet; disposing keeps a future agent that needs both paths from registering a terminal-data listener for the life of the runtime.
|
Review feedback addressed in a92d043 (render-gate dispose on the joined path). Verification on this head, in a sparse clone of the PR branch: That runs the real
Behavior is unchanged for every agent other than |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run covers a92d043, the one commit landed since the prior pullfrog review at ecd4630.
- Disposed the render gate on the joined-submit path —
writeTerminalAgentPromptnow callsrenderGate?.dispose()whensubmitJoinsPasteFrameis true (src/main/runtime/orca-runtime-write-terminal-agent-prompt.ts:69). The first commit armed a gate and then skipped the onlyfinallythat unsubscribed it, so an agent that both joined the paste frame and had a render gate would have left itssubscribeToTerminalDatalistener registered for the life of the runtime. - Restructured the wait branch — the new
if (submitJoinsPasteFrame) / else if (renderGate) / elseleaves thewaitand delay behavior on the non-joined paths unchanged, and the joined path still skips both.
The fix is correctly scoped: createAgentPromptRenderGate is non-null only for claude/codex (the excluded set) and the join is omp-only, so this is defense against a future agent landing in both sets rather than an active leak today. dispose() clears the gate's timers and calls the subscription's unsubscribe, and it is reached at most once per call (the catch path throws before this branch). This addresses CodeRabbit's single actionable comment on the prior revision.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
Secondary review: superseded by #21573This PR correctly identifies the OMP large-paste submission symptom, but its joined-write baseline is sampled after prompt bytes are written. A fast OMP transition can therefore be missed, and one PTY write does not prove one child read on SSH/ConPTY. The lower-risk replacement is #21573: it joins Enter to the bracketed-paste frame only for OMP and captures the activity baseline before the write. The existing focused tests and OMP source/runtime evidence are included there. |
|
Superseded by merged PR #21573, which implements and verifies the same OMP large-paste prompt-submit fix. Closing this stale duplicate so the merged fix is the review target. |
|
Superseded by merged PR #21573. |

ELI5
When Orca starts an OMP worker it types the task into the agent's input box, waits half a second, then presses Enter. OMP shows a "what do you want to do with this big paste?" menu before the text ever reaches the box, so Orca's Enter presses that menu's first option instead of sending the task. The worker looks started but sits there holding the task in a little attachment chip. This PR presses Enter together with the paste for OMP, so the menu never appears.
What Changed
Before:
worker-starton an OMP pane reportsinput_accepted, but the pane shows the whole Task prompt collapsed in the composer (📄 #1 … +144 lines) and no turn starts. The Dispatch staysready / dispatched; a human has to press Enter once in the pane to get anything moving. Reproduced on 1.4.199 with OMP 18.1.19 (evidence in #21248).After: the same dispatch starts the turn with no operator input. The paste frame and the Enter leave the runtime in one PTY write, and the settle delay is skipped for OMP only.
Mechanism:
writeTerminalAgentPromptwrotepastePayload, waitedgetAgentPromptSubmitDelayMs(...), then wrote'\r'as a second write. OMP only flags a paste assubmitAfterPastewhen the Enter arrives in the same input read as the paste terminator (ESC[201~); otherwise a paste atpaste.largeMenuThresholdlines (default 100 — a Task prompt clears that with Orca's ~64-line dispatch preamble) opens OMP'sPasted N linesmenu, which the later Enter then accepts.agentPromptSubmitJoinsPasteFrame(agent)now selects that path foromp, the payload write carries the submit byte, and the delay/submit tail is skipped for it. Every other agent keeps the exact previous behavior.Why
Joining is the only signal OMP reads for "paste and submit"; a longer settle delay cannot help, because the Enter is not late — it is outside the paste frame. The alternatives were worse:
paste.largeMenuThreshold: 0) — that mutates agent behavior Orca does not own and only patches this one menu.Linked Issue
Fixes #21248
Visual Proof
N/A — no UI surface changes; the change is which bytes reach the pane. Before/after terminal frames (composer chip vs started turn) are captured in #21248.
Testing
New
agent prompt submission runtime > writes Enter inside the paste frame for an OMP worker: drives the realsendTerminalAgentPromptwith anomplaunch agent and asserts exactly one PTY write containing the paste frame plus'\r'(previously two writes: paste, then Enter after the delay).New
joins Enter to the paste frame for OMP onlyin the shared module suite pins the per-agent scope (omptrue;codex/claude/ absent false).Shared-module behavior re-verified locally against vitest 4.1.11 (predicate + payload composition).
Live before/after on macOS arm64: 144-line spec to an OMP pane stayed on a paste chip before, and 99-line vs 100-line replays confirmed the threshold in [Bug]: OMP worker-start prompt is never submitted — OMP's large-paste menu consumes the injected Enter (1.4.199 / OMP 18.1.19) #21248.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Implemented with an AI coding agent (Oh My Pi, deepseek-v4.1-flash) driving Orca's CLI for the reproduction; the reporter reviewed the diff and owns the linked issue.
Review
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
omppanes; all other agents keep the delayed Enter.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)