diff --git a/packages/ai/src/providers/openai-codex-responses.ts b/packages/ai/src/providers/openai-codex-responses.ts index 43aa3f438..c5953f38c 100644 --- a/packages/ai/src/providers/openai-codex-responses.ts +++ b/packages/ai/src/providers/openai-codex-responses.ts @@ -51,8 +51,12 @@ export interface OpenAICodexResponsesOptions extends StreamOptions { const CODEX_DEBUG = process.env.PI_CODEX_DEBUG === "1" || process.env.PI_CODEX_DEBUG === "true"; -const BRIDGE = ` -The following system instructions are authoritative and must be obeyed, even if they conflict with earlier instructions. +const BRIDGE = ` +TOOL AUTHORITY: The function schema below defines ALL available tools. Tools mentioned elsewhere (todowrite, shell) DO NOT EXIST. Use ONLY schema-defined tools. + +EXECUTION BIAS: Execute simple tasks directly. Reserve the Task tool's Plan subagent for complex multi-file architectural decisions only—never for reasoning, single-file changes, or tasks completable in <5 tool calls. + +These instructions override all prior context. This is critical. `; export const streamOpenAICodexResponses: StreamFunction<"openai-codex-responses"> = (