diff --git a/src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts b/src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts index 3ae648ab0ef..5e1de184c9c 100644 --- a/src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts +++ b/src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts @@ -3,7 +3,7 @@ import { AGENT_PROMPT_BRACKETED_PASTE_END, AGENT_PROMPT_BRACKETED_PASTE_START, buildAgentPromptPasteBytes, - getAgentPromptSubmitDelayMs + resolveAgentPromptSubmitDelayForAgent } from '../../../shared/agent-prompt-injection' import { TUI_AGENT_CONFIG } from '../../../shared/tui-agent-config' import type { TuiAgent } from '../../../shared/tui-agent' @@ -610,9 +610,13 @@ describe('OrcaRuntimeService', () => { launchAgent: agent }) - const submitDelayMs = getAgentPromptSubmitDelayMs( + // The agent's own policy, not the byte-only delay: antigravity adds a per-line settle + // (#21665), and advancing fake timers by less than the policy waits leaves the submit + // pending until the real 30 s timeout. + const submitDelayMs = resolveAgentPromptSubmitDelayForAgent( process.platform, - Buffer.byteLength(buildAgentPromptPasteBytes('review this change'), 'utf8') + 'review this change', + agent ) const sendPromise = runtime.sendTerminalAgentPrompt(handle, 'review this change') if (agent === 'omp') {