Skip to content

small_model ignored for title agent + FreeUsageLimitError retry loop blocks session for ~90s #31042

Closed as not planned

Description

@daniel-morales-dev

Description

Bug

The small_model config is completely ignored for the session title generator agent.
No matter what model is configured, opencode always uses opencode/deepseek-v4-flash-free
for title generation.

Expected

Title agent should use the model configured in small_model.

Actual

INFO service=llm modelID=deepseek-v4-flash-free small=true agent=title

small_model is ignored. Tested with opencode/deepseek-v4-flash and opencode/kimi-k2.6 — same result.

Impact

When the free tier quota is exhausted, the title agent enters an infinite retry loop
(isRetryable: true on 429 FreeUsageLimitError) that delays every session response
by 1-2 minutes, even when the main model (e.g. deepseek-v4-flash) is working fine.

Root cause (observed)

Two separate bugs compound each other:

  1. small_model is hardcoded to deepseek-v4-flash-free for the title agent —
    the config value is read but never applied to agent=title.

  2. FreeUsageLimitError (HTTP 429) is marked isRetryable: true, causing the
    title agent to retry 3 times with backoff (~90s total) before giving up.

  3. The title agent and the main model share the same session thread — the main
    model cannot respond until the title agent finishes its retry loop.

Net result: every first message in a session is delayed ~90 seconds with no
visible error shown to the user.

Logs

INFO  service=llm modelID=deepseek-v4-flash-free small=true agent=title  ← ignores small_model
INFO  service=llm modelID=kimi-k2.6 small=false agent=plan               ← main model blocked
ERROR +89857ms AI_RetryError maxRetriesExceeded model=deepseek-v4-flash-free statusCode=429
      FreeUsageLimitError retry-after=464s isRetryable=true
INFO  +50334ms session step=1 exiting loop                                ← main model responds after 90s

Additional finding

Even after the free tier quota resets, response times remain 2+ minutes.
Confirmed with kimi-k2.6 as main model (135s response, no rate limit errors).

The plan agent also appears to ignore agent model config in some sessions,
falling back to deepseek-v4-flash-free instead of the configured model.

Server-side EIO: i/o error, write exceptions observed in logs, suggesting
instability on the opencode.ai/zen/v1 backend post-1.16.0 release.

Logs

==> /home/dmorales/.local/share/opencode/log/2026-06-05T234953.log <==
INFO  2026-06-05T23:49:55 +0ms service=tui.plugin id=internal:sidebar-lsp loading internal tui plugin
INFO  2026-06-05T23:49:55 +0ms service=tui.plugin id=internal:sidebar-todo loading internal tui plugin
INFO  2026-06-05T23:49:55 +0ms service=tui.plugin id=internal:sidebar-files loading internal tui plugin
INFO  2026-06-05T23:49:55 +0ms service=tui.plugin id=internal:sidebar-footer loading internal tui plugin
INFO  2026-06-05T23:49:55 +0ms service=tui.plugin id=internal:notifications loading internal tui plugin
INFO  2026-06-05T23:49:55 +0ms service=tui.plugin id=internal:plugin-manager loading internal tui plugin
INFO  2026-06-05T23:49:55 +0ms service=tui.plugin id=which-key loading internal tui plugin
INFO  2026-06-05T23:49:55 +0ms service=tui.plugin id=diff-viewer loading internal tui plugin
INFO  2026-06-05T23:49:55 +1ms service=tui.plugin path=opencode-subagent-statusline retry=false loading tui plugin
INFO  2026-06-05T23:49:55 +1ms service=tui.plugin path=opencode-sdd-engram-manage retry=false loading tui plugin

==> /home/dmorales/.local/share/opencode/log/2026-06-05T234954.log <==
INFO  2026-06-05T23:58:41 +0ms service=tool.registry status=started delegation_list
INFO  2026-06-05T23:58:41 +0ms service=tool.registry status=completed duration=0 delegation_list
INFO  2026-06-05T23:58:41 +2ms service=session.tools status=completed duration=7 resolveTools
INFO  2026-06-05T23:58:41 +15ms service=llm providerID=opencode modelID=deepseek-v4-flash-free session.id=ses_165c67a1bffeTg0N51T0XIH6yR small=true agent=title mode=primary stream
INFO  2026-06-05T23:58:41 +0ms service=session.processor session.id=ses_165c67a1bffeTg0N51T0XIH6yR messageID=msg_e9a398612002x2AhopnYYKEfs9 process
INFO  2026-06-05T23:58:41 +1ms service=llm providerID=opencode modelID=deepseek-v4-flash-free session.id=ses_165c67a1bffeTg0N51T0XIH6yR small=false agent=plan mode=primary stream
INFO  2026-06-05T23:58:41 +1ms service=default llm.runtime=ai-sdk llm.provider=opencode llm.model=deepseek-v4-flash-free llm runtime selected
INFO  2026-06-05T23:58:41 +10ms service=default llm.runtime=ai-sdk llm.provider=opencode llm.model=deepseek-v4-flash-free llm runtime selected
INFO  2026-06-06T00:00:59 +138116ms service=session.prompt session.id=ses_165c67a1bffeTg0N51T0XIH6yR step=1 loop
INFO  2026-06-06T00:00:59 +2ms service=session.prompt session.id=ses_165c67a1bffeTg0N51T0XIH6yR exiting loop

