Repository navigation
feat(gateway): add opt-in output schema validation - #36
Conversation
Validate non-streaming managed results against a caller-supplied JSON schema behind OUTPUT_SCHEMA_VALIDATION_ENABLED (default off). Invalid results return 502 output_schema_violation with bounded, content-free paths; no regeneration or repair.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
multillm-proxy | 26d55ea | Oct 08 2026, 10:56 PM |
4c24921
into
integrate/gateway-waves-1-3
Summary
Adds explicit output schema validation behind
OUTPUT_SCHEMA_VALIDATION_ENABLED, which defaults to false. While the flag is off, themultillm_output_validationrequest option is neither read nor removed, and every request and response is unchanged.multillm_output_validation: {"mode": "strict", "schema": {...}}.output_schema_violation.output_validation_requires_nonstreambefore dispatch.$ref;Details are in
docs/output-schema-validation.md.Integration
The Wave 4 integration PR attaches
with_managed_output_validationto the unified Chat and protocol dispatchers inroutes/unified.py. Until then, the validator is inert even with the flag on.Shared registrations
OUTPUT_SCHEMA_VALIDATION_ENABLEDto the Container env keys.Tests
tests/test_output_schema_validation.py: new. It covers Chat, translated and native Messages/Responses with the hook attached.npm run test:worker: 1,318 passed.cf:migrations:check,test:deploy, free routes, client headers and thewrangler deploy --dry-runbundle all pass.tests/test_frontend_build.mjsfails locally because@tailwindcss/cliis not installed. It fails the same way on main.This is part of Wave 4. It is based on
integrate/gateway-waves-1-3, and the Wave 4 integration PR adds the README line.