Skip to content

agent: skill tool loops on invalid id instead of falling back #61198

Closed as duplicate

Description

@RoboXGamer

Summary

When a user asks which skills are available, the agent attempts to load a skill with id general, which is not a valid skill id (valid ids: caveman, leanrea, opencode, report). The call fails with "Unable to load skill general", and instead of falling back to the skill list already present in context, the agent re-issues the identical failing call ~22 times in a row, never recovering. This is an agent-loop / tool-retry failure: a deterministic error result does not terminate the loop or trigger a fallback.

Environment

  • opencode version: 2.2.5
  • OS: Windows 11 (Windows_NT 10.0.26300, win32 x64)
  • Terminal: TERM=xterm-256color (TERM_PROGRAM unset)
  • Shell: Git Bash (C:\Program Files\Git\usr\bin\bash.exe); ComSpec cmd.exe
  • Install/channel: latest
  • Model: ollama/lfm3-omni:2b (LFM3 Omni 2B, 32k context) — local via ollama
  • Active plugins: none found in config (MCP server convex configured; no plugins)

Reproduction

  1. Configure and select the local model ollama/lfm3-omni:2b (LFM3 Omni 2B).
  2. Start an opencode session with that model.
  3. Ask: "what skills you have".
  4. Observe the agent call skill with {"id": "general"}.
  5. The tool returns Unable to load skill general.
  6. The agent repeats the identical call many times (~22) instead of answering from context or stopping.

Expected Behavior

The agent should not call skill with an id not present in the available-skills list. On a deterministic skill-load failure, the loop should terminate and fall back to the in-context skill list (or a text answer), rather than retrying the same failing call.

Actual Behavior

Repeated skill tool calls with id: "general", each returning Unable to load skill general, forming a retry storm until the session ends. No useful answer is produced.

Additional Context

  • The string general corresponds to an agent/subagent type, not a skill id; this likely caused the confusion.
  • The available skills were already enumerated in the system context, so no tool call was necessary.
  • Session export attached by user (session-02cfc45e-de13-4e23-a741-81dedf339c3c.md).
  • Repro frequency: observed once from this session, specifically while using ollama/lfm3-omni:2b. Likely more common with small/local models that confuse agent vs. skill namespaces; not confirmed on larger models.
  • Workaround: user must interrupt the session; no in-app recovery observed.

Activity

  1. opencodejr commented on Nov 2, 2026

    @opencodejr
    Contributor

    Thanks for the detailed report and session export, @RoboXGamer!

    I think this is a duplicate of #59339. In v2, the doom_loop permission is still accepted in config but nothing currently triggers it. So when a model keeps re-issuing the same tool call with the same input, as happened here with skill and {"id": "general"}, nothing stops the loop.

    Possible duplicates and closely related issues, ordered by likelihood:

    There's also an open PR, #53032, which aims to stop repeated tool-call loops.

    The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.

  2. opencodejr commented on Nov 3, 2026

    @opencodejr
    Contributor

    Closing this as a duplicate of #59339. We left it open for a day in case it turned out to be a different problem, and there's been no reply since.

    The repeated skill calls with {"id": "general"} happen because v2 has no repeated-tool-call (doom_loop) detection yet, and that's what #59339 tracks. Please follow it there, along with the open PR #53032. The mix-up between the general agent and a skill id is tracked in #46568.

    Thanks again for the report, @RoboXGamer. If you think this is a different problem, reply here and we can reopen it.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions