Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes an agent validation issue where creating global agents failed with a PointerToNowhere: '/definitions/OtherSettings' error. The root cause was that the validator was incorrectly pointed at a sub-schema (schema['definitions']['Agent']) instead of the root schema, which stripped the shared definitions and broke JSON Schema $ref resolution. The fix updates validate_agent() to use the root schema with a proper RefResolver.
Changes:
- Updated agent validation logic to use root schema and RefResolver for proper
$refresolution - Incremented application version from 0.237.011 to 0.237.049
- Added comprehensive fix documentation
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| application/single_app/json_schema_validation.py | Modified validate_agent() to use root schema with RefResolver instead of sub-schema |
| application/single_app/config.py | Updated VERSION from "0.237.011" to "0.237.049" |
| docs/explanation/fixes/AGENT_SCHEMA_REF_RESOLUTION_FIX.md | Added complete documentation of the fix including root cause, solution, and testing approach |
Comments suppressed due to low confidence (2)
application/single_app/json_schema_validation.py:22
- The conditional logic here may not work as intended. The check
schema.get("$ref") and schema.get("definitions")will be true for the agent.schema.json (which has both), but the fix should apply unconditionally since the schema always has this structure. The else branch creates a validator without a resolver, which is the root cause of the bug being fixed. Consider simplifying this to always use the resolver when definitions exist, or remove the conditional entirely since agent.schema.json always has this structure.
if schema.get("$ref") and schema.get("definitions"):
validator = Draft7Validator(schema, resolver=RefResolver.from_schema(schema))
else:
validator = Draft7Validator(schema)
application/single_app/config.py:91
- The version number jumps from 0.237.011 to 0.237.049, skipping many versions. According to the coding guidelines, only the third set of digits should be incremented by one. The version should be 0.237.012 instead of 0.237.049.
VERSION = "0.237.049"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the issue when creating global agents resulting from a validator that does not follow $refs.