mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-21 10:00:39 +00:00
fix(ai): always include reasoning.encrypted_content for codex (#484)
This commit is contained in:
parent
cfa2ba544f
commit
47402ddaf7
2 changed files with 30 additions and 1 deletions
|
|
@ -323,7 +323,9 @@ export async function transformRequestBody(
|
||||||
verbosity: options.textVerbosity || "medium",
|
verbosity: options.textVerbosity || "medium",
|
||||||
};
|
};
|
||||||
|
|
||||||
body.include = options.include || ["reasoning.encrypted_content"];
|
const include = Array.isArray(options.include) ? [...options.include] : [];
|
||||||
|
include.push("reasoning.encrypted_content");
|
||||||
|
body.include = Array.from(new Set(include));
|
||||||
|
|
||||||
delete body.max_output_tokens;
|
delete body.max_output_tokens;
|
||||||
delete body.max_completion_tokens;
|
delete body.max_completion_tokens;
|
||||||
|
|
|
||||||
27
packages/ai/test/openai-codex-include.test.ts
Normal file
27
packages/ai/test/openai-codex-include.test.ts
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
import { describe, expect, it } from "vitest";
|
||||||
|
import { type RequestBody, transformRequestBody } from "../src/providers/openai-codex/request-transformer.js";
|
||||||
|
|
||||||
|
describe("openai-codex include handling", () => {
|
||||||
|
it("always includes reasoning.encrypted_content when caller include is custom", async () => {
|
||||||
|
const body: RequestBody = {
|
||||||
|
model: "gpt-5.1-codex",
|
||||||
|
};
|
||||||
|
|
||||||
|
const transformed = await transformRequestBody(body, "CODEX_INSTRUCTIONS", { include: ["foo"] }, true);
|
||||||
|
expect(transformed.include).toEqual(["foo", "reasoning.encrypted_content"]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("does not duplicate reasoning.encrypted_content", async () => {
|
||||||
|
const body: RequestBody = {
|
||||||
|
model: "gpt-5.1-codex",
|
||||||
|
};
|
||||||
|
|
||||||
|
const transformed = await transformRequestBody(
|
||||||
|
body,
|
||||||
|
"CODEX_INSTRUCTIONS",
|
||||||
|
{ include: ["foo", "reasoning.encrypted_content"] },
|
||||||
|
true,
|
||||||
|
);
|
||||||
|
expect(transformed.include).toEqual(["foo", "reasoning.encrypted_content"]);
|
||||||
|
});
|
||||||
|
});
|
||||||
Loading…
Add table
Add a link
Reference in a new issue