From 88198bfaee14cceb0186c0ecc3398743ce3d6891 Mon Sep 17 00:00:00 2001 From: Jinwoo-H Date: Sun, 20 Sep 2026 23:29:08 -0400 Subject: [PATCH] test(runtime): expect the agent's own submit delay, not the generic one The Antigravity submit-timing case computed its expected wait with getAgentPromptSubmitDelayMs, which knows only byte ingest. Antigravity is the one agent with submitLineSettleMsPerLine, so production waits 45 ms longer per input line. The test advanced fake time to the shorter figure and then awaited the send, so the outstanding settle timer never fired and the case burned its full 30 s timeout. Ask the production policy resolver for the delay, and pin the drift with an assertion that the per-agent delay is the generic delay plus the agent's configured line settle. --- ...rminal-creation-and-readiness-part-07.spec.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) 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..26aab80c272 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,8 @@ import { AGENT_PROMPT_BRACKETED_PASTE_END, AGENT_PROMPT_BRACKETED_PASTE_START, buildAgentPromptPasteBytes, - getAgentPromptSubmitDelayMs + 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 +611,18 @@ describe('OrcaRuntimeService', () => { launchAgent: agent }) - const submitDelayMs = getAgentPromptSubmitDelayMs( + // The submit wait is per agent: a line-settle policy adds to the generic byte-ingest + // delay, so expecting the generic delay here stalls this test for its whole timeout. + const submitDelayMs = resolveAgentPromptSubmitDelayForAgent( process.platform, - Buffer.byteLength(buildAgentPromptPasteBytes('review this change'), 'utf8') + 'review this change', + agent + ) + expect(submitDelayMs).toBe( + getAgentPromptSubmitDelayMs( + process.platform, + Buffer.byteLength(buildAgentPromptPasteBytes('review this change'), 'utf8') + ) + (TUI_AGENT_CONFIG[agent].submitLineSettleMsPerLine ?? 0) ) const sendPromise = runtime.sendTerminalAgentPrompt(handle, 'review this change') if (agent === 'omp') {