fix(claude): omit --model in completeOneShot when alias resolves empty#3
Open
Antisophy wants to merge 1 commit into
Open
fix(claude): omit --model in completeOneShot when alias resolves empty#3Antisophy wants to merge 1 commit into
Antisophy wants to merge 1 commit into
Conversation
the session spawn path guards with config.model.length > 0, letting an
empty model_aliases entry suppress the flag so claude falls back to its
own configured default; completeOneShot (used for title generation)
passed --model unconditionally, so an empty alias produced
`claude --model ""` which fails with API Error 400 ("String should
have at least 1 character") and surfaced as "failed to generate title:
claude exited with status 1"
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
completeOneShot(title generation) passes--model resolveModelAlias(modelClass)unconditionally. An emptymodel_aliasesentry makesresolveModelAliasreturn"", so it runsclaude --model ""and fails withAPI Error 400("String should have at least 1 character"), surfacing asfailed to generate title: claude exited with status 1. The session-spawn path already guards this (config.model.length > 0);completeOneShotis the one spot that doesn't.Motivation
After Fable 5 was shut down I wanted cydo to stop pinning a model and instead defer to
claude's own configured default, so it would fall back gracefully rather than stay pointed at an unavailable model. The way to express that is emptymodel_aliasesentries, but that config wasn't actually runnable:completeOneShotpassed--model ""and broke title generation on the next cydo task I started. This PR's change is what makes the empty-alias / defer-to-claude config work end to end.Fix
Append
--modelonly when the resolved model is non-empty (matching the session-spawn guard), and collapse the duplicatedcmdPrefix/ non-cmdPrefixarg lists into one.