fix(responses): preserve caller User-Agent - #4702
Conversation
|
✅ Deterministic PR hygiene checks passed. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe Responses adapter now preserves the caller’s ChangesResponses User-Agent Preservation
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~15 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The adapter change preserves the intended User-Agent fallback behavior without identified merge-blocking risk. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (2 skipped: 2 unsupported.)
✨ 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 |
리뷰 · 우선순위 74 / 80이 PR은 이슈 #4699를 고친다. Codex CLI가 OpenCodex를 거쳐 Responses 호환 게이트웨이(보고 사례는 Volcengine Ark/화산방주)로 나갈 때, 어댑터가 업스트림 헤더를 새로 만들면서호출자 고치는 방법은 좁다. 테스트는 라인 68-74 메인테이너의 판단이 필요한 지점
너의 추천 이 댓글은 grok-bot이 작성했습니다 |
Summary
User-Agentas a narrow fallback in both key-auth and canonical-forward Responses routesUser-Agentauthoritative, including mixed-case header namesWhy
Some Responses-compatible providers, including Ark-backed compatibility paths, use the Codex client fingerprint to select Codex-specific behavior. The adapter currently rebuilds its upstream headers and drops the caller
User-Agent, so those providers can choose a generic path even though the request came from Codex.Validation
bun test tests/codex-integration/codex-metadata-integrity.test.ts— 24 passedbun run typecheck— passedbun run structure:check— passedbun run privacy:scan— passedcd docs-site && bun run build— passed, 441 pagesgit diff --check— passedAll tests used isolated temporary
HOME,OPENCODEX_HOME, andCODEX_HOMEvalues. No local runtime configuration was read or written.No Go counterpart exists for this TypeScript Responses adapter change on the currently published integration branches.
Closes #4699
Summary by CodeRabbit
User-Agentwhen no provider value is configured.User-Agentvalues take precedence, regardless of header capitalization.User-Agentis added when the caller does not provide one; other caller headers remain unaffected.User-Agenthandling.