Skip to content

fix: fall back to harness when .ai() structured output is unsupported - #60

Merged
AbirAbbas merged 1 commit into
Agent-Field:mainfrom
jainakshay93:fix/glm-ai-structured-output-fallback
Jul 29, 2026
Merged

fix: fall back to harness when .ai() structured output is unsupported#60
AbirAbbas merged 1 commit into
Agent-Field:mainfrom
jainakshay93:fix/glm-ai-structured-output-fallback

Conversation

@jainakshay93

Copy link
Copy Markdown
Contributor

Problem

intake_phase and the coverage gate call router.app.ai(..., schema=...), which requests structured output (response_format). Providers/harnesses that don't support that parameter raise — e.g. GLM via litellm's zai provider raises UnsupportedParamsError: 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.
  • coverage gate: on exception, run the same prompt via 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

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>
@AbirAbbas
AbirAbbas merged commit 3c8eca9 into Agent-Field:main Jul 29, 2026
3 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