From 28a5d124c341d0360914d84476e710da86531c8f Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 16 Jan 2026 23:03:12 +0000 Subject: [PATCH] fix: stabilize transport-ready test timing --- src/agents/pi-embedded-runner/run/attempt.ts | 7 +------ src/auto-reply/thinking.ts | 5 +---- src/infra/transport-ready.test.ts | 6 +++--- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/agents/pi-embedded-runner/run/attempt.ts b/src/agents/pi-embedded-runner/run/attempt.ts index 12d19087e..7677c8fd5 100644 --- a/src/agents/pi-embedded-runner/run/attempt.ts +++ b/src/agents/pi-embedded-runner/run/attempt.ts @@ -325,12 +325,7 @@ export async function runEmbeddedAttempt( // Force a stable streamFn reference so vitest can reliably mock @mariozechner/pi-ai. activeSession.agent.streamFn = streamSimple; - applyExtraParamsToAgent( - activeSession.agent, - params.config, - params.provider, - params.modelId, - ); + applyExtraParamsToAgent(activeSession.agent, params.config, params.provider, params.modelId); try { const prior = await sanitizeSessionHistory({ diff --git a/src/auto-reply/thinking.ts b/src/auto-reply/thinking.ts index 297a8d6ca..447f98c20 100644 --- a/src/auto-reply/thinking.ts +++ b/src/auto-reply/thinking.ts @@ -61,10 +61,7 @@ export function listThinkingLevels(provider?: string | null, model?: string | nu return levels; } -export function listThinkingLevelLabels( - provider?: string | null, - model?: string | null, -): string[] { +export function listThinkingLevelLabels(provider?: string | null, model?: string | null): string[] { if (isBinaryThinkingProvider(provider)) return ["off", "on"]; return listThinkingLevels(provider, model); } diff --git a/src/infra/transport-ready.test.ts b/src/infra/transport-ready.test.ts index 6d18a265b..79c42e22d 100644 --- a/src/infra/transport-ready.test.ts +++ b/src/infra/transport-ready.test.ts @@ -9,13 +9,13 @@ describe("waitForTransportReady", () => { await waitForTransportReady({ label: "test transport", timeoutMs: 500, - logAfterMs: 100, + logAfterMs: 120, logIntervalMs: 100, - pollIntervalMs: 50, + pollIntervalMs: 80, runtime, check: async () => { attempts += 1; - if (attempts > 3) return { ok: true }; + if (attempts > 4) return { ok: true }; return { ok: false, error: "not ready" }; }, });