Skip to content

rtk git branch --show-current loop in opencode #732

Open

Description

@technoch1ef

Description

I've experienced these issues using Opencode on 3 different computers. When it tries to check the current branch, it just keeps going in an infinite loop.

  • Opencode v1.2.27
  • Model: Claude Opus 4.6
Image

Activity

  1. added
    bug
    on Apr 12, 2026
  2. pszymkowiak commented on Apr 12, 2026

    @pszymkowiak
    Collaborator

    wshm · Automated triage by AI

    🔍 Automated Triage

    🐛 Category bug
    🟠 Priority high
    🎯 Confidence 85%

    Summary

    RTK rewrites git branch --show-current in a way that triggers an infinite loop in OpenCode; a related PR (#1848) adding an opt-out is already open.


    Triaged automatically by wshm · This is an automated analysis, not a human review.

  3. added
    filter-quality
    on Apr 12, 2026
  4. ipatalas commented on Apr 17, 2026

    @ipatalas

    I have just installed rtk on my opencode 1.4.7 (on Windows 11) and I'm getting similar results for git status command:

    Image

    It figured out it's being intercepted but it's stuck in the loop anyway. Not sure that's the problem with rtk itself. Maybe it's the model taught to interpret plain command outputs. I gave it another try like this:

    Image

    Now it handled that without any loop so maybe the problem is elsewhere.
    I use opencode on Windows 11 and I did rtk init -g --opencode which successfully installed a hook but did not update my %USERPROFILE%\.config\opencode\AGENTS.md so maybe that's the root cause?

  5. bb1 commented on May 12, 2026

    @bb1

    Related: #1848 adds a skill file that teaches agents about RTK_DISABLED=1 to break out of exactly this kind of loop. When the agent detects compressed/unusable output, it can prefix the retry with RTK_DISABLED=1 to get raw output instead of looping indefinitely.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:clibugfilter-qualityneeds-reproductionpriority:high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions