fix(openai-chat): tolerate null tool-call padding - #1468
Conversation
|
Important Review skippedNo new commits to review since the last review. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe OpenAI Chat adapter now treats null tool-call payloads as absent in streaming and non-streaming responses. Hardening tests verify preserved text output, completion usage, and error-free processing. ChangesOpenAI null tool-call handling
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
|
✅ Deterministic PR hygiene checks passed. |
✅ READY
Review readiness checklist
✅ 4/4 boxes ticked. This pull request is already Ready for Review. |
Ingwannu
left a comment
There was a problem hiding this comment.
This is a valid, focused compatibility correction. tool_calls: null is an absent optional value in both Chat Completions response modes, while the patch still rejects non-array containers, null array entries, and incomplete claimed calls through the existing fail-closed adapter error path.
I rechecked exact head 53c1f425 on current dev@20c513198:
- nine adjacent OpenAI Chat / Chat Completions suites: 161 passed, 0 failed;
- typecheck: passed;
- privacy scan: passed;
git diff --check: passed.
The added streaming and buffered regressions cover the intended boundary, and no documentation change is needed for this internal wire-compatibility fix. I did not find a blocker in the diff.
I am not approving or merging while the PR is draft with the readiness checklist at 0/4 and no exact-head full CI. Once the author completes the checklist against this head, current-head automated review has run, and required CI is green, this should be a strong merge candidate.
|
|
|
Tip For best results, initiate chat on the files or code changes.
You are interacting with an AI system. |
Summary
tool_calls: nullas an absent optional field in streamed and buffered OpenAI-compatible responses.This restores compatibility with providers that use
nullas padding when no tool call is present, without accepting malformed claimed tool-call payloads.Verification
bun test tests/openai-chat-hardening.test.tsbun run typecheckbun run testbun run privacy:scanNo documentation change is needed because this is an internal adapter compatibility correction with no configuration or public API change.
Checklist
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
All CI tests are green on my local testing.
I pushed my PR to the latest dev commit.
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.
Summary by CodeRabbit
null.