Skip to content

fix(schema): refresh strict output schema#14

Merged
kunchenguid merged 1 commit intomainfrom
fix/schema
Apr 2, 2026
Merged

fix(schema): refresh strict output schema#14
kunchenguid merged 1 commit intomainfrom
fix/schema

Conversation

@kunchenguid
Copy link
Copy Markdown
Owner

Summary

This change tightens the agent output contract and keeps persisted run schemas up to date. It makes the shared JSON schema reject unexpected fields and rewrites the per-run output-schema.json whenever a run is resumed, so file-based agents do not keep using an older schema.

Risk Assessment: 🟢 Low — Small, well-covered schema enforcement change with no negative test or review signals.

Architecture

flowchart TD
  subgraph schema_def["Schema Definition"]
    direction TB
    agent_schema["AGENT_OUTPUT_SCHEMA (updated)"]
    run_setup["setupRun (updated)"]
    run_resume["resumeRun (updated)"]
    schema_file["Run Schema File (updated)"]

    agent_schema -->|"serialized by"| run_setup
    agent_schema -->|"serialized by"| run_resume
    run_setup -->|"writes for new runs"| schema_file
    run_resume -->|"refreshes on resume"| schema_file
  end

  subgraph agent_integration["Agent Integration"]
    direction TB
    claude_agent["ClaudeAgent (unchanged)"]
    opencode_agent["OpenCodeAgent (unchanged)"]
    codex_agent["CodexAgent (unchanged)"]
    rovodev_agent["RovoDevAgent (unchanged)"]

    agent_schema -->|"passed as inline schema"| claude_agent
    agent_schema -->|"embedded in prompt format"| opencode_agent
    schema_file -->|"used via --output-schema"| codex_agent
    schema_file -->|"read for inline system prompt"| rovodev_agent
  end
Loading

Key changes made

  • Added additionalProperties: false to AGENT_OUTPUT_SCHEMA, requiring agent output to match only the expected fields.
  • Extracted schema writing into writeSchemaFile() and reused it from both setupRun() and resumeRun().
  • Expanded run tests to verify strict schema generation during setup and schema refresh during resume.

How was this tested

  • Validated the schema-update change by reviewing the affected files and running the full Vitest suite; all tests passed.
  • npm test (vitest run): 21 test files, 191 tests passed.
  • Prettier and ESLint checks passed with no fixes required.

@kunchenguid kunchenguid merged commit 085aef7 into main Apr 2, 2026
1 check passed
@kunchenguid kunchenguid deleted the fix/schema branch April 2, 2026 06:27
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.

1 participant