Repository navigation
Conversation
Worker-start dispatches through bracketed paste in the main process; cursor-agent can leave long prompts as "Pasted text +N lines" and swallow the first Enter. Apply the same submitRetryDelayMs path Codex uses in the renderer, but only for agents without the Claude/Codex render gate so hook turn-start reservation stays intact. Co-authored-by: Cursor <[email protected]>
|
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 (4)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe change adds agent-aware prompt timing. Antigravity keeps a 45 ms per-line settlement delay. Configured Enter retries are removed. Terminal prompt writes resolve delays from the active agent and prompt text. Submission results report one submit. Tests cover multiline settlement timing and agent-specific delay resolution. Priority: ⬇️ Low 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description explains the user impact, mechanism, rationale, testing, scope, and platform considerations. However, the required Linked Issue field still contains a placeholder instead of an issue number, and manual and full-suite validation remain incomplete.
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.
Important
The retry path can revoke an already-accepted worker start: the post-Enter permission assertion throws agent_prompt_blocked, which tears the worker down instead of settling it ready. Details inline.
Reviewed changes
- Cursor gets a submit retry —
submitRetryDelayMs: 1200added tocursorinsrc/shared/tui-agent-config.ts. - Main-process writer retries Enter —
writeTerminalAgentPromptsends one blind\rafter the delay for non-omp, non-render-gate agents, and now threads asubmitscount through every receipt. - Tests — two new cases pin that cursor retries once and that agents without the field do not.
ℹ️ The cursor retry has no captured transcript behind it
The change assumes two things about cursor-agent that no artifact in this repo demonstrates: that it swallows the first Enter after a long bracketed paste, and that a stray second Enter 1.2s later is a no-op. docs/reference/agent-pty-transcript-capture.md explicitly calls the existing cursor-agent-*.txt fixtures wording-only and "not evidence for anything else," and AGENTS.md requires a captured transcript before encoding terminal-behavior rules. A stray Enter is only harmless if cursor's composer is genuinely empty and idle — that is exactly what a transcript would settle. If a recording is not practical, please at least state in the PR that the second Enter is blind and unverified, so the next person debugging a duplicated submission has the caveat.
Technical details
# Missing transcript evidence
## Affected sites
- `src/shared/tui-agent-config.ts:229` — the new `submitRetryDelayMs: 1200` encodes the assumption.
- `docs/reference/agent-pty-transcript-capture.md:124` — "The three `cursor-agent-*.txt` fixtures
contain **no escape bytes and no carriage returns** ... not evidence for anything else."
## Required outcome
- Either attach a cursor-agent transcript that shows the first Enter being swallowed and a later
Enter being inert, or record the blind-retry caveat where the config is documented.
## Open questions for the human
- Was `cursor-agent` verified manually (as the unchecked test-plan item suggests)? If so, was the
case where the *first* Enter already landed exercised?ℹ️ Nitpicks
- The retry blocks
onInputAcceptedand verification for a fixed +1200ms on every cursor prompt, including follow-ups to an already-working agent. That is a latency cost paid even when the first Enter landed.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
Antigravity 1.2.x expands long bracketed paste slowly ("↑ N more lines") while
Orca only waited for byte ingest (~500 ms on macOS). Add submitLineSettleMsPerLine
and retry Enter for antigravity; wire agent-aware submit scheduling through the
main-process prompt writer and plain terminal.send suffix path.
Co-authored-by: Cursor <[email protected]>
There was a problem hiding this comment.
Important
pnpm lint is red on this branch: the tests added here push src/main/runtime/agent-prompt-submission-runtime.test.ts to 840 counted lines against the 800-line test budget, so CI's Lint step (pnpm exec oxlint --format github, .github/workflows/pr.yml:135) fails. Split the suite rather than disabling max-lines.
Reviewed changes
- Antigravity gets line-aware submit timing —
submitLineSettleMsPerLine: 45andsubmitRetryDelayMs: 2500on theantigravityconfig, withgetAgentPromptSubmitDelayMsgaining line-settle options and a newresolveAgentPromptSubmitDelayForAgentthat resolves them per agent. - Agent-aware scheduling reaches both writers — the main-process prompt writer resolves the pre-Enter delay from the raw prompt via
options.promptForSchedule, and the plainterminal.sendsuffix path passes the pty's agent through a newRuntimeTerminalWritergetAgentcallback. - Plumbing —
RuntimeAgentPromptWriteOptions.promptForSchedulecarries the raw prompt fromsendTerminalAgentPrompt;RuntimeTerminalWriteris wired togetPtyAgentinorca-runtime-runtime-id.ts. - Tests — an antigravity line-settle runtime test and a per-line unit test.
ℹ️ The antigravity timing has no committed transcript behind it
The PR body cites REPORT.md, slow-input-observation.json, and long-send.json as evidence, but none are in the repo. AGENTS.md and docs/reference/agent-pty-transcript-capture.md require a captured transcript before encoding terminal-behavior rules, and the committed antigravity-*.txt fixtures were recorded against agy 1.1.25, not the 1.2.4 this change targets. Without the recording, 45 ms/line and the 2500 ms retry are unfalsifiable and the "a stray Enter is a no-op" premise stays unverified.
Technical details
# Missing capture for the antigravity timing change
## Affected sites
- `src/shared/tui-agent-config.ts:171-174` — `submitLineSettleMsPerLine: 45` and
`submitRetryDelayMs: 2500` encode the assumption.
- `docs/reference/agent-pty-transcript-capture.md:110-128` — the committed
`antigravity-*.txt` fixtures are `agy` 1.1.25 and only wording-based rules rest on them.
## Required outcome
- Either commit the `agy` 1.2.4 recording showing the collapsed paste expanding and a
later Enter being inert, or state in the PR that both values are blind and unverified.ℹ️ Interactive antigravity pastes get the retry without the line-settle delay
sendBracketedPasteToAgent reads submitRetryDelayMs but not submitLineSettleMsPerLine, so an interactive antigravity draft paste still fires its first Enter on the render-quiet signal and then a blind retry 2.5 s later, regardless of prompt length — while the main-process worker-start path now waits line-settle first. If the interactive path is meant to get the same fix, it needs the line-aware delay too; if not, the asymmetry is worth stating so the retry on a still-expanding paste is not read as intentional.
Technical details
# Renderer antigravity retry is not line-aware
## Affected sites
- `src/renderer/src/lib/agent-paste-draft.ts:205` — reads
`TUI_AGENT_CONFIG[agent]?.submitRetryDelayMs`; never reads `submitLineSettleMsPerLine`.
- `src/main/runtime/orca-runtime-write-terminal-agent-prompt.ts:88-96` — waits
`resolveAgentPromptSubmitDelayForAgent(...)` before the first Enter.
## Required outcome
- Decide whether interactive antigravity pastes should also wait line-settle before their
first Enter, or document that the renderer retry is intentionally timing-blind.ℹ️ Nitpicks
pnpm-lock.yamlgains@pnpm/exeunderpackageManagerDependencies(plus package/snapshot entries) with no matchingpackage.jsonchange and no relation to this fix; please revert it unless it is intentional.src/main/runtime/agent-prompt-submission-runtime.test.ts:7-9is a second import from../../shared/agent-prompt-injection; foldresolveAgentPromptSubmitDelayForAgentinto the existing import on lines 2-6.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
Address PR review: revert accidental pnpm-lock.yaml churn, remove cursor and antigravity submitRetryDelayMs until live-verified, keep submitLineSettleMsPerLine for agy multiline paste, and move the regression test out of the 900+ line runtime submission suite. Co-authored-by: Cursor <[email protected]>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Dropped the cursor submit retry —
submitRetryDelayMs: 1200and the retry-Enter block inwriteTerminalAgentPromptare gone, so a permission prompt during the retry window can no longer revoke an already-accepted worker start. - Dropped the antigravity retry —
submitRetryDelayMs: 2500removed;submitLineSettleMsPerLine: 45is now the only antigravity timing knob. - Split the line-settle test out — the antigravity runtime case moved to
agent-prompt-line-settle.test.ts, bringingagent-prompt-submission-runtime.test.tsback under the 800-line oxlint budget (oxlintpasses at this head). - Reverted the unrelated
pnpm-lock.yamlchurn — the@pnpm/exeentries are gone.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
Independent verification (2026-09-20):
Verdict: approve the deterministic line-settle implementation for the tested prompt-submission path, with the live 101-line TUI result as supporting evidence. Do not claim measured latency improvement or cross-host proof from this run. No merge performed. |
ELI5 / evidence / trade-offs auditELI5: Long messages are sent to agy as one complete request instead of being cut off or split unpredictably. Proof: 58/58 focused tests, typecheck/quality, and a live 101-line exact-sentinel agy probe pass; visual proof is not applicable to transport plumbing. User-facing trade-off: Long prompts still depend on agy's input limits; no latency improvement is claimed. This note scopes the claim to the evidence above; it does not claim untested remote, SSH, WSL, or vendor combinations. |
Windows verification update (2026-09-20)Plain English: agy slowly expands a long pasted message in its input box. Orca now waits roughly 45 ms per logical line before pressing Enter, so a 101-line request gets about 4.5 seconds of line-settle time plus the normal paste delay. It sends one Enter; this final commit deliberately removed the unverified blind retry. On PR head Merge risk is now low for the scheduling change. The trade-off is a longer wait for long prompts; no latency improvement is claimed. |
What is the agy bug? Plain-English root causeagy 1.2.x accepts a bracketed paste quickly, but its TUI does not immediately expand every pasted line into the editable composer. For a long prompt it briefly shows a collapsed state such as Orca used to measure only how long it took to write the bytes into the PTY. When that byte timer ended, Orca pressed Enter while agy was still expanding the composer. The Enter could be consumed before the full prompt was submit-ready, leaving a partial or unsubmitted task. This PR waits 45 ms per logical line before the one Enter. It is a timing workaround around agy's rendering/ingestion behavior, not a change to the prompt contents and not a second retry. The final commit removed the unverified blind retry. The trade-off is that long prompts wait longer before submission; short prompts are affected much less. Evidence: the captured 101-line agy observation showed bytes accepted while the visible composer continued expanding; the Windows PR-head scheduling suite passed 21/21. A live authenticated Windows 101-line generation was not claimed. |
|
reasonable fix. Wish agy wasn't like this but thanks |
Review-bot follow-upThe automated review reported description-template/docstring-coverage warnings, but no actionable code defect. The PR now has the requested ELI5, scope, platform limits, and verification evidence in the discussion. The changed functions are small predicate/scheduling paths covered by focused tests; adding boilerplate docstrings would not change behavior or improve the contract. CI, typecheck, static analysis, and the relevant runtime tests are green. The remaining manual/remote scenarios are explicitly documented as out of scope for this PR. |
…policy case (#21874) #21665 gave antigravity a per-line settle before Enter, so the delay the test computed from bytes alone is 45 ms short of what the runtime waits. Under fake timers that leaves the submit pending until the real 30 s timeout, which is what every PR's node shard 8/8 has been failing on since it landed. The case now derives the expected delay from the agent's policy, so a future per-agent term moves the expectation with it. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb

ELI5
Antigravity CLI가 긴 붙여넣기를 받을 때 화면에 줄이 천천히 펼쳐집니다. Orca는 바이트 전송이 끝나자마자 Enter를 보내서, 입력창이 아직 다 그려지기 전에 제출을 시도할 수 있었습니다. 이 PR은 줄 수에 비례해 Enter를 늦춥니다.
What Changed
Before: 101줄 paste(agy 1.2.4)에서 Orca는 ~500ms 후 Enter를 보냄. TUI는
↑ N more lines접힌 뒤 수 초에 걸쳐 줄을 펼침.input_accepted는 즉시 반환되지만 화면은 계속 늘어남.After:
submitLineSettleMsPerLine: 45로 줄 수만큼 Enter 전 대기 시간을 추가.resolveAgentPromptSubmitDelayForAgent()가 agent prompt 경로와 plainterminal send --enter모두에 적용.Mechanism:
getAgentPromptSubmitDelayMs()에 line-settle 항 추가,promptForSchedule로 main-process writer에 전달.Out of scope (deferred): cursor worker-start Enter retry — live 재현·검증 전 보류 (review 5255806892).
Why
증거(
slow-input-observation.json,long-send.json): 전송은 정상(4685B accepted), 병목은 AGY TUI의 다줄 확장. byte-ingest만으로는 부족.Linked Issue
Fixes # (follow-up issue TBD — coordinator dispatch)
Visual Proof
N/A — PTY submit timing only; no UI chrome change.
Testing
pnpm test src/main/runtime/agent-prompt-line-settle.test.tspnpm test src/shared/agent-prompt-injection.test.tspnpm test src/main/runtime/agent-prompt-submission-runtime.test.tsPlatform: macOS (deterministic tests); manual probe target macOS.
AI Disclosure
Cursor agent assisted implementation; human-reviewed per review 5255806892.
Review
Agent skill upstream boundary
Notes
pnpm-lock.yamlchurn from branch.submitRetryDelayMsfrom main-process path per review.agent-prompt-line-settle.test.ts(keeps 900+ line submission suite from growing).Checklist
pnpm lint/ full CI — partial local unit tests only