|
1 | 1 | import { describe, expect, test } from "bun:test"; |
2 | 2 | import type { ConversationTurn, LastCycleSource } from "@intx/types/runtime"; |
| 3 | +import { PRODUCT_NAME } from "../branding.js"; |
3 | 4 | import { |
4 | 5 | createCodexResponsesAdapter, |
5 | 6 | isResponsesStreamTerminal, |
@@ -58,6 +59,29 @@ describe("createCodexResponsesAdapter", () => { |
58 | 59 | const adapter = createCodexResponsesAdapter(source); |
59 | 60 | expect(adapter.isStreamTerminal).toBe(isResponsesStreamTerminal); |
60 | 61 | }); |
| 62 | + |
| 63 | + test("bridge message points at Codex tool proxies instead of neutralizing them", () => { |
| 64 | + const adapter = createCodexResponsesAdapter(source); |
| 65 | + const turns: ConversationTurn[] = [ |
| 66 | + { role: "user", timestamp: 0, content: [{ type: "text", text: "hi" }] }, |
| 67 | + ]; |
| 68 | + |
| 69 | + const request = adapter.buildRequest(turns, "gpt-5.1-codex", { |
| 70 | + systemPrompt: "operating prompt body", |
| 71 | + }); |
| 72 | + const body = JSON.parse(request.body) as { |
| 73 | + input: Array<{ role?: string; content?: Array<{ text?: string }> }>; |
| 74 | + }; |
| 75 | + const bridgeText = body.input[0]?.content?.[0]?.text ?? ""; |
| 76 | + |
| 77 | + expect(bridgeText).toContain(`${PRODUCT_NAME} is the harness, not the Codex CLI.`); |
| 78 | + expect(bridgeText).toContain("apply_patch, update_plan, shell"); |
| 79 | + expect(bridgeText).toContain("proxy onto"); |
| 80 | + expect(bridgeText).toContain("prefer whichever name appears in the current tool list"); |
| 81 | + expect(bridgeText).toContain("operating prompt body"); |
| 82 | + expect(bridgeText).not.toContain("DO NOT EXIST"); |
| 83 | + expect(bridgeText).not.toContain("Ignore every tool reference"); |
| 84 | + }); |
61 | 85 | }); |
62 | 86 |
|
63 | 87 | describe("createCodexResponsesAdapter usage parsing", () => { |
|
0 commit comments