Skip to content

fix: pin Codex to 0.94.0 + wire_api=chat for multi-turn stability - #1518

Merged
louisgv merged 2 commits into
OpenRouterLabs:mainfrom
AhmedTMM:fix/codex-chat-wire-api
Feb 20, 2026
Merged

louisgv merged 2 commits into
OpenRouterLabs:mainfrom
AhmedTMM:fix/codex-chat-wire-api

Conversation

@AhmedTMM

@AhmedTMM AhmedTMM commented Feb 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • OpenRouter's Responses API proxy drops required fields (id, content) from conversation-history items on multi-turn requests, causing Invalid Responses API request at input[6]+
  • Codex >=0.97.0 removed wire_api=chat support (openai/codex#10157), so we pin to 0.94.0 — the last release where Chat Completions format still works
  • Updates all 8 cloud scripts + manifest.json install command
  • Tracking upstream: openai/codex#12114
  • TODO: unpin once OpenRouter /responses handles round-trip correctly

Test plan

  • Deploy Codex on any cloud (e.g. spawn codex aws)
  • Verify install uses @openai/[email protected]
  • Send first prompt — should get a response
  • Send second+ prompts — should no longer fail with Invalid Responses API request
  • Verify multi-turn conversation works (3+ turns)

🤖 Generated with Claude Code

AhmedTMM and others added 2 commits February 20, 2026 01:37
…stability

The Responses API format causes "Invalid Responses API request" errors on
the second turn and beyond — conversation history items round-trip through
OpenRouter with null content fields and missing IDs that fail validation.
Chat Completions format is fully supported and avoids this issue.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
OpenRouter's Responses API proxy drops required fields (id, content) from
conversation-history items on multi-turn requests, causing "Invalid
Responses API request" at input[6]+. Codex >=0.97.0 removed wire_api=chat
support (openai/codex#10157), so we pin to 0.94.0 — the last release where
Chat Completions format still works.

Tracking: openai/codex#12114
TODO: unpin once OpenRouter /responses handles round-trip correctly.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@AhmedTMM AhmedTMM changed the title fix: switch Codex wire_api to chat for multi-turn stability fix: pin Codex to 0.94.0 + wire_api=chat for multi-turn stability Feb 20, 2026

@louisgv louisgv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security Review

Verdict: APPROVED
Commit: 64cbab2

Findings

No security issues found. Changes are safe:

  • Version pinning to @openai/[email protected] prevents unexpected breaking changes
  • Config change from wire_api="responses" to wire_api="chat" is a benign string literal
  • All package version strings are hardcoded (not user-supplied)
  • No command injection, credential leaks, or path traversal risks

Tests

  • bash -n: PASS (all 9 .sh files)
  • bun test: N/A (no TypeScript changes)
  • curl|bash: OK (source fallback patterns intact)
  • macOS compat: OK (no bash 3.x incompatibilities introduced)

Technical Review

The PR fixes a multi-turn conversation issue by:

  1. Pinning Codex to 0.94.0 (last version supporting wire_api="chat")
  2. Switching from OpenRouter's Responses API proxy to Chat Completions API
  3. Well-documented rationale in code comments with issue tracking link

Changes are consistent across all 8 clouds (aws, daytona, digitalocean, fly, gcp, hetzner, local, sprite) plus manifest.json and shared/common.sh.


-- security/pr-reviewer

@louisgv
louisgv merged commit b5d174a into OpenRouterLabs:main Feb 20, 2026
3 checks passed
@AhmedTMM
AhmedTMM deleted the fix/codex-chat-wire-api branch February 26, 2026 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants