Files
CLIProxyAPI/internal/runtime/executor
SamGu-NRX b97f71da0c fix(codex): send the ChatGPT routing hint native Codex sends
- Send X-Codex-Routing-Hint ("model=<slug>" plus ";tier=<service_tier>")
  on ChatGPT-backend requests over HTTP, compact and websocket handshakes,
  matching openai/codex rust-v0.155.0 build_routing_hint_header. Translated
  requests previously carried service_tier=priority only in the body.
- Derive the hint from the final upstream body, replacing a hint a native
  client forwarded, so it names the model and tier actually sent.
- Keep operator precedence: an auth header rule that resolves to a value
  wins, a dynamic rule that resolves to nothing falls back to the derived
  hint, and models.json override_header still applies last.
- Leave API-key requests unchanged, and keep websocket reuse as native Codex
  does: an open connection keeps its handshake hint when the tier changes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 19:56:53 -05:00
..