Skip to content

Copilot CLI Infinite Loop on Empty bash Tool Call #1444

Done

Description

@leonard520

Describe the bug

The Copilot CLI gets stuck when invoking a bash command with empty arguments. The command is invalid and results in an error, but instead of stopping, it repeatedly issues the same tool call over 5000 times until the process is eventually killed.
Specifically, the model keeps generating the following tool call with empty arguments:

{
  "choices": [
    {
      "finish_reason": "length",
      "message": {
        "role": "assistant",
        "tool_calls": [
          {
            "function": {
              "arguments": "{}",
              "name": "bash"
            },
            "id": "toolu_vrtx_01X5EZSmMahBSaU8p21MvQH8",
            "type": "function"
          }
        ]
      }
    }
  ],
  "created": 1770869340,
  "id": "msg_vrtx_012HHnioZgNQg77QVLyuDMJ8",
  "usage": {
    "completion_tokens": 16000,
    "prompt_tokens": 32127,
    "prompt_tokens_details": {
      "cached_tokens": 31973
    },
    "total_tokens": 48127
  },
  "model": "claude-sonnet-4.5"
}

Let me know if you want more information.

Affected version

0.0.407-1

Steps to reproduce the behavior

No response

Expected behavior

If the tool call is failure, shall llm correct it?

Additional context

No response

Activity

  1. added theissue type on Feb 13, 2026
  2. leonard520 commented on Feb 24, 2026

    @leonard520
    Author

    kindly ping on this issue, any help is welcome.

  3. added
    area:toolsBuilt-in tools: file editing, shell, search, LSP, git, and tool call behavior
    on Apr 6, 2026
  4. MRayermannMSFT commented on Apr 7, 2026

    @MRayermannMSFT

    Thanks @leonard520 , I can reproduce this issue. Looking into a fix!

  5. copilot-cli-bot commented on Nov 21, 2026

    @copilot-cli-bot

    This appears to be resolved as of GitHub Copilot CLI v1.0.114. Please update to that release or a newer stable version. We're closing this as completed. If it still happens, please comment with your version and reproduction steps.

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

Metadata

Metadata

Labels

area:toolsBuilt-in tools: file editing, shell, search, LSP, git, and tool call behavior

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions