mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-19 07:47:28 +00:00
fix(agents): don't force store=true for codex responses
This commit is contained in:
@@ -137,4 +137,27 @@ describe("applyExtraParamsToAgent", () => {
|
|||||||
|
|
||||||
expect(payload.store).toBe(false);
|
expect(payload.store).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("does not force store=true for Codex responses (Codex requires store=false)", () => {
|
||||||
|
const payload = { store: false };
|
||||||
|
const baseStreamFn: StreamFn = (_model, _context, options) => {
|
||||||
|
options?.onPayload?.(payload);
|
||||||
|
return new AssistantMessageEventStream();
|
||||||
|
};
|
||||||
|
const agent = { streamFn: baseStreamFn };
|
||||||
|
|
||||||
|
applyExtraParamsToAgent(agent, undefined, "openai-codex", "codex-mini-latest");
|
||||||
|
|
||||||
|
const model = {
|
||||||
|
api: "openai-codex-responses",
|
||||||
|
provider: "openai-codex",
|
||||||
|
id: "codex-mini-latest",
|
||||||
|
baseUrl: "https://chatgpt.com/backend-api/codex/responses",
|
||||||
|
} as Model<"openai-codex-responses">;
|
||||||
|
const context: Context = { messages: [] };
|
||||||
|
|
||||||
|
void agent.streamFn?.(model, context, {});
|
||||||
|
|
||||||
|
expect(payload.store).toBe(false);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -8,8 +8,10 @@ const OPENROUTER_APP_HEADERS: Record<string, string> = {
|
|||||||
"HTTP-Referer": "https://openclaw.ai",
|
"HTTP-Referer": "https://openclaw.ai",
|
||||||
"X-Title": "OpenClaw",
|
"X-Title": "OpenClaw",
|
||||||
};
|
};
|
||||||
const OPENAI_RESPONSES_APIS = new Set(["openai-responses", "openai-codex-responses"]);
|
// NOTE: We only force `store=true` for *direct* OpenAI Responses.
|
||||||
const OPENAI_RESPONSES_PROVIDERS = new Set(["openai", "openai-codex"]);
|
// Codex responses (chatgpt.com/backend-api/codex/responses) require `store=false`.
|
||||||
|
const OPENAI_RESPONSES_APIS = new Set(["openai-responses"]);
|
||||||
|
const OPENAI_RESPONSES_PROVIDERS = new Set(["openai"]);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resolve provider-specific extra params from model config.
|
* Resolve provider-specific extra params from model config.
|
||||||
|
|||||||
Reference in New Issue
Block a user