Skip to content

gemini: -- separator in build_args breaks all prompts (rc=42) #219

@nathanschram

Description

Description

The -- argument separator fix (#194) placed -- before -p in Gemini's build_args(), causing -p to be treated as a positional argument instead of the prompt flag. Every Gemini prompt fails with exit code 42 ("No input provided via stdin").

Impact

All Gemini prompts broken since the -- fix was added in rc11. The runner constructs: gemini ... -- -p <prompt> but POSIX -- means "end of options" so -p is never parsed as a flag.

Reproduction

# Broken (rc11):
gemini --output-format stream-json --approval-mode yolo -- -p "echo hello"
# → "No input provided via stdin" (rc=42)

# Working fix:
gemini --output-format stream-json --approval-mode yolo --prompt="echo hello"
# → Success

Fix

Changed build_args() in runners/gemini.py line 349 from:

args.append("--")
args.extend(["-p", prompt])

to:

args.append(f"--prompt={prompt}")

The --prompt=<value> syntax binds the value directly to the flag, preventing yargs from interpreting a dash-prefixed prompt as a separate flag while keeping -p functional.

Affected files

  • src/untether/runners/gemini.py (line 349)
  • tests/test_build_args.py (test updated)

Version

v0.35.0rc11

Verified

  • Unit tests pass (40/40 in test_build_args.py)
  • Integration test: dash-prefixed prompt -help me list files returns correct response
  • CLI args in logs show --prompt=... syntax

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions