fix(codex): prevent unexpected protocol leakage and fabricated instructions on bare chat completion requests without tools (#1686)

This commit is contained in:
diegosouzapw
2026-04-27 19:39:37 -03:00
parent b1974dac12
commit 905b7555c2

View File

@@ -1002,9 +1002,11 @@ export class CodexExecutor extends BaseExecutor {
!body.instructions ||
(typeof body.instructions === "string" && body.instructions.trim() === "")
) {
body.instructions = hasTools
? CODEX_DEFAULT_INSTRUCTIONS
: "You are a helpful AI assistant.";
if (hasTools) {
body.instructions = CODEX_DEFAULT_INSTRUCTIONS;
} else {
delete body.instructions;
}
}
}