fix(agents): avoid empty Codex Responses input#74558
Conversation
5a2a67a to
85bcbe2
Compare
|
Codex review: needs maintainer review before merge. What this changes: This PR adds a Codex Responses-only sentinel user input item for systemPrompt-only contexts, adds focused builder coverage, and records the fix in the changelog for #73820. Maintainer follow-up before merge: This is an open implementation PR that appears to address a valid provider bug; the remaining action is maintainer review, branch update if needed, and validation rather than a separate ClawSweeper repair PR. Security review: Security review cleared: The diff only changes same-endpoint Codex Responses payload shaping, a unit test, and a changelog entry; it does not alter dependencies, workflows, secrets, permissions, package scripts, or artifact execution. Review detailsBest possible solution: Land a focused transport fix that keeps Codex system prompt text in top-level Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 97e2f5b3324b. |
85bcbe2 to
69314a6
Compare
|
Landed in 06b1d4e. Thanks @vyctorbrzezowski. I adjusted the fallback input to a single-space Verified:
|
Summary
openai-codexmodels usingopenai-codex-responsescould build a request withinput: []when the context only had asystemPrompt.instructionsand add a minimal sentinel user input item when there are no converted messages.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause (if applicable)
instructions, but still sent the converted message array asinput; with no user/assistant/tool history, that array was empty.openai-codex-responsessystem-prompt-only payload shape.input,previous_response_id,prompt, orconversation_id; an emptyinputarray is treated as missing.Regression Test Plan (if applicable)
src/agents/openai-transport-stream.test.tsopenai-codex-responseswithsystemPromptandmessages: []produces non-empty sentinelinputwhile preserving top-levelinstructions.buildOpenAIResponsesParams, so direct builder coverage catches the rejected payload shape without live Codex calls.User-visible / Behavior Changes
OpenAI Codex provider turns that only have system-prompt-backed instructions no longer send
input: []to the ChatGPT Codex backend.Diagram (if applicable)
Security Impact (required)
Yes/No): NoYes/No): NoYes/No): NoYes/No): NoYes/No): NoYes, explain risk + mitigation: N/ARepro + Verification
Environment
openai-codex/openai-codex-responsesSteps
openai-codexmodel with APIopenai-codex-responses.systemPromptset andmessages: [].Expected
instructionscontains the sanitized system prompt.inputis non-empty.Actual
inputwas[].Evidence
Human Verification (required)
What you personally verified (not just CI), and how:
instructions; fallback input stays a small sentinel; non-Codex providers are not routed through the new fallback.Review Conversations
If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.
Compatibility / Migration
Yes/No): YesYes/No): NoYes/No): NoRisks and Mitigations
openai-codex+openai-codex-responsesand only when the converted input would otherwise be empty; the system prompt remains ininstructions.AI-Assisted Disclosure
pnpm check:changed.