Skip to content

Commit 8d2017d

Browse files
mateo-diclaude
andcommitted
fix(session): catch ensureTitle errors to prevent silent failure
ensureTitle() is called fire-and-forget on the first user message to generate a session title. If small_model is misconfigured (e.g., invalid model ID or unavailable provider), the resulting ProviderModelNotFoundError becomes an unhandled promise rejection. The session silently keeps its default title ('New session - ...') with no user-visible error. Add .catch() at the call site to log the error instead of silently swallowing it. Fixes anomalyco#14807 Co-authored-by: Claude <[email protected]>
1 parent f54abe5 commit 8d2017d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎packages/opencode/src/session/prompt.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ export namespace SessionPrompt {
334334
modelID: lastUser.model.modelID,
335335
providerID: lastUser.model.providerID,
336336
history: msgs,
337-
})
337+
}).catch((err) => log.error("failed to generate session title", { error: err }))
338338

339339
const model = await Provider.getModel(lastUser.model.providerID, lastUser.model.modelID).catch((e) => {
340340
if (Provider.ModelNotFoundError.isInstance(e)) {

0 commit comments

Comments
 (0)