Skip to content

Review adapter falls back when a provider rejects response_format - #11

Merged
welsbach merged 3 commits into
mainfrom
fix-review-adapter-response-format
Jul 24, 2026
Merged

welsbach merged 3 commits into
mainfrom
fix-review-adapter-response-format

Conversation

@asdd-agent

@asdd-agent asdd-agent Bot commented Jul 24, 2026

Copy link
Copy Markdown

Summary

Some OpenAI-compatible providers return HTTP 500 on response_format: {type: json_object} (seen with a GLM reasoning model on Runware). The review adapter sent that parameter on every attempt, so the model lenses produced no output and the review failed closed even though the connection, model, and key were fine. The adapter now asks for response_format on the first attempt and drops it on retry, leaning on the system prompt (which already demands JSON only) and the tolerant extractor; a provider that accepts the parameter still gets it on the first, cheapest try. It also logs the raw error body on a persistent failure so the cause is named rather than blind.

Disclosure (required - ASDD)

  • Entirely human-authored
  • Authored or co-authored by an AI agent under human direction

Agent identity: asdd-agent
Instructed by (human handle): welsbach

Checklist

  • Exactly one lane label (chore)
  • Signed off (git commit -s)
  • Test: a provider that 500s on response_format still yields a review via the retry

Some OpenAI-compatible providers return HTTP 500 on response_format:
{type: json_object} (seen with a GLM reasoning model on Runware), so the
model review lenses produced no output and the review failed closed even
though the connection was fine. The adapter now sends response_format on the
first attempt and drops it on retry, leaning on the system prompt and the
extractor; it also logs the raw error body on a persistent failure so the
cause is named. Test: a provider that 500s on response_format still yields a
review via the retry.

Signed-off-by: Christoph <awchristoph@gmail.com>
@asdd-agent
asdd-agent Bot requested a review from welsbach as a code owner July 24, 2026 14:10
@welsbach welsbach added the chore label Jul 24, 2026
@github-actions

Copy link
Copy Markdown

ASDD review - advisory (recommendation: comment)

Produced by an automated agent under human direction. Advisory only: a human approves and merges.
Nothing here merges automatically.

The review runtime returned invalid output; a human should review manually. Security scan (deterministic + SAST): 2 finding(s). Impact scan: 1 finding(s), 0 block.

SECURITY - concerns

  • warn: Text resembling a prompt-injection instruction in the contribution.
  • warn: Text resembling a prompt-injection instruction in the contribution.

IMPACT - concerns

  • warn: This change touches a behavioural surface (a gate, lens, agent prompt, or the runtime seam: .github/asdd/runtime/openai-compat.sh, .github/asdd/runtime/openai-compat.test.sh). If it changes behaviour adopters rely on for conformance, it is normative: declare it and add an impact analysis and target version. If it preserves behaviour, no action.

Generated by the ASDD advisory review. Mode: live.

Christoph added 2 commits July 24, 2026 17:25
A reasoning model reasons at length and can exceed a hosted inference window
on a real code diff, so the review times out and posts no lenses while trivial
diffs pass and look fine (observed live: a GLM reviewer 500s on a real diff).
doctor and setup now flag a reasoning reviewer by name and point to a faster
one. It is a property of the model, not the host, so it warns regardless of
provider. WARN, never a block.

Signed-off-by: Christoph <awchristoph@gmail.com>
The model call had a hardcoded 180s timeout, so a reasoning reviewer that
hangs burned the full server timeout on every retry before failing closed.
Add a configurable per-call timeout (review.timeout_seconds / ASDD_MODEL_TIMEOUT,
default 45s) above a fast reviewer's real-diff time and below a reasoning
model's server-side hang, and on a timeout emit an actionable message naming
the cause. run-review maps review.timeout_seconds to the adapter.

Signed-off-by: Christoph <awchristoph@gmail.com>
@github-actions

Copy link
Copy Markdown

ASDD review - advisory (recommendation: comment)

Produced by an automated agent under human direction. Advisory only: a human approves and merges.
Nothing here merges automatically.

The review runtime returned invalid output; a human should review manually. Security scan (deterministic + SAST): 2 finding(s). Impact scan: 1 finding(s), 0 block.

SECURITY - concerns

  • warn: Text resembling a prompt-injection instruction in the contribution.
  • warn: Text resembling a prompt-injection instruction in the contribution.

IMPACT - concerns

  • warn: This change touches a behavioural surface (a gate, lens, agent prompt, or the runtime seam: .github/asdd/run-review.sh, .github/asdd/runtime/openai-compat.sh, .github/asdd/runtime/openai-compat.test.sh, cli/doctor.py, cli/doctor.test.sh). If it changes behaviour adopters rely on for conformance, it is normative: declare it and add an impact analysis and target version. If it preserves behaviour, no action.

Generated by the ASDD advisory review. Mode: live.

@welsbach welsbach left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check

@welsbach
welsbach merged commit bdbd2da into main Jul 24, 2026
7 checks passed
@welsbach
welsbach deleted the fix-review-adapter-response-format branch July 30, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant