fix(nanogpt): preserve optional tool parameters - #1590
Conversation
|
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 (2)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📜 Recent review details🧰 Additional context used📓 Path-based instructions (5)Treat model, provider, MCP, path, command, and tool data as untrusted.⚙️ CodeRabbit configuration file Files:
Require regression coverage at the lowest valid harness with behavior-focused assertions, including relevant negative, error, false/unset, and boundary cases.⚙️ CodeRabbit configuration file Files:
Check strict typing and exhaustive behavior across normal, boundary, error, cancellation, retry, and compatibility paths.⚙️ CodeRabbit configuration file Files:
Verify extension/webview contracts, cancellation and error propagation, VS Code lifecycle correctness, and behavior under retries and partial failure.⚙️ CodeRabbit configuration file Files:
Act as an adversarial second-opinion reviewer.⚙️ CodeRabbit configuration file Files:
🔇 Additional comments (2)
📝 SummarySummary by CodeRabbit
WalkthroughNanoGPT now forwards tool schemas without OpenAI conversion. Function tools receive ChangesNanoGPT tool forwarding
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to NanoGPT now preserves optional tool parameters without changing shared conversion or routing behavior. Focused tests cover the affected paths, so the change is mergeable pending normal CI and maintainer checks. 🚥 Pre-merge checks | ✅ 8✅ Passed checks (8 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 |
Review statusThanks for contributing. This comment tracks the review sequence and the next action. Current step: Awaiting fresh human maintainer or CODEOWNER approval. Automated review is complete for the latest commit but does not replace human approval. Review-state labels are managed by this workflow; do not edit them manually. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Related GitHub Issue
Issue approval and assignment are pending. Opening this as a draft for maintainer feedback, not as ready for review.
Description
The NanoGPT handler uses the shared OpenAI strict-schema converter, which makes every tool property required and removes nullability.
For
read_file, this changes the required fields from justpathtopath,mode,offset,limit, andindentation, including every nested indentation option. Valid slice reads can then fail because they omit indentation settings they do not need.This change preserves the original parameter schemas and sets function tools to
strict: false. Genuine required fields, types, bounds, nullability, and additional-property constraints remain unchanged. Caller-owned definitions are not mutated, and non-function tools pass through unchanged.The change is limited to NanoGPT. It does not modify the shared converter, repair arguments, bypass validation, or change routing or reasoning controls. This supports the project's reliability and API compatibility goals.
Tradeoff: this stops requesting strict constrained generation. It preserves the tool's actual contract but does not guarantee that every model response will satisfy it.
Test Procedure
From the repository root:
The separate local live harness used the actual handler, streaming parser, 13 native tool definitions, real fixture-file execution, and tool-result continuation with
alibaba/qwen3.8-flash. Completion required returning values obtained from both files. Requests usedtool_choice=auto, a 4096-token cap, and no sampling/reasoning overrides or SDK retries. No missing arguments were invented. The live harness and private request artifacts are not included in this two-file diff.These were synthetic conversations, not a replay of the customer's full history or a complete VS Code UI test. The small sample does not establish a general failure rate or fix overload errors. Local tests used Node 26.0.0 and pnpm 10.8.1; CI on the pinned Node 22.23.1 remains necessary. Dependencies were installed from the frozen lockfile with install scripts disabled; no full extension build or complete workspace test run was performed.
Pre-Submission Checklist
Additional Notes
No UI changes. AI assistance was used for investigation, implementation, tests, and this description. This draft contains no private support identifiers, customer arguments, credentials, or internal routing details.