==> /home/dmorales/.local/share/opencode/log/2026-06-05T235440.log <==
INFO  2026-06-05T23:54:45 +0ms service=provider providerID=opencode pkg=@ai-sdk/openai-compatible using bundled provider
INFO  2026-06-05T23:54:45 +4ms service=provider status=completed duration=4 providerID=opencode getSDK
INFO  2026-06-05T23:54:45 +26ms service=default llm.runtime=ai-sdk llm.provider=opencode llm.model=kimi-k2.6 llm runtime selected
INFO  2026-06-05T23:54:45 +55ms service=session.processor session.id=ses_165ca144fffeqJgWJH6IlD6Du7 messageID=msg_e9a35ebe4001b0Vf9XvTvy1zFW process
INFO  2026-06-05T23:54:45 +2ms service=llm providerID=opencode modelID=kimi-k2.6 session.id=ses_165ca144fffeqJgWJH6IlD6Du7 small=false agent=plan mode=primary stream
INFO  2026-06-05T23:54:45 +7ms service=default llm.runtime=ai-sdk llm.provider=opencode llm.model=kimi-k2.6 llm runtime selected
INFO  2026-06-05T23:57:01 +135477ms service=session.prompt session.id=ses_165ca144fffeqJgWJH6IlD6Du7 step=1 loop
INFO  2026-06-05T23:57:01 +2ms service=session.prompt session.id=ses_165ca144fffeqJgWJH6IlD6Du7 exiting loop
INFO  2026-06-05T23:59:49 +168021ms service=default worker shutting down
ERROR 2026-06-05T23:59:49 +307929ms service=default e=EIO: i/o error, write exception

Plugins

No response

OpenCode version

1.16.2

Steps to reproduce

  1. Set small_model to any model other than deepseek-v4-flash-free:
   { "small_model": "opencode/kimi-k2.6" }
  1. Exhaust the free tier quota (or simply have it at zero)
  2. Start a new session and send any message
  3. Observe: title agent still uses deepseek-v4-flash-free regardless of config

Screenshot and/or share link

Image Image Image

Operating System

Ubuntu 24.04

Terminal

Warp and Native terminal

Activity

  1. github-actions commented on Jun 6, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    If your issue is distinct from those (e.g. the FreeUsageLimitError retry loop blocking the main model is a separate compounding factor), please add a note clarifying the difference so maintainers can track it appropriately.

  2. daniel-morales-dev commented on Jun 6, 2026

    @daniel-morales-dev
    Author

    This issue might be a duplicate of existing issues. Please check:

    If your issue is distinct from those (e.g. the FreeUsageLimitError retry loop blocking the main model is a separate compounding factor), please add a note clarifying the difference so maintainers can track it appropriately.

    Clarification re: potential duplicates
    After reviewing the referenced issues:
    #30662 — Related but distinct. That issue is about smallOptions() missing provider config for opencode models, causing silent failure. My issue is about small_model config being ignored entirely — the title agent always uses deepseek-v4-flash-free regardless of what’s configured, even when the model would otherwise work.
    #26658 — Different root cause. In that issue the main model call never executes at all (deadlock). In my case, the main model does execute, but only after the title agent exhausts its FreeUsageLimitError retry loop (~90s backoff). The session eventually responds — just with a 90-second delay before the first token.
    #29734 — Closest overlap. My issue adds two things that #29734 doesn’t cover: (1) the reason title generation fails is that small_model config is hardcoded away — not just that it can fail, and (2) the failure mode isn’t just a silent ignore — it’s an active ~90s block on the main model because FreeUsageLimitError is marked isRetryable: true and the title agent retries 3× with backoff before Effect.ignore kicks in. That retry window is what blocks the session thread.
    The compounding factor specific to my report: title agent + main model share the same session thread, so the 90s retry loop visibly delays every first response even when the main model has zero issues.

    Additionally, even after the free quota reset (no more 429s), response times remain ~135s with kimi-k2.6 as the main model and no errors in logs. This confirms the 2-minute delay has a second independent cause beyond the retry loop: server-side latency on opencode.ai/zen/v1 post-1.16.0 release, evidenced by EIO: i/o error, write exceptions in the worker logs. The title agent bug and the server load are compounding separately.

    The server-side lag predates 1.16.0 — I was already seeing 2+ minute response times on 1.15.x starting Thursday June 4, before updating. This suggests the latency is load-related rather than a regression in 1.16.

  3. lexlian commented on Jun 6, 2026

    @lexlian

    I fixed the issue with PR #31092.

    Two compounding bugs caused the symptoms. (1) getSmallModel silently fell back to your main model when the configured small_model wasn't in the provider catalog — now it logs a WARN so you know your config was ignored. (2) smallOptions in transform.ts was missing opencode provider handling, so the title agent's LLM call was sent without the required include and reasoningSummary options, causing the opencode API to fail and triggering the ~90s retry loop on free-tier quota exhaustion. Added the same opencode handling that options() already had, scoped to the small-model call path.

  4. fede-ciliberti commented on Jun 6, 2026

    @fede-ciliberti

    +1, also hitting this on the latest stable — small_model config gets ignored, then the title agent hammers free-tier quota for ~90s before the main model finally responds. Looking forward to #31092.

  5. github-actions commented on Aug 6, 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