Repository navigation
Conversation
Signed-off-by: ai-jz <ai-jz@users.noreply.github.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (5)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughThe change adds ChangesParameter type lookup
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The additional-properties change is mergeable after normal checks; support for single-element type arrays can be considered separately. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change is limited to argument typing and preserves the inspected parsing and cleanup behavior. No introduced security concern was established, but downstream authorization and argument validation were not verified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Description
Problem
A tool can accept arbitrary dictionary keys but require their values to be strings with
additionalProperties: {"type":"string"}. SMG ignores that declaration and turns the model's text42into a number, ornullinto JSON null. A tool expecting strings can then reject the arguments.The same text is handled correctly when its type is declared directly in
properties. This fills a gap in the schema-based string preservation introduced by SMG's #1841. The expected type comes from the tool's JSON Schema, rather than another provider's response.Solution
Use the explicit property's type first. For names absent from
properties, also read the single declared type fromadditionalPropertiesbefore applying the existing conversion. GLM, Qwen XML, and MiniMax M2 share this lookup. Only these three parsers are changed; MiniMax M3 and HY v4 use separate lookups and remain unchanged.Behavior change: these additional arguments follow their declared type. Explicit properties, including those without a type, retain precedence. Boolean, union, and unknown schemas retain the existing inference. When
patternPropertiesis nonempty, this change conservatively leaves unlisted names on the existing path; it does not add pattern matching or$refresolution.Changes
Test Plan
Minimal reproducible example — CPU only
From an SMG checkout, create
crates/tool_parser/examples, save the following asrepro_additional_properties.rsinside it, and runcargo run -p tool-parser --example repro_additional_properties. No model endpoint or GPU is required. Before the fix, the first assertion passes and the second fails; after the fix, both pass.Remove the temporary example before running repository lint checks.
{"code":"42"}additionalProperties{"code":42}; assertion fails{"code":"42"}; assertion passes"42"and"null"Tested on an independent patch against
c0d3efa4ff829694164d901bbe7a837923604fc1, with Rust 1.98.0: the MRE passes, all 553 tool-parser tests pass with no skips, and parser Clippy and workspace formatting pass. The two lookup regressions also check explicit-property precedence, existing integer types, and unchanged fallback for boolean, union, and patterned schemas.This checks the native Rust parser. It does not claim HTTP serving or model inference validation.
Selected command output from the independent patch
The test line is the library test binary; the total across all tool-parser test binaries is reported above.
Repository checks
Workspace checks also passed with this patch and the two companion parser fixes (#2744 and #2745) applied together. The parser checks above tested this PR independently.
cargo +nightly fmt --all -- --checkcargo clippy --locked --all-targets --all-features -- -D warningscargo test --lockedWASM test fixtures were built. Fixture-dependent vision cases were not exercised because the CI vision-golden generation step was not run. Ignored external-service/campaign tests and GPU serving were not run; this is not a full hosted-CI result.
Hosted CI
Both workflows completed successfully for PR head
228630c809a633d4d45c192f74e093405c0c9be3:Claude Respondandgo-bindings-benchmarkwere skipped by the workflow; they are not counted as passing tests.Checklist
cargo +nightly fmt --all -- --checkpasses