fix(schema): add missing reward and languages fields to ModelCapabilities#171
fix(schema): add missing reward and languages fields to ModelCapabilities#171pradhyum6144 wants to merge 1 commit intomodelpack:mainfrom
Conversation
Summary of ChangesHello @pradhyum6144, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request is a great fix. It correctly adds the missing reward and languages fields to the ModelCapabilities JSON schema, bringing it in sync with the Go struct definition. The addition of additionalProperties: false is a good change for consistency and stricter validation. The new test cases are thorough, covering both failure scenarios for invalid data types and extraneous properties, and a success scenario for a valid configuration. The changes are well-implemented and improve the overall quality and correctness of the schema validation.
|
This PR mislabels a breaking change as a bug fix and must not merge as-is.
Additionally, "pattern": "^[a-z]{2}$", "uniqueItems": trueThe field additions are correct. Everything else needs fixing before merge. Requesting changes. |
…ties
Adds reward (boolean) and languages (ISO 639-1 two-letter codes) fields
to the ModelCapabilities JSON schema definition to match the Go struct.
languages enforces pattern ^[a-z]{2}$ and uniqueItems: true.
Signed-off-by: pradhyum6144 <pradhyum314@gmail.com>
46879a8 to
eab6be3
Compare
Thanks for the feedback both points addressed in the latest commit. |
|
I find it ironic that instead of acknowledging the valid technical concerns raised, you're questioning the source of the review. Your code shipped a breaking change disguised as a bug fix and a field with absolutely no validation and the moment these were pointed out, you were scrambling to fix them within minutes. That urgency speaks louder than any comment about AI. Next time, maybe do that scrutiny before raising the PR, not after getting called out. |
Summary
The
ModelCapabilitiesGo struct definesreward(bool) andlanguages([]string) fields, but both were absent from theModelCapabilitiesdefinition inconfig-schema.json. Additionally,ModelCapabilitieswas missingadditionalProperties: false, which every other object in the schema has.Details
rewardandlanguagesfields defined inv1.ModelCapabilitieshad no corresponding schema entries, so they were never validated.additionalProperties: false, any unknown field insidecapabilitieswould silently pass schema validation inconsistent withModelConfig,ModelDescriptor, andModelFSwhich all enforce this.reward(boolean) andlanguages(array of strings) to theModelCapabilitiesschema definition, and addedadditionalProperties: false.Testing
Added 4 new test cases to
TestConfig:rewardis not boolean → faillanguagesis not an array → failcapabilities→ fail (new guard viaadditionalProperties: false)rewardandlanguagescorrectly set → pass