Skip to content

xAI Grok 4.5 generating useless bash true tool calls #37399

Description

@berenddeboer

Description

Seeing this:

User chose 1 but didn't pick A or B. They said "1" only. I should clarify A vs B, or assume they want 1 and ask about A/B.
$ true
(no output)
Thought: 3ms
Just ask the follow-up.
$ true
(no output)
Thought: 4ms
I need to just output text without tool calls.
$ true
(no output)
Thought: 267ms
There seems to be a bug where I keep generating bash. Let me try a different approach - just pure text response without any tool calls at all.

Screenshot:

Image

Plugins

No response

OpenCode version

1.18.3

Steps to reproduce

I think it only happens with xAI Grok.

Screenshot and/or share link

No response

Operating System

Omarchy

Terminal

Alacritty/tmux

Activity

github-actions commented on Jul 16, 2026

@github-actions
Contributor

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

rekram1-node commented on Jul 17, 2026

@rekram1-node
Collaborator

can u share a session?

berenddeboer commented on Jul 17, 2026

@berenddeboer
Author

can u share a session?

See here: https://opncd.ai/share/TVclnOCU

berenddeboer commented on Jul 17, 2026

@berenddeboer
Author

@rekram1-node another one, just now, much shorter: https://opncd.ai/share/Y6IxNeMe

berenddeboer commented on Jul 25, 2026

@berenddeboer
Author

@rekram1-node haven't seen this for a while now.

dakotad74 commented on Aug 27, 2026

@dakotad74

Also hitting this with Kimi k3 (kimi-for-coding provider, "max" variant) on opencode 1.18.23 — 132 degenerate bash {"command": "true"} calls across 6 sessions over 2 days (2026-08-26/27).

Same signature as reported here:

  • The model's reasoning is fully aware of the misfire but can't break it: "OK something is wrong with my tool invocation — I keep sending bash true. Let me consciously invoke the skill tool with name 'brainstorming'" → emits bash true again.
  • Selective failure: it collapses when trying to invoke non-bash tools (skill, MCP engram_mem_save, task / subagents). Plain bash and question calls work fine in the same sessions.
  • Context at failure points: 68k–148k tokens.
  • doom_loop never prompted in these sessions. The detector (packages/opencode/src/session/processor.ts:353) only inspects parts of the current assistant message, and the model emits exactly one true per message — so this is exactly the case PR fix(processor): detect doom loops across messages instead of within current message #32089 fixes. Also affected by the second bug described there: reasoning parts interleaved between tool calls make slice(-3).every(...) pass silently.

I have full message/part dumps from opencode.db (session IDs, token counts, reasoning traces) if useful for repro.

Workaround that works for us: ESC to abort, then /compact or a fresh session — typing "continue" re-seeds the loop.

berenddeboer commented on Aug 27, 2026

@berenddeboer
Author

I haven't seen this in ages anymore btw.

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