Description
Users are encountering an "Invalid value" error when gpd verification is enabled. The specific error message is:
Invalid value at 'tools[0].function_declarations[40].parameters.properties[0].value.properties[1].value.properties[0].value.enum[0]' (TYPE_STRING), 1
Steps to Reproduce
-
Enable gpd verification in opencode.
-
Perform an action that triggers GPD verification (exact action unknown, but typically involves code modifications, phase transitions, or specific GPD commands).
-
Observe the "Invalid value" error.
Expected Behavior
GPD verification should complete without type validation errors, correctly handling all parameter types, including enum values within the lock parameter of gpd-conventions_assert_convention_validate.
But The system throws an "Invalid value" error, specifically (TYPE_STRING), 1, indicating a type mismatch during schema validation, possibly with an enum field expecting a string but receiving an integer.
Runtime
opencode, specifically using the gemini-2.5-flash model (model ID: google/gemini-2.5-flash) but I am facing it with many ai models
Root cause found in src/gpd/mcp/servers/verification_server.py**
The const keyword (JSON Schema draft-6) is not supported by Gemini's OpenAPI 3.0 schema format. Three occurrences:
-
"must_surface": {"const": True} in the reference input schema — fix: "must_surface": {"enum": [True]}
-
"schema_version": {"type": "integer", "const": 1} in _CONTRACT_PAYLOAD_INPUT_SCHEMA — fix: "schema_version": {"type": "integer", "enum": [1]}
-
Same line in _compact_contract_payload_requirement_schema — same fix.
These schemas are used by the run_contract_check and suggest_contract_checks MCP tools in the verification server. When Gemini serializes them, const: 1 gets converted to enum: [1] but the type coercion breaks — the field becomes string-typed while the value 1 remains an integer, producing the (TYPE_STRING), 1 error.
Also latent: src/gpd/contracts.py has schema_version: Literal[1] = 1 in a Pydantic model (Pydantic generates const from Literal). Fix: schema_version: int = Field(default=1, json_schema_extra={"enum": [1]}).
GPD Version
gpd 1.2.2
Operating System
Arch Linux
Screenshots

Description
Users are encountering an "Invalid value" error when gpd verification is enabled. The specific error message is:
Invalid value at 'tools[0].function_declarations[40].parameters.properties[0].value.properties[1].value.properties[0].value.enum[0]' (TYPE_STRING), 1Steps to Reproduce
Enable gpd verification in opencode.
Perform an action that triggers GPD verification (exact action unknown, but typically involves code modifications, phase transitions, or specific GPD commands).
Observe the "Invalid value" error.
Expected Behavior
GPD verification should complete without type validation errors, correctly handling all parameter types, including enum values within the lock parameter of gpd-conventions_assert_convention_validate.
But The system throws an "Invalid value" error, specifically (TYPE_STRING), 1, indicating a type mismatch during schema validation, possibly with an enum field expecting a string but receiving an integer.
Runtime
opencode, specifically using the gemini-2.5-flash model (model ID: google/gemini-2.5-flash) but I am facing it with many ai models
Root cause found in
src/gpd/mcp/servers/verification_server.py**The
constkeyword (JSON Schema draft-6) is not supported by Gemini's OpenAPI 3.0 schema format. Three occurrences:"must_surface": {"const": True}in the reference input schema — fix:"must_surface": {"enum": [True]}"schema_version": {"type": "integer", "const": 1}in_CONTRACT_PAYLOAD_INPUT_SCHEMA— fix:"schema_version": {"type": "integer", "enum": [1]}Same line in
_compact_contract_payload_requirement_schema— same fix.These schemas are used by the
run_contract_checkandsuggest_contract_checksMCP tools in the verification server. When Gemini serializes them,const: 1gets converted toenum: [1]but the type coercion breaks — the field becomesstring-typed while the value1remains an integer, producing the(TYPE_STRING), 1error.Also latent:
src/gpd/contracts.pyhasschema_version: Literal[1] = 1in a Pydantic model (Pydantic generatesconstfromLiteral). Fix:schema_version: int = Field(default=1, json_schema_extra={"enum": [1]}).GPD Version
gpd 1.2.2
Operating System
Arch Linux
Screenshots