Repository navigation
fix(codex): pass instructions and input through unchanged - #157
Merged
Merged
Conversation
rexdotsh
added this pull request to stack #161
October 21, 2026 14:43
rexdotsh
force-pushed
the
fix/codex-instructions-passthrough
branch
from
October 21, 2026 15:02
94b47b3 to
2354c4d
Compare
rexdotsh
removed this pull request from stack #161
October 21, 2026 18:57
rexdotsh
force-pushed
the
fix/codex-instructions-passthrough
branch
from
October 22, 2026 07:33
2354c4d to
ce8e18f
Compare
Defaults are injected only when a request has no instructions and no system/developer input. Prompt-cache keys include system/developer input items now that they stay in input.
rexdotsh
force-pushed
the
fix/codex-instructions-passthrough
branch
from
October 22, 2026 11:34
ce8e18f to
ee61bde
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Kleis trimmed
instructions, moved a leading system/developer message intoinstructions, or injected the bundledcodex-default-instructions.txt. This PR passesinstructionsandinputthrough untouched: no trimming and no promotion.For compatibility, the bundled default instructions are still injected, but only when a request has no instruction context at all: no non-empty top-level
instructionsand nosystem/developermessage anywhere ininput. A client sending{model, input:[{role:"user",content:"hi"}]}still gets the defaults.The backend accepts requests without top-level
instructions. Two official clients send them that way:ResponsesApiRequest(codex-api/src/common.rs#L279-L304) has noinstructionsfield, and no other part of that file has one either. Base instructions go intoinputas a developer message (client.rs#L1031-L1041). Codex sends this to the samechatgpt.com/backend-api/codex/responsesbackend when signed in with ChatGPT.instructionsonly when there is a system prompt (open-responses.ts#L762-L771).Rebased onto main (564fc73): now one commit. Since system/developer messages stay in
input, the prompt-cache conversation key (#164) now also includes those items, so sibling agents with different developer instructions stay separate.