Skip to content

test(runtime): expect the agent's own submit delay in the PTY timing policy case - #21874

Merged
Jinwoo-H merged 1 commit into
mainfrom
fix-antigravity-prompt-timing-test
Sep 21, 2026
Merged

Jinwoo-H merged 1 commit into
mainfrom
fix-antigravity-prompt-timing-test

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​7 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​4
Prod 0 0 0 0

Summary

Since ea5152f1c2 (#21665, line-settle delay for antigravity multiline paste) src/main/runtime/orca-runtime.test.ts › "submits through the agent-specific PTY timing policy for antigravity" times out at 30 s: the runtime now waits resolveAgentPromptSubmitDelayForAgent (bytes + 45 ms per line for antigravity) while the test advanced fake timers by the byte-only getAgentPromptSubmitDelayMs, so the submit stayed pending for fake time the test never advanced. Reproduced on pristine main e476193bf5; the node shard 8/8 and verify checks are red on every PR whose merge ref includes #21665 (#21859, #21862, #21864, #21871 today).

One-line fix in the test: the expected delay comes from the agent's own policy, so a future per-agent term moves the expectation with it. No product code changes.

Verification

vitest run src/main/runtime/orca-runtime.test.ts -t "PTY timing policy": 35 passed (every agent in the it.each), where the antigravity case timed out before. Changed-code quality gate 0 findings; oxlint 0; oxfmt applied.

…policy case

#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
@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Understand this PR’s impact

Explore downstream dependencies and potential security impact with Blast Radius.

View blast radius →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: ff5ffcd5-a2d1-4cc3-b364-055bb83b0ec3

📥 Commits

Reviewing files that changed from the base of the PR and between e476193 and a25d84a.

📒 Files selected for processing (1)
  • src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

The terminal timing test now uses resolveAgentPromptSubmitDelayForAgent with the platform, prompt text, and agent type. It no longer derives the delay from pasted prompt byte length. The test covers agent-specific submit timing policies, including Antigravity’s per-line settling behavior.

Priority: ⬇️ Low

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the problem, change, and verification, but it does not follow the required template. It omits the ELI5, What Changed, Why, Linked Issue with a Fixes reference, Visual Proof or… Complete the required template sections. Add the missing headings and content, include a valid Fixes #... issue reference, provide visual proof or write N/A with a reason, complete the testing checklist and platform coverage, address th…
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the runtime test change and the use of the agent-specific submit delay. It is concise and directly related to the main change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the problem, change, and verification, but it does not follow the required template. It omits the ELI5, What Changed, Why, Linked Issue with a Fixes reference, Visual Proof or an explicit N/A explanation, Testing checkboxes, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist sections.

Resolution

Complete the required template sections. Add the missing headings and content, include a valid Fixes #... issue reference, provide visual proof or write N/A with a reason, complete the testing checklist and platform coverage, address the AI Disclosure and agent-skill boundary sections, and complete the Notes and Checklist items.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — a test-only fix for a CI-red timeout in the agent PTY timing policy case.

  • Expected delay now comes from the agent's own policy — the it.each case advances fake timers by resolveAgentPromptSubmitDelayForAgent(process.platform, 'review this change', agent) instead of the byte-only getAgentPromptSubmitDelayMs, so antigravity's submitLineSettleMsPerLine is accounted for and the submit no longer stays pending into the real 30 s timeout.

The computed delay matches what the runtime actually uses on the local pty this test drives: orca-runtime-write-terminal-agent-prompt.ts:87 takes resolveAgentPromptSubmitDelayForAgent(writeHostPlatform, options.promptForSchedule, agent), sendTerminalAgentPrompt always sets promptForSchedule, getPtyWriteHostPlatform returns process.platform for a local pty, and getPtyAgent returns the launchAgent. Verified with CI=1 pnpm exec vitest run src/main/runtime/orca-runtime.test.ts -t "PTY timing policy" → 35 passed / 1255 skipped. A regression back to the byte-only delay would still fail this test (the shorter real delay lands the \r before submitDelayMs - 1), so the change keeps real coverage.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@Jinwoo-H
Jinwoo-H merged commit 58a80d9 into main Sep 21, 2026
31 checks passed
@Jinwoo-H
Jinwoo-H deleted the fix-antigravity-prompt-timing-test branch September 21, 2026 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant