Skip to content

fix(generation): strip Gemini schema state-explosion keywords, raise timeout to 12s, and default to gemini-3.5-flash-lite - #87

Merged
SHcommit merged 1 commit into
developfrom
fix/gemini-schema-and-timeout
Nov 19, 2026
Merged

SHcommit merged 1 commit into
developfrom
fix/gemini-schema-and-timeout

Conversation

@SHcommit

Copy link
Copy Markdown
Member

Summary

  • Strip JSON Schema keywords (pattern, minLength, maxLength, minItems, maxItems, uniqueItems, title, description) from responseJsonSchema sent to Gemini in EvidenceGenerator.generate() so Gemini API accepts the schema without INVALID_ARGUMENT: The specified schema produces a constraint that has too many states for serving. Full regex/length/bounds enforcement remains intact post-response via ModelProposal.model_validate() and validate_output().
  • Increase ProductionEvidenceGenerator default timeout_seconds from 2.5 to 12.0 to accommodate gemini-3.5-flash-lite latency (2.8–5.5s warm, ~9.8s cold) within Spring's 15s AI request timeout and 20s run deadline.
  • Reuse the application httpx.AsyncClient in HttpxGeminiTransport(http_client) and update default fallback ONMARU_GEMINI_MODEL_NAME from obsolete gemini-2.5-flash to gemini-3.5-flash-lite.

Verification

  • uv run pytest: 1101 passed, 43 skipped
  • uv run ruff check src tests scripts: passed
  • uv run mypy: no issues found in 170 source files
  • bash scripts/test/run-ai-evals.test.sh and run-ai-evals held-out schema comparison: passed

…timeout to 12s, and default to gemini-3.5-flash-lite
@SHcommit
SHcommit merged commit b69826a into develop Nov 19, 2026
2 checks passed
@SHcommit
SHcommit deleted the fix/gemini-schema-and-timeout branch November 19, 2026 02:36
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