fix: fall back to harness when .ai() structured output is unsupported - #60
Merged
AbirAbbas merged 1 commit intoJul 29, 2026
Conversation
intake_phase and the coverage gate call router.app.ai(..., schema=...), which requests response_format. Providers that don't support it (e.g. GLM via litellm's zai provider) raise and sink the whole review. Wrap both .ai() calls and fall back to the existing .harness() path on failure. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
intake_phaseand the coverage gate callrouter.app.ai(..., schema=...), which requests structured output (response_format). Providers/harnesses that don't support that parameter raise — e.g. GLM via litellm'szaiprovider raisesUnsupportedParamsError: zai does not support parameters: ['response_format']. Because the intake.ai()call is unguarded, this sinks the entire review, not just the classification step.Fix
Wrap both
.ai()calls and fall back to the existing.harness()path on any failure:intake_phase: on exception, treat the gate as not-confident and fall through to the harness classifier that already exists just below.router.app.harness(...).No behaviour change when
.ai()succeeds — this only adds a fallback for providers that can't do structured output.Testing
A GLM (opencode / Z.ai OpenAI-compatible endpoint) review that previously died at intake with the litellm error now completes and posts.
🤖 Generated with Claude Code