fix(ai): mirror Codex instruction-only plan input#4718
Merged
Conversation
- Preserved Codex developer instructions while adding a user continuation when the request would otherwise contain only hidden guidance. - Covered fresh plan execution request shaping and verified existing Codex lite tests. Fixes #4714
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
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.
Repro
A fresh Codex plan-execution context with only system/developer guidance builds a Responses request whose
inputhas the developer plan instruction but no user item. Reproduced withbun test packages/ai/test/openai-codex-responses-lite.test.ts -t "adds a user continuation", which failed because the expected user continuation was absent.Cause
packages/ai/src/providers/openai-codex/request-transformer.tspreservedinstructionsand prepended developer messages, but it did not add any visibleuserinput when the converted conversation was empty. Codex treats instruction-onlyresponse.createpayloads as missing actionable input and rejects them before the agent can read the approvedlocal://<slug>-plan.mdplan.Fix
inputarray.role: "user"message mirroring the final instruction text.packages/aichangelog entry for Codex plan approval fresh execution fails with missing input error #4714.Verification
bun test packages/ai/test/openai-codex-responses-lite.test.tspassed with 21 tests.bun run --cwd packages/ai check:typespassed. Pre-publishgh_push_branchcompleted itsbun run fixandbun checkgate before pushing. Fixes #4714