You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(server): text generation no longer falls back to a model that cannot generate text - #40699
When the selected text generation provider is unusable, the fallback can run a model whose provider snapshot reports supportsTextGeneration: false. The selected-instance check already treats such a model as unusable; the fallback predicate in TextGeneration.generate checks only the provider. Pi is a fallback driver and marks models outside its text generation inventory this way (packages/provider-pi/src/server/status.ts).
Change
The fallback predicate now applies the same model check as the selected-instance check, so a candidate model that cannot generate text is skipped and the next candidate (for example the same instance's default text generation model) is used. One condition, server only, no contract change.
Scope
A small fix for an obvious bug, so no issue. The gap was recorded as pre-existing in the merged #39870 ("The fallback candidate check uses provider-level text generation capability only and does not reject a candidate whose chosen model reports supportsTextGeneration: false"), raised there by CodeRabbit and left out of that change.
Verification
Added one row, not installed, fallback model cannot generate text, to the existing text generation preflight table in apps/server/src/textGeneration/CodexTextGeneration.test.ts: the primary is not installed and the fallback's thread default model reports supportsTextGeneration: false.
Without the fix, vp test run src/textGeneration/CodexTextGeneration.test.ts -t preflight: 1 failed, 11 passed. The fallback ran the model that cannot generate text instead of the instance's default:
× text generation preflight: not installed, fallback model cannot generate text
- "model": "claude-haiku-5-5",
+ "model": "z-ai/glm-5.3-flash",
With the fix: that file 35 passed, and vp test run src/textGeneration/ 8 files, 113 tests passed.
vp run check:changed upstream/main: format, lint, knip, graphql, typecheck (3 packages) and tests (2 files) all pass.
Not checked: the running app and a real Pi instance with a model outside its text generation inventory.
…not generate text
The fallback predicate checked only the provider, so it could pick a model whose
snapshot reports supportsTextGeneration: false; it now applies the same model check
as the selected instance.
Reviewing files that changed from the base of the PR and between eb6cee8 and ce9062b.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
Fallback provider selection now excludes a candidate when its matching model explicitly disables text generation. A preflight test covers selecting the Claude Agent default text-generation model in that case.
Text generation fallback no longer selects a model that cannot generate text, and the next candidate, such as the default model, is used instead. The change is small and server-only, with a regression test, so merge risk is minimal.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: the server text-generation fallback no longer selects a model that cannot generate text. It follows conventional commit format and matches the summary, the objectives,…
Description check
The description follows the template sections (Problem, Change, Scope, Verification). Problem and Change are clear and specific. Scope justifies the fix as a small bug fix and links the prior PR #3987…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: the server text-generation fallback no longer selects a model that cannot generate text. It follows conventional commit format and matches the summary, the objectives, and the TextGeneration.ts change that rejects candidates whose model reports supportsTextGeneration false.
Full details: Description check
Explanation
The description follows the template sections (Problem, Change, Scope, Verification). Problem and Change are clear and specific. Scope justifies the fix as a small bug fix and links the prior PR #39870 that recorded the gap. Verification gives focused test commands, failing and passing results, and states what was not checked. The template's comment about the agent model and harness is satisfied by the final line. Minor gap: the Scope section does not link a specific issue, but it explains why no issue is needed, which the template allows.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
…provider
Settings resolution can hand text generation the thread default model when
the configured provider is disabled. When that model cannot generate text
and no other provider qualifies, the fallback skipped the whole instance and
kept the unusable model. It now tries other instances first, then the
instance's other models, such as its default text generation model.
Co-Authored-By: Claude Opus 5.5 <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
size:S10-29 changed lines (additions + deletions).takeover:in-progressA takeover lead is working on this PRvouch:unvouchedAuthor is not yet trusted in the VOUCHED list.
2 participants
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
When the selected text generation provider is unusable, the fallback can run a model whose provider snapshot reports
supportsTextGeneration: false. The selected-instance check already treats such a model as unusable; the fallback predicate inTextGeneration.generatechecks only the provider. Pi is a fallback driver and marks models outside its text generation inventory this way (packages/provider-pi/src/server/status.ts).Change
The fallback predicate now applies the same model check as the selected-instance check, so a candidate model that cannot generate text is skipped and the next candidate (for example the same instance's default text generation model) is used. One condition, server only, no contract change.
Scope
A small fix for an obvious bug, so no issue. The gap was recorded as pre-existing in the merged #39870 ("The fallback candidate check uses provider-level text generation capability only and does not reject a candidate whose chosen model reports supportsTextGeneration: false"), raised there by CodeRabbit and left out of that change.
Verification
Added one row,
not installed, fallback model cannot generate text, to the existingtext generation preflighttable inapps/server/src/textGeneration/CodexTextGeneration.test.ts: the primary is not installed and the fallback's thread default model reportssupportsTextGeneration: false.Without the fix,
vp test run src/textGeneration/CodexTextGeneration.test.ts -t preflight: 1 failed, 11 passed. The fallback ran the model that cannot generate text instead of the instance's default:With the fix: that file 35 passed, and
vp test run src/textGeneration/8 files, 113 tests passed.vp run check:changed upstream/main: format, lint, knip, graphql, typecheck (3 packages) and tests (2 files) all pass.Not checked: the running app and a real Pi instance with a model outside its text generation inventory.
Claude Opus 5.5 via T3 Code