Update SDK with multipart boundary fix#1446
Conversation
Copies the patched SDK from kiln_server PR #211 which removes hardcoded Content-Type headers on multipart endpoints. Adds regression tests that verify multipart encoding works correctly when zip payloads contain boundary-like strings (e.g. +++). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (10)
📒 Files selected for processing (1)
WalkthroughThis PR adds a comprehensive test module that regression-tests multipart boundary encoding for file uploads. It creates helper utilities to build and extract multipart requests, then validates that the SDK's multipart encoding correctly handles both normal and adversarial zip contents, including payloads containing delimiter-like strings. ChangesMultipart Boundary Encoding Tests
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Code Review
This pull request introduces the MessageUsage model to track token usage and cost, updates existing models to integrate it, replaces dateutil.parser.isoparse with datetime.datetime.fromisoformat, and adds a new test suite for multipart boundary handling. Feedback highlights a compatibility issue with datetime.datetime.fromisoformat parsing UTC timestamps ending in 'Z' on Python versions prior to 3.11, and suggests improvements to the test helpers to ensure robust header parsing and prevent false matches on binary payloads.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
📊 Coverage ReportOverall Coverage: 92% Diff: origin/main...HEADNo lines with coverage information in this diff.
|
Copies the patched generated SDK from kiln_server PR https://github.com/Kiln-AI/kiln_server/pull/211 and adds regression tests for the multipart boundary fix.
The regenerated SDK no longer hardcodes Content-Type headers on multipart endpoints, letting httpx auto-generate a safe boundary. This prevents multipart parse failures when zip payloads happen to contain the boundary string.
New test file with 7 tests that build real httpx multipart requests through the SDK and verify the zip content survives a round-trip even with adversarial payloads like
+++,------, and fake Content-Disposition headers.🤖 Generated with Claude Code