d24d11a274
- Standardized missing-file read errors and now return `File not found: <path>` for absent edit targets. - Centralized AI provider, usage, and OAuth helpers into shared modules to remove duplicated logic. - Migrated OAuth/API-key login flows to shared factory helpers and removed inline prompt/token-exchange code. - Reused shared tools and formatter utilities for discovery, stream tails, LSP batching, and source formatting. - Consolidated repeated test helpers and fixtures into shared modules, replacing inline helper duplicates.
26 lines
978 B
TypeScript
26 lines
978 B
TypeScript
import { describe, expect, it } from "bun:test";
|
|
import { type RequestBody, transformRequestBody } from "@oh-my-pi/pi-ai/providers/openai-codex/request-transformer";
|
|
import { createCodexModel } from "./helpers";
|
|
|
|
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, createCodexModel(body.model), { include: ["foo"] });
|
|
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, createCodexModel(body.model), {
|
|
include: ["foo", "reasoning.encrypted_content"],
|
|
});
|
|
expect(transformed.include).toEqual(["foo", "reasoning.encrypted_content"]);
|
|
});
|
|
});
|