Skip to content
This repository was archived by the owner on Feb 18, 2026. It is now read-only.

v0.4.1: Fix Codex Streaming

Choose a tag to compare

@9j 9j released this 16 Nov 21:42
· 27 commits to main since this release

🐛 Bug Fixes

Fixed Streaming Requests for Codex Models

This patch release fixes a critical issue where streaming requests to Codex models were using the wrong API endpoint, causing 404 errors and forcing fallback to secondary providers.

What was broken:

  • ❌ Streaming requests to Codex models used /v1/chat/completions
  • ❌ OpenAI API returned 404 errors
  • ❌ System fell back to zenmux provider

What's fixed:

  • ✅ Streaming requests now use /v1/responses endpoint
  • ✅ No more 404 errors from OpenAI API
  • ✅ All requests succeed with primary provider

📝 Changes

  • Modified send_message_stream() to detect Codex models
  • Route streaming requests to correct endpoint based on model type
  • Added debug logging for streaming endpoint selection

🔧 Technical Details

Code Changes:

// Before: Always used /v1/chat/completions
let url = format!("{}/chat/completions", self.base_url);

// After: Smart routing based on model
let (url, request_body) = if is_codex {
    // Codex models → /v1/responses
} else {
    // Standard models → /v1/chat/completions
}

✅ Testing

  • Verified streaming works with gpt-5.1-codex model
  • Confirmed no 404 errors in production logs
  • Both streaming and non-streaming requests work correctly

📦 Files Changed

  • src/providers/openai.rs: +17 lines, -4 lines

🤖 Generated with Claude Code