Conversation
…-gen fallback One-shot commit, PR, branch, and title generation still send the product text-generation slug first. A configured custom model is used only after that attempt reports the model is unavailable. Fixes pingdotgg#12651
Owner
Author
|
Not opening upstream: redo cap reached for pingdotgg#12651. |
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
One-shot text generation (commit, PR, branch, and title) uses the product slug when
textGenerationModelSelectionis unset and the stored instance is disabled. For Claude that slug isclaude-haiku-4-5. A backend that refuses that slug, such as an OpenRouter workspace whose guardrails block Anthropic models, fails the spawn even when the Claude instance has a working custom model.The product slug is still the right default when that model works. Selecting a configured custom model in its place changes commit, PR, branch, and title generation for healthy setups.
Change
fallbackTextGenerationProviderstill writes the product text-generation slug. Settings, and the first one-shot attempt, stay on that slug when a custom model is configured and when the thread default is a custom model.Claude one-shot generation retries once with the instance's first configured custom model only after the product-slug attempt exits non-zero and the CLI output reports that the model is unavailable (guardrail block, unknown model, no matching endpoints, and the same class of failure). A successful product-slug attempt is unchanged. A non-model failure, an explicit non-product model, and an instance with no other custom model do not retry.
Commit, PR, branch, and title generation share
runClaudeJson, so the same rule covers all four.Fixes pingdotgg#12651
Supersedes pingdotgg#14568. That PR selected configured custom models instead of the product slug on the fallback path, which changed the effective product default. This version keeps the product slug whenever that attempt can run.
Scope and approval
pingdotgg#12651 is an accepted server bug. Julius confirmed the fallback sends
claude-haiku-4-5and does not consult the instance's configured custom model: pingdotgg#12651 (comment)The accepted direction is to keep the cheap product slug when it is available, and not to send it when that slug is what the backend refuses. This PR does the second half only after the product attempt reports the model is unavailable, so healthy defaults stay on the product slug.
Verification
From
/workspaceat673296536, Node v24.13.1:Result: 3 files passed, 79 tests passed (4.90s). Coverage includes a healthy product-slug success while a custom model is configured (one spawn, product slug only), a guardrail rejection of
claude-haiku-4-5followed by one retry onz-ai/glm-5.3-flash, a non-model product-slug failure that does not retry, an explicit non-product model that does not retry, and settings resolution that still returns the Claude product slug when a custom model and a custom thread default are configured.Result: exit 0.
Result: exit 0. The only output was two existing
no-inline-schema-compilewarnings inserverSettings.test.tsaround the pre-existing inline schema helpers, not in this diff.Result: finished on the touched files with no further edits.
Limitations
Linux only. The unavailable product slug is attempted once before the custom model, so a broken fallback pays for one failed CLI spawn. The substitute is the first configured custom model on that Claude instance other than the product slug; a built-in thread default is not used. Codex, Cursor, Grok, OpenCode, and Antigravity still send their product slug and do not retry. When the custom-model retry also fails, or when the failure is not a model-unavailable error, the surfaced CLI error still prefers stderr over the stdout API error. A live OpenRouter spawn was not run.
UI Changes
None. This only changes server-side model selection for one-shot commit, PR, branch, and title generation.