Skip to content

Comments

fix(schema): add missing reward and languages fields to ModelCapabilities#171

Open
pradhyum6144 wants to merge 1 commit intomodelpack:mainfrom
pradhyum6144:fix-schema-missing-capabilities-fields
Open

fix(schema): add missing reward and languages fields to ModelCapabilities#171
pradhyum6144 wants to merge 1 commit intomodelpack:mainfrom
pradhyum6144:fix-schema-missing-capabilities-fields

Conversation

@pradhyum6144
Copy link

Summary

The ModelCapabilities Go struct defines reward (bool) and languages ([]string) fields, but both were absent from the ModelCapabilities definition in config-schema.json. Additionally, ModelCapabilities was missing additionalProperties: false, which every other object in the schema has.

Details

  • Problem 1: reward and languages fields defined in v1.ModelCapabilities had no corresponding schema entries, so they were never validated.
  • Problem 2: Without additionalProperties: false, any unknown field inside capabilities would silently pass schema validation inconsistent with ModelConfig, ModelDescriptor, and ModelFS which all enforce this.
  • Fix: Added reward (boolean) and languages (array of strings) to the ModelCapabilities schema definition, and added additionalProperties: false.

Testing

Added 4 new test cases to TestConfig:

  • reward is not boolean → fail
  • languages is not an array → fail
  • Unknown field inside capabilities → fail (new guard via additionalProperties: false)
  • Valid config with reward and languages correctly set → pass
go test ./schema/ -run TestConfig -v          ✓ PASS
go test ./schema/ -run TestValidateConfigExample -v   ✓ PASS
go test ./...                                  ✓ PASS

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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 ModelCapabilities JSON schema by incorporating previously missing fields (reward and languages) and implementing stricter validation rules. These changes ensure that model configuration files adhere more closely to the defined structure, preventing silent failures from malformed or unexpected data and improving overall data integrity.

Highlights

  • Schema Alignment: The config-schema.json has been updated to include the reward (boolean) and languages (array of strings) fields within the ModelCapabilities definition, ensuring consistency with the ModelCapabilities Go struct.
  • Stricter Validation: additionalProperties: false was added to the ModelCapabilities schema, preventing unknown fields from silently passing validation and aligning its behavior with other schema objects like ModelConfig, ModelDescriptor, and ModelFS.
  • Enhanced Testing: Four new test cases were introduced in config_test.go to verify the correct validation of the new reward and languages fields, as well as the enforcement of additionalProperties: false for unknown fields.
Changelog
  • schema/config-schema.json
    • Added reward field of type boolean to ModelCapabilities.
    • Added languages field of type array of strings to ModelCapabilities.
    • Added additionalProperties: false to ModelCapabilities to disallow undeclared properties.
  • schema/config_test.go
    • Added a test case for reward field validation (non-boolean input fails).
    • Added a test case for languages field validation (non-array input fails).
    • Added a test case for additionalProperties: false enforcement (unknown field fails).
    • Added a test case for a valid configuration including the new reward and languages fields.
Activity
  • The author, pradhyum6144, has implemented changes to align the ModelCapabilities JSON schema with its Go struct counterpart.
  • New validation rules have been introduced to ensure data integrity and consistency across model configurations.
  • Comprehensive testing has been performed, including four new test cases, all of which passed, confirming the correctness of the schema updates.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Ady0333
Copy link

Ady0333 commented Feb 24, 2026

@aftersnow

This PR mislabels a breaking change as a bug fix and must not merge as-is.

additionalProperties: false on ModelCapabilities is not a fix — it silently invalidates any downstream config using custom capability fields, which were perfectly valid before. This is a BREAKING CHANGE: commit at minimum. Labeling it fix(schema) actively misleads automated changelogs and every downstream integrator this spec claims to support.

Additionally, languages is added with zero validation. The spec mandates ISO 639-1 codes yet "english", "", and ["en","en"] all pass. At minimum add:

"pattern": "^[a-z]{2}$", "uniqueItems": true

The 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>
@pradhyum6144 pradhyum6144 force-pushed the fix-schema-missing-capabilities-fields branch from 46879a8 to eab6be3 Compare February 24, 2026 09:11
@pradhyum6144
Copy link
Author

@aftersnow

This PR mislabels a breaking change as a bug fix and must not merge as-is.

additionalProperties: false on ModelCapabilities is not a fix — it silently invalidates any downstream config using custom capability fields, which were perfectly valid before. This is a BREAKING CHANGE: commit at minimum. Labeling it fix(schema) actively misleads automated changelogs and every downstream integrator this spec claims to support.

Additionally, languages is added with zero validation. The spec mandates ISO 639-1 codes yet "english", "", and ["en","en"] all pass. At minimum add:

"pattern": "^[a-z]{2}$", "uniqueItems": true

The field additions are correct. Everything else needs fixing before merge. Requesting changes.

Thanks for the feedback both points addressed in the latest commit.
@Ady0333 Though I'd note your review reads like it was written by an AI. Happy to get human feedback anytime.

@Ady0333
Copy link

Ady0333 commented Feb 24, 2026

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants