Skip to content

Commit e0e7fb9

Browse files
taltasnavedmerchantroomote
authored
[Fix] GPT-5.6 Luna requests rejected by Codex backend when using ChatGPT OAuth (#889)
* fix(openai-codex): support Luna Responses Lite requests * Nuke md file that shouldnt have been commited in the first place * fix(openai-codex): address Luna Responses Lite review feedback - Capture telemetry when transformLunaResponsesLiteBody throws in createMessage - Drop weak Record<string, any> alias from transformLunaResponsesLiteBody signature - Document intentional tool_choice/parallel_tool_calls and reasoning context overrides - Strengthen tests: full input array assertion, reasoning context overwrite case, retry header coverage, single-build spy, and uuidv7 session shape check --------- Co-authored-by: Naved Merchant <naved.merchant@gmail.com> Co-authored-by: Roomote <roomote@roomote.dev>
1 parent 78c1410 commit e0e7fb9

3 files changed

Lines changed: 533 additions & 30 deletions

File tree

src/api/providers/__tests__/openai-codex-native-tool-calls.spec.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,22 @@ describe("OpenAiCodexHandler native tool calls", () => {
515515

516516
await expect(handler.completePrompt("Test prompt")).resolves.toBe("done")
517517

518+
const fetchOptions = mockFetch.mock.calls[0][1]
519+
const body = JSON.parse(fetchOptions.body)
520+
expect(body.input).toEqual([
521+
{
522+
role: "user",
523+
content: [{ type: "input_text", text: "Test prompt" }],
524+
},
525+
])
526+
expect(body).not.toHaveProperty("prompt_cache_key")
527+
expect(body.reasoning?.context).toBeUndefined()
528+
expect(body.input).not.toContainEqual(expect.objectContaining({ type: "additional_tools" }))
529+
expect(body.input).not.toContainEqual(expect.objectContaining({ role: "developer" }))
530+
expect(fetchOptions.headers).not.toHaveProperty("session-id")
531+
expect(fetchOptions.headers).not.toHaveProperty("x-session-affinity")
532+
expect(fetchOptions.headers).not.toHaveProperty("version")
533+
expect(fetchOptions.headers).not.toHaveProperty("x-openai-internal-codex-responses-lite")
518534
expect(mockFetch).toHaveBeenCalledWith(
519535
expect.stringContaining("/responses"),
520536
expect.objectContaining({

0 commit comments

Comments
 (0)