[WRONG BRANCH] fix(adapters): preserve Responses URL authority by normalizing only the pathname - #280
Conversation
|
✅ Deterministic PR hygiene checks passed. |
⏳ DRAFT
What to do
Its title has been prefixed with |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe Responses adapter now parses and normalizes the base URL before appending ChangesResponses URL normalization
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized change preserves the URL authority while normalizing the Responses pathname, with a regression test covering the affected host-only case; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Motivation
baseUrlstring and could rewrite the authority for host-only inputs (e.g.https://responses), which risks sending provider credentials to an unintended origin./v1/responsespath.Description
URLparse insrc/adapters/openai-responses-url.tsand operate onurl.pathnameso authority/host is never altered.trimmedPath, strip trailing/,/responses, or/v1only from the pathname, then seturl.pathname =${withoutV1}/v1/responses`` and returnurl.toString().tests/openai-responses-passthrough.test.tsasserting that a host-only base URLhttps://responsesbecomeshttps://responses/v1/responses(and does not change the authority).Testing
node_modules/@oven/bun-linux-x64-baseline/bin/bun test --isolate tests/openai-responses-passthrough.test.tsand the file passed (68 tests, including the newopenaiResponsesUrlcase).bun run typecheckandbun run privacy:scan, both of which succeeded.bun run test; the full suite exercised unrelated tests and encountered timeouts/failures outside the modified subsystem, so only the focused tests were relied upon for verification.Codex Task
Summary by CodeRabbit
/v1/responsessuffix for bare base URLs.