diff --git a/packages/ai/CHANGELOG.md b/packages/ai/CHANGELOG.md index 7b4364d44..459ed2734 100644 --- a/packages/ai/CHANGELOG.md +++ b/packages/ai/CHANGELOG.md @@ -13,6 +13,9 @@ ### Fixed - Fixed Xiaomi MiMo standard API-key validation to use the supported `mimo-v2.5` model. ([#4063](https://github.com/can1357/oh-my-pi/issues/4063)) +### Fixed + +- Reworded the GPT-5 Responses no-reasoning fallback developer item so it no longer says `# Juice: 0 !important` or implies a zero tool/execution budget. ([#4151](https://github.com/can1357/oh-my-pi/issues/4151)) ## [16.2.12] - 2026-07-01 diff --git a/packages/ai/src/providers/openai-responses-reasoning-suppression.md b/packages/ai/src/providers/openai-responses-reasoning-suppression.md new file mode 100644 index 000000000..d97c4d5b3 --- /dev/null +++ b/packages/ai/src/providers/openai-responses-reasoning-suppression.md @@ -0,0 +1 @@ +Keep internal reasoning brief. Continue following the task and use tools normally. diff --git a/packages/ai/src/providers/openai-shared.ts b/packages/ai/src/providers/openai-shared.ts index b6cd43daa..3778893e5 100644 --- a/packages/ai/src/providers/openai-shared.ts +++ b/packages/ai/src/providers/openai-shared.ts @@ -75,6 +75,7 @@ import { } from "./github-copilot-headers"; import type { ChatCompletionCreateParamsStreaming } from "./openai-chat-wire"; import type { InputItem } from "./openai-codex/request-transformer"; +import responsesReasoningSuppressionPrompt from "./openai-responses-reasoning-suppression.md" with { type: "text" }; import type { ResponseContentPartAddedEvent, ResponseCreateParamsStreaming, @@ -2365,6 +2366,8 @@ export function applyCommonResponsesSamplingParams
{
{ role: "user", content: [{ type: "input_text", text: "Say hello" }] },
{
role: "developer",
- content: [{ type: "input_text", text: "# Juice: 0 !important" }],
+ content: [
+ {
+ type: "input_text",
+ text: "Keep internal reasoning brief. Continue following the task and use tools normally.",
+ },
+ ],
},
]);
});
diff --git a/packages/ai/test/openai-compat-policy.test.ts b/packages/ai/test/openai-compat-policy.test.ts
index 33034ce86..44fd8c94b 100644
--- a/packages/ai/test/openai-compat-policy.test.ts
+++ b/packages/ai/test/openai-compat-policy.test.ts
@@ -123,6 +123,35 @@ describe("OpenAI compat policy", () => {
expect(responseBody.reasoning).toBeUndefined();
});
+ it("uses a non-budget fallback prompt for Responses no-reasoning compat", () => {
+ const compat: OpenAICompat = { requiresJuiceZeroHack: true };
+ const responseBody = responsesParams();
+ const responseInput: ResponseInput = [];
+
+ const appended = applyResponsesCompatPolicy(
+ responseBody,
+ responseInput,
+ resolveOpenAICompatPolicy(responsesModel(compat), { endpoint: "responses" }),
+ undefined,
+ );
+
+ expect(appended).toBe(1);
+ expect(responseInput.at(-1)).toEqual({
+ role: "developer",
+ content: [
+ {
+ type: "input_text",
+ text: "Keep internal reasoning brief. Continue following the task and use tools normally.",
+ },
+ ],
+ });
+ const serialized = JSON.stringify(responseInput.at(-1));
+ expect(serialized).not.toContain("Juice");
+ expect(serialized).not.toContain("!important");
+ expect(serialized).not.toContain("budget");
+ expect(serialized).not.toContain("zero");
+ });
+
it("exposes reasoning replay constraints independent of endpoint", () => {
const compat: OpenAICompat = {
requiresReasoningContentForToolCalls: true,
diff --git a/packages/ai/test/openai-responses-history-payload.test.ts b/packages/ai/test/openai-responses-history-payload.test.ts
index 8f6c004fc..b9347e347 100644
--- a/packages/ai/test/openai-responses-history-payload.test.ts
+++ b/packages/ai/test/openai-responses-history-payload.test.ts
@@ -26,9 +26,9 @@ function createCodexToken(accountId: string): string {
/**
* Returns the bundled `gpt-5-mini` model with `compat.requiresJuiceZeroHack`
- * cleared so it doesn't trigger the GPT-5 "Juice: 0" developer-message hack
- * injected by `applyResponsesReasoningParams`. The hack is exercised by its
- * own targeted tests; these history-replay tests assert raw payload shape and
+ * cleared so it doesn't trigger the GPT-5 no-reasoning developer-message
+ * fallback injected by `applyResponsesReasoningParams`. The fallback is
+ * exercised by its own targeted tests; these history-replay tests assert raw payload shape and
* should stay independent of it.
*/
function getOpenAIReasoningModel(
diff --git a/packages/ai/test/openai-responses-stateful.test.ts b/packages/ai/test/openai-responses-stateful.test.ts
index fa3fc33a8..b0b3711c8 100644
--- a/packages/ai/test/openai-responses-stateful.test.ts
+++ b/packages/ai/test/openai-responses-stateful.test.ts
@@ -101,8 +101,8 @@ describe("openai-responses stateful chaining", () => {
const sentRequests: Array