gemini-cli - 💡(How to fix) Fix bug(core): `tools.callCommand` still treats shell command as literal executable path [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

tools.callCommand is documented as a custom shell command, but discovered tool execution still treats the configured string as a literal executable path. As a result, common configurations like python3 script.py --call can discover tools successfully and then fail at execution time with ENOENT.

This is effectively a re-report of #19783 with fresh confirmation on current main, because that issue was auto-closed as stale and the behavior still appears unresolved.

Root Cause

This is effectively a re-report of #19783 with fresh confirmation on current main, because that issue was auto-closed as stale and the behavior still appears unresolved.

Fix Action

Fixed

Code Example

{
  "tools": {
    "discoveryCommand": "python3 script.py --discover",
    "callCommand": "python3 script.py --call"
  }
}
RAW_BUFFERClick to expand / collapse

Summary

tools.callCommand is documented as a custom shell command, but discovered tool execution still treats the configured string as a literal executable path. As a result, common configurations like python3 script.py --call can discover tools successfully and then fail at execution time with ENOENT.

This is effectively a re-report of #19783 with fresh confirmation on current main, because that issue was auto-closed as stale and the behavior still appears unresolved.

Current evidence

At commit a00d03efc62de08274619cf7da96569ae51ecbf3:

Reproduction

Configure custom tools like this:

{
  "tools": {
    "discoveryCommand": "python3 script.py --discover",
    "callCommand": "python3 script.py --call"
  }
}

Expected:

  • discovery works
  • execution invokes python3 with script.py --call <toolName>

Actual:

  • discovery works
  • execution can fail because callCommand is treated as a literal executable path instead of a parsed command with arguments

Why this is likely still a bug

There is already prior history pointing at the same root cause:

  • #19783 reported the inconsistency between discoveryCommand and callCommand
  • PR #19935 proposed parsing callCommand with shell-quote to match discovery, but it was closed without merging

The current code still appears to match the pre-fix behavior.

Possible fix

Parse tools.callCommand consistently with tools.discoveryCommand, then append the discovered tool name to the parsed argv before spawning the subprocess.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

gemini-cli - 💡(How to fix) Fix bug(core): `tools.callCommand` still treats shell command as literal executable path [1 pull requests]