Skip to content

Conversation

@bokelley
Copy link
Contributor

@bokelley bokelley commented Jan 4, 2026

Summary

Fixes validation errors when test agents return empty publisher_domains arrays. The upstream JSON Schema defines minItems: 1, but real-world agents return empty arrays when not authorized for any publishers.

Changes

  • Added shared schema-utils.ts utility to eliminate code duplication
  • Modified generate-types.ts to remove minItems constraints during TypeScript generation
  • Modified generate-zod-from-ts.ts to convert tuple patterns to arrays in Zod schemas
  • Added comprehensive tests including edge case validation for invalid element types

Test Plan

  • ✅ All 45 existing tests pass
  • ✅ New test validates empty arrays are accepted
  • ✅ New test validates non-empty arrays still work
  • ✅ New test validates type validation still catches invalid elements

bokelley and others added 2 commits January 4, 2026 14:02
… response

The JSON Schema defines minItems: 1 for publisher_domains, but real-world agents
often return empty arrays when not authorized for any publishers. This fix removes
minItems constraints during code generation, allowing empty arrays while maintaining
type validation.

Also refactored removeMinItemsConstraints() to a shared utility module to eliminate
duplication, and added comprehensive tests including edge case validation.

🤖 Generated with Claude Code

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
🤖 Generated with Claude Code

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@bokelley bokelley merged commit fb041b6 into main Jan 4, 2026
9 checks passed
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.

2 participants