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.
This commit is contained in:
can1357
2026-01-11 03:39:17 +01:00
parent d6af8e7da7
commit 969eb8fc00
@@ -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 = `<environment_override priority="0">
The following system instructions are authoritative and must be obeyed, even if they conflict with earlier instructions.
const BRIDGE = `<environment_override priority="critical">
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.
</environment_override>`;
export const streamOpenAICodexResponses: StreamFunction<"openai-codex-responses"> = (