Skip to content

[BUG] Session title generation fails silently since v1.3.3 — effort parameter leaks into small model call #20269

Closed as not planned

Description

@CTHua

Bug Description

Session title generation has been silently failing since v1.3.3. All new sessions retain their default "New session - <timestamp>" title instead of getting an LLM-generated title.

The root cause: when the user's selected model has a variant that includes an effort parameter (e.g. anthropic/claude-opus-4-6 with variant max), that parameter leaks into the LLM.stream call for the title agent. The title agent resolves to a small model (claude-haiku-4-5-20251001) which does not support the effort parameter, causing a 400 error from the Anthropic API. The error is swallowed by Effect.ignore on the fork, so the failure is completely silent.

Reproduction

  1. Set your model to anthropic/claude-opus-4-6 with variant max (or any variant that maps to output_config.effort)
  2. Start a new session and send a message
  3. Observe the session title remains "New session - <timestamp>"

Evidence from logs

INFO  service=llm providerID=anthropic modelID=claude-haiku-4-5-20251001
      sessionID=ses_xxx small=true agent=title mode=primary stream

ERROR service=llm
      requestBodyValues: {
        "model": "claude-haiku-4-5-20251001",
        "output_config": { "effort": "high" },   ← should not be here
        ...
      }
      responseBody: {
        "type": "error",
        "error": {
          "type": "invalid_request_error",
          "message": "This model does not support the effort parameter."
        }
      }

ERROR service=session.prompt
      error=No output generated. Check the stream for errors.
      failed to generate title

Impact data (from local DB)

Version Sessions with title Sessions without title Success rate
1.3.9 0 4 0%
1.3.5 0 3 0%
1.3.3 0 6 0%
1.3.2 29 2 93.5%
1.3.0 40 3 93.0%
1.2.27 42 2 95.5%

Title generation drops to 0% success starting from v1.3.3 for users with an effort-bearing variant.

Root cause

In packages/opencode/src/session/prompt.ts, the ensureTitle function passes user: firstInfo to LLM.stream:

const result = await LLM.stream({
  agent: ag,
  user: firstInfo,   // ← carries variant from user's main model
  // ...
  model: mdl,        // ← this is the small model (haiku)
})

The user message's variant (e.g. max → effort: high) is applied to the API call even though the resolved model (claude-haiku-4-5) doesn't support it.

Suggested fix

Strip or ignore the user variant when calling the title agent's small model. For example:

  • Pass user: { ...firstInfo, variant: undefined } in the title generation call
  • Or have LLM.stream skip unsupported parameters when small: true
  • Or catch the specific error and retry without the variant

Workaround

Override the title agent's model in config to one that isn't affected:

// opencode.json agent config
"title": {
  "model": "google/gemini-3-flash"
}

Environment

  • opencode: v1.3.3 → v1.3.9 (all affected)
  • Provider: anthropic (confirmed), likely affects any provider where variant maps to unsupported model params
  • OS: macOS (arm64)

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 31, 2026
  2. added a commit that references this issue on Mar 31, 2026
    3ea7b6a
  3. rekram1-node commented on Mar 31, 2026

    @rekram1-node
    Collaborator

    can u share opencode debug config, I cant replicate.

    If request is "small" which title gen is, it shouldnt be using the options

  4. anas-asghar4831 commented on Apr 4, 2026

    @anas-asghar4831

    Reproducing this on the web UI with claude-opus-4-6 + max variant. All sessions stuck at "New session - " with no title generation. No errors visible in the web UI — completely silent failure.

    Environment:

    • OpenCode version: latest (web)
    • Model: anthropic/claude-opus-4-6
    • Variant: max
    • Platform: mobile browser (Android, Chrome)

    Switching variant away from max likely works around it, but the effort parameter leak into the title agent's small model call should be guarded regardless.

  5. smrr723 commented on Apr 9, 2026

    @smrr723

    Confirming title generation failures, though my data shows a slightly different pattern.

    Environment:

    • OpenCode version: v1.4.1 (macOS desktop app)
    • Model: gitlab/duo-chat-opus-4-6 (GitLab provider, proxies to Anthropic)
    • Platform: macOS (darwin, arm64)

    Impact data (from local DB at ~/.local/share/opencode/opencode.db):

    Version With title Without title Success rate
    1.2.24 37 0 100%
    1.2.25 14 2 87.5%
    1.2.27 16 1 94.1%
    1.3.0 3 0 100%
    1.3.2 23 3 88.5%
    1.3.3 25 4 86.2%
    1.3.7 9 4 69.2%
    1.3.9 15 0 100%
    1.3.10 23 2 92.0%
    1.3.13 22 0 100%
    1.3.17 25 3 89.3%
    1.4.0 4 10 28.6%
    1.4.1 1 0 100%

    Total: 353 with title, 29 without (92.4% overall).

    The biggest drop is at v1.4.0 (28.6%). Earlier versions show sporadic failures but not the complete 0% reported by others — likely because my provider (GitLab) may handle the effort parameter differently than direct Anthropic.

  6. removed
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  7. skwid138 commented on Jun 3, 2026

    @skwid138

    1.15.13: reasoning_effort: "low" reached a title-generation call and 400'd (GitHub Copilot)

    On 1.15.13, when my configured small_model (openai/gpt-5-mini) returned model_not_found, the title call routed to the session model (small=false agent=gandalf, github-copilot/claude-opus-4.7) and carried reasoning_effort: "low". The API rejected it:

    HTTP 400 invalid_reasoning_effort:
    reasoning_effort "low" is not supported by model claude-opus-4.7; supported values: [medium]
    

    The response reported supported values [medium], so low fails on that path. The error is swallowed (Effect.ignore in session/prompt.ts), so the session silently stays "New session" (more on the swallow in #29734).

    Workaround: set small_model to a model available for my account (openai/gpt-5.4-mini), which avoids the session-model path entirely.

    What I could not confirm: whether the same effort value also reaches the normal small-model path, or only this case where the title call routed to the session model. In mine it was specifically the session-model call (small=false).

    Repro: opencode.jsonc with session model github-copilot/claude-opus-4.7 and small_model set to a model unavailable for your account; start a session and send a prompt; the new session stays "New session" and DEBUG logs show the invalid_reasoning_effort 400. Version 1.15.13.

  8. github-actions commented on Aug 3, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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