fix(ci): repair e2e mocks and tool schemas

This commit is contained in:
Peter Steinberger
2026-02-15 22:45:44 +00:00
parent 0e2d8b8a1e
commit bbcbabab74
9 changed files with 65 additions and 43 deletions

View File

@@ -28,6 +28,7 @@ const SessionsSpawnToolSchema = Type.Object({
model: Type.Optional(Type.String()),
thinking: Type.Optional(Type.String()),
runTimeoutSeconds: Type.Optional(Type.Number({ minimum: 0 })),
// Back-compat: older callers used timeoutSeconds for this tool.
timeoutSeconds: Type.Optional(Type.Number({ minimum: 0 })),
cleanup: optionalStringEnum(["delete", "keep"] as const),
});
@@ -98,14 +99,16 @@ export function createSessionsSpawnTool(opts?: {
});
// Default to 0 (no timeout) when omitted. Sub-agent runs are long-lived
// by default and should not inherit the main agent 600s timeout.
const legacyTimeoutSeconds =
typeof params.timeoutSeconds === "number" && Number.isFinite(params.timeoutSeconds)
? Math.max(0, Math.floor(params.timeoutSeconds))
: undefined;
const timeoutSecondsCandidate =
typeof params.runTimeoutSeconds === "number"
? params.runTimeoutSeconds
: typeof params.timeoutSeconds === "number"
? params.timeoutSeconds
: undefined;
const runTimeoutSeconds =
typeof params.runTimeoutSeconds === "number" && Number.isFinite(params.runTimeoutSeconds)
? Math.max(0, Math.floor(params.runTimeoutSeconds))
: (legacyTimeoutSeconds ?? 0);
typeof timeoutSecondsCandidate === "number" && Number.isFinite(timeoutSecondsCandidate)
? Math.max(0, Math.floor(timeoutSecondsCandidate))
: 0;
let modelWarning: string | undefined;
let modelApplied = false;