fix: stabilize transport-ready test timing
This commit is contained in:
@@ -325,12 +325,7 @@ export async function runEmbeddedAttempt(
|
|||||||
// Force a stable streamFn reference so vitest can reliably mock @mariozechner/pi-ai.
|
// Force a stable streamFn reference so vitest can reliably mock @mariozechner/pi-ai.
|
||||||
activeSession.agent.streamFn = streamSimple;
|
activeSession.agent.streamFn = streamSimple;
|
||||||
|
|
||||||
applyExtraParamsToAgent(
|
applyExtraParamsToAgent(activeSession.agent, params.config, params.provider, params.modelId);
|
||||||
activeSession.agent,
|
|
||||||
params.config,
|
|
||||||
params.provider,
|
|
||||||
params.modelId,
|
|
||||||
);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const prior = await sanitizeSessionHistory({
|
const prior = await sanitizeSessionHistory({
|
||||||
|
|||||||
@@ -61,10 +61,7 @@ export function listThinkingLevels(provider?: string | null, model?: string | nu
|
|||||||
return levels;
|
return levels;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function listThinkingLevelLabels(
|
export function listThinkingLevelLabels(provider?: string | null, model?: string | null): string[] {
|
||||||
provider?: string | null,
|
|
||||||
model?: string | null,
|
|
||||||
): string[] {
|
|
||||||
if (isBinaryThinkingProvider(provider)) return ["off", "on"];
|
if (isBinaryThinkingProvider(provider)) return ["off", "on"];
|
||||||
return listThinkingLevels(provider, model);
|
return listThinkingLevels(provider, model);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,13 +9,13 @@ describe("waitForTransportReady", () => {
|
|||||||
await waitForTransportReady({
|
await waitForTransportReady({
|
||||||
label: "test transport",
|
label: "test transport",
|
||||||
timeoutMs: 500,
|
timeoutMs: 500,
|
||||||
logAfterMs: 100,
|
logAfterMs: 120,
|
||||||
logIntervalMs: 100,
|
logIntervalMs: 100,
|
||||||
pollIntervalMs: 50,
|
pollIntervalMs: 80,
|
||||||
runtime,
|
runtime,
|
||||||
check: async () => {
|
check: async () => {
|
||||||
attempts += 1;
|
attempts += 1;
|
||||||
if (attempts > 3) return { ok: true };
|
if (attempts > 4) return { ok: true };
|
||||||
return { ok: false, error: "not ready" };
|
return { ok: false, error: "not ready" };
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user