From 969eb8fc00f2ccee7ef4cdb211f949620a82631b Mon Sep 17 00:00:00 2001 From: can1357 Date: Sun, 11 Jan 2026 03:39:17 +0100 Subject: [PATCH] feat(ai/providers): updated system prompt bridge for OpenAI Codex tool authority and execution bias - Updated system prompt bridge to clarify tool authority and execution bias for OpenAI Codex responses. - Changed environment override priority from '0' to 'critical' to enforce instruction precedence. - Added explicit guidance that only schema-defined tools are available and non-schema tools do not exist. - Added execution bias guidance to use Task tool's Plan subagent only for complex multi-file architectural decisions. --- packages/ai/src/providers/openai-codex-responses.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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"> = (