Skip to content

Show error message when session auto-naming fails due to disabled small model #9902

@soyllamas

Description

@soyllamas

Summary

When the small model used for session auto-naming (e.g., gpt-5-nano) is disabled in the provider configuration, sessions fail to get auto-named silently without any user feedback. Users are left with "New session - timestamp" titles without understanding why.

Current Behavior

  • OpenCode attempts to use a small model (e.g., gpt-5-nano) for session title generation
  • When the model is disabled in the provider settings, the API returns a 401 error: {"type":"error","error":{"type":"ModelError","message":"Model is disabled"}}
  • The error is logged but no user-facing notification is shown
  • Sessions remain with default timestamp-based names
  • Users have no indication that title generation failed or why

Expected Behavior

When session auto-naming fails due to a disabled model, OpenCode should:

  1. Show a toast notification or error message indicating the issue
  2. Suggest that the user either:
    • Re-enable the model in their provider configuration
    • Configure a different small model for title generation
  3. Optionally, attempt to fall back to another available small model automatically

Steps to Reproduce

  1. Configure OpenCode with OpenCode Zen provider
  2. Disable gpt-5-nano (or whichever model is used for title generation) in your Zen configuration
  3. Create a new session and send a message
  4. Observe that the session remains named "New session - timestamp"
  5. Check logs to see repeated title generation failures

Log Evidence

ERROR service=llm providerID=opencode modelID=gpt-5-nano sessionID=ses_xxx small=true agent=title

error={"error":{"name":"AI_APICallError","statusCode":401,

"responseBody":"{"type":"error","error":{"type":"ModelError","message":"Model is disabled"}}"}}

Environment

  • OpenCode version: 1.1.30
  • Provider: OpenCode Zen
  • OS: macOS 15.7.1

Suggested Solution

Add user-facing error handling for title generation failures:

  • Show a dismissible toast notification when title generation fails
  • Include the specific error reason (e.g., "Model disabled", "API error")
  • Provide actionable guidance (e.g., "Check your provider settings" or "Enable gpt-5-nano")
  • Consider implementing automatic fallback to alternative small models

Related

This is different from #4040 which was specifically about GitHub Copilot filtering out Claude Haiku. This issue is about general error visibility when any small model is unavailable.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions