Skip to content

fix(ai): mirror Codex instruction-only plan input#4718

Merged
can1357 merged 1 commit into
mainfrom
farm/20f3e857/codex-plan-execution-input
Jul 6, 2026
Merged

fix(ai): mirror Codex instruction-only plan input#4718
can1357 merged 1 commit into
mainfrom
farm/20f3e857/codex-plan-execution-input

Conversation

@roboomp

@roboomp roboomp commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Repro

A fresh Codex plan-execution context with only system/developer guidance builds a Responses request whose input has the developer plan instruction but no user item. Reproduced with bun 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.ts preserved instructions and prepended developer messages, but it did not add any visible user input when the converted conversation was empty. Codex treats instruction-only response.create payloads as missing actionable input and rejects them before the agent can read the approved local://<slug>-plan.md plan.

Fix

  • Preserve developer guidance when transforming Codex request bodies, including bodies that did not already carry an input array.
  • Detect instruction-only Codex request bodies and append a non-empty role: "user" message mirroring the final instruction text.
  • Add regression coverage for fresh execution request shaping and for the existing-user guard that must not duplicate real user input.
  • Add an packages/ai changelog entry for Codex plan approval fresh execution fails with missing input error #4714.

Verification

bun test packages/ai/test/openai-codex-responses-lite.test.ts passed with 21 tests. bun run --cwd packages/ai check:types passed. Pre-publish gh_push_branch completed its bun run fix and bun check gate before pushing. Fixes #4714

- 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
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@github-actions github-actions Bot added the vouched Passed the vouch gate label Jul 6, 2026
@can1357 can1357 merged commit da5ccf1 into main Jul 6, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

vouched Passed the vouch gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Codex plan approval fresh execution fails with missing input error

2 participants