test(coding-agent): fixed think-tool CI failures in gallery and activation tests
- 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.
This commit is contained in:
@@ -361,6 +361,22 @@ export const agenticFixtures: Record<string, GalleryFixture> = {
|
||||
},
|
||||
},
|
||||
|
||||
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",
|
||||
|
||||
@@ -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" }),
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user