Each agent (Reviewer, Fixer, Tester, Verifier, Escalator) prompts Gemini to return structured JSON with defined schemas (REVIEW_SCHEMA, FIX_SCHEMA, etc.), but there's no enforcement layer.
If Gemini returns malformed JSON, extra fields, or entirely wrong output (common with smaller models), the chain breaks silently or produces garbage results that get posted as reviews.
Recommendation: Add a JSON schema validation step after each agent response using jsonschema.validate(). On validation failure:
- Log the malformed response
- Retry once with an explicit "your output didn't match the schema, please follow the format" message
- On second failure, escalate to the Escalator with the raw response
Each agent (Reviewer, Fixer, Tester, Verifier, Escalator) prompts Gemini to return structured JSON with defined schemas (
REVIEW_SCHEMA,FIX_SCHEMA, etc.), but there's no enforcement layer.If Gemini returns malformed JSON, extra fields, or entirely wrong output (common with smaller models), the chain breaks silently or produces garbage results that get posted as reviews.
Recommendation: Add a JSON schema validation step after each agent response using
jsonschema.validate(). On validation failure: