fix: support current Codex web search endpoint - #1376
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe OpenAI HTTP proxy now recognizes ChangesCodex search endpoint
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to The change adds support for the current Codex web-search path while preserving protected handling for existing and unknown paths; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Linked Issues checkExplanation The change recognizes and forwards /api/codex/alpha/search, masks the synthetic API key, and keeps unknown endpoint handling fail-closed [
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Closes #315.
Root cause
Codex resolves
alpha/searchrelative to its configured base URL. Pentect replaces that base URL with its authenticated local gateway, so the gateway receivesPOST /alpha/search; the upstream destination becomes/backend-api/codex/alpha/searchafter Pentect rejoins the original ChatGPT base. Pentect recognized only fully rooted variants, so fail-closed handling returned HTTP 422 before the request reached OpenAI.A second bug classified the token-prefixed local URL directly for persistent diagnostics, causing even known endpoints to be logged as
endpoint: unknown.What changed
/alpha/searchas the protected standalone-search dialect/v1/alpha/search,/api/codex/alpha/search, and/backend-api/codex/alpha/searchcompatibilitysearch_queryis masked before forwardingunsupported-endpoint, without bodies, headers, URLs, or credentialsVerification
cargo test -q -p pentect-cli --bin pentect --locked openai_http_proxy::tests(56 passed)cargo test -q -p pentect-cli --bin pentect --locked gateway_diagnostics::tests(2 passed)cargo fmt --all --checkgit diff --check