fix(opencode): add fallback models for session title generation#29735
fix(opencode): add fallback models for session title generation#29735BenSharir wants to merge 1 commit into
Conversation
When the primary small model fails, iterate through all configured providers' small models before giving up. Replace Effect.ignore at the call site with a warning log so failures are visible. Fixes anomalyco#29734
|
The following comment was made by an LLM, it may be inaccurate: Based on my search results, I found one potentially related PR: PR #27939: feat(session): add configurable fallback model chain This PR appears related because it also addresses fallback model chains for session functionality, which is similar in scope to PR #29735's focus on adding fallback models for session title generation. You may want to review this PR to ensure there's no overlap in approach or existing implementation. The other PRs found (Kiro provider, per-model temperature) are less directly related to the fallback mechanism for session title generation. |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
|
Note on PR #27939: That PR adds a more comprehensive configurable fallback chain for all LLM calls (including title generation). If #27939 is merged first, this PR may become redundant or could be simplified to just the logging change (replacing This PR is a simpler, targeted fix that:
Happy to close this if maintainers prefer to wait for #27939, or keep it as an interim fix. |
|
Correction on PR #27939 overlap: After reviewing the diff, #27939 does NOT fully address this issue:
This PR (#29735) provides:
The two PRs are complementary rather than redundant. This one could land independently or be adapted to work with #27939's infrastructure. |
Issue for this PR
Closes #29734
Type of change
What does this PR do?
When
ensureTitlefails (rate limit, model not found, proxy error), the error was silently swallowed viaEffect.ignore. This made title generation failures impossible to diagnose.Changes:
generateTitlehelper (reused for primary + fallbacks)Effect.ignorewithEffect.catchCause+ warning logThe fallback works because
provider.list()returns all configured providers, andgetSmallModel()returns each provider's best small model. If one provider's model is down/exhausted, another provider's model can generate the title.How did you verify your code works?
bun typecheckpasses (0 errors in prompt.ts)Screenshots / recordings
N/A - no UI changes
Checklist