From 052095e156af371bf84e4a4e4cf97f0c886c11d1 Mon Sep 17 00:00:00 2001 From: can1357 Date: Tue, 11 Aug 2026 21:16:13 +0200 Subject: [PATCH] test(coding-agent): fixed think-tool CI failures in gallery and activation tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added a curated think gallery fixture; the generic fallback carries no thoughts field, so the streaming state rendered zero lines. - Seeded the shared test registry with a runtime openai key: the prompt preflight validates through the registry, not the per-request getApiKey override, so keyless CI runners threw before reaching the mock server. - Expected reasoning effort "none" — the only disable level the Responses wire accepts; "off" is not a wire value. --- .../src/cli/gallery-fixtures/agentic.ts | 16 ++++++++++++++++ .../test/sdk-tool-activation.test.ts | 6 +++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/packages/coding-agent/src/cli/gallery-fixtures/agentic.ts b/packages/coding-agent/src/cli/gallery-fixtures/agentic.ts index c50904901..568d8fbd3 100644 --- a/packages/coding-agent/src/cli/gallery-fixtures/agentic.ts +++ b/packages/coding-agent/src/cli/gallery-fixtures/agentic.ts @@ -361,6 +361,22 @@ export const agenticFixtures: Record = { }, }, + think: { + label: "Think", + // Streaming: scratchpad text still arriving. + streamingArgs: { + thoughts: "The retry loop re-reads the config after every failure — that explains the doubled latency.", + }, + args: { + thoughts: + "The retry loop re-reads the config after every failure — that explains the doubled latency. Cache the parsed config outside the loop, then re-check the invalidation path before answering.", + }, + result: { + content: [{ type: "text", text: "------" }], + details: { recorded: true }, + }, + }, + hub_jobs: { label: "Hub jobs", renderer: "hub", diff --git a/packages/coding-agent/test/sdk-tool-activation.test.ts b/packages/coding-agent/test/sdk-tool-activation.test.ts index 7a3ec4d9e..8e5c87f80 100644 --- a/packages/coding-agent/test/sdk-tool-activation.test.ts +++ b/packages/coding-agent/test/sdk-tool-activation.test.ts @@ -269,6 +269,9 @@ describe("createAgentSession defaultInactive tool activation", () => { }); const model = getBundledModel("openai", "gpt-5"); if (!model) throw new Error("Expected gpt-5 model to exist"); + // The prompt preflight validates the key through the registry (not the + // per-request `getApiKey` override), so seed it for keyless CI runners. + modelRegistry.authStorage.setRuntimeApiKey("openai", "test-key"); const { session } = await createAgentSession({ ...baseOptions(tempDir), settings, @@ -284,7 +287,8 @@ describe("createAgentSession defaultInactive tool activation", () => { expect(requestTexts).toHaveLength(2); expect(JSON.parse(firstRequest)).toEqual( expect.objectContaining({ - reasoning: { effort: "off" }, + // "none" is the only disable level the Responses wire accepts ("off" 400s). + reasoning: { effort: "none" }, tool_choice: expect.objectContaining({ name: "think" }), }), );