Conversation
Title generation runs once with the small model and silently fails: any error leaves the session with its default title forever, because ensureTitle only fires when the session has exactly one real user message and never falls back to the main model. - Retry title generation on later messages while the title is still default (drop the single-message guard), so transient failures recover. - Fall back to the session model (small=false) when the small-model request errors, instead of swallowing the failure. - Add TestLLMServer.titleError to simulate title request failures and cover both behaviors in the prompt test suite. Fixes anomalyco#42287, anomalyco#30662
Why this mattersSession title generation is one-shot on the small model; errors leave EvidenceTip
Confirms scope. Happy to help land as-is. Ask (design, light) — prospective
|
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.
Issue for this PR
Closes #42287, #30662
Type of change
What does this PR do?
Session title generation runs once with the small model and silently fails: any error leaves the session with its default
New session - ...title forever.ensureTitleonly fires while the session has exactly one real user message, and the small-model LLM call dies without a fallback (the caller ignores it).This PR makes two changes in
ensureTitle:small: false) when the small-model title request errors, with a warning log.Trigger examples: a small model blocked by provider guardrails/ZDR (reported in #42287), or a reasoning model returning only a
<think>block (#30662).How did you verify your code works?
Added
TestLLMServer.titleErrorto simulate title request failures, plus two tests inpackages/opencode/test/session/prompt.test.ts:bun test test/session/passes (415 pass, 0 fail);bun run typecheckandoxlintpass.Checklist