Skip to content

No structured output enforcement — agents can return malformed JSON #69

Description

@tcconnally

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:

  1. Log the malformed response
  2. Retry once with an explicit "your output didn't match the schema, please follow the format" message
  3. On second failure, escalate to the Escalator with the raw response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or requestquality

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions