Skip to content

Five agents pass the task positionally: a task starting with "--" is parsed as an option #342

Description

@elronbandel

#328 fixed this for claude-code. The same pattern is in five other agents and is very likely the same bug; I left them alone rather than ship CLI changes I hadn't run.

containers/agents/claude-code-rtk/Dockerfile:76:  exec claude -p … --dangerously-skip-permissions "$TASK"
containers/agents/bob/Dockerfile:30:            exec bob --yolo --accept-license "$TASK"
containers/agents/cline/Dockerfile:29:           exec cline -y … "$TASK"
containers/agents/continue-cli/Dockerfile:40:    exec cn -p "$TASK"
containers/agents/codex/Dockerfile:34:           … --skip-git-repo-check "$TASK"

Why it matters

A task whose text begins with -- is parsed as an option and the agent exits without ever contacting the model. Observed on claude-code:

error: unknown option '-- The CXX compiler identification is GNU'

stdout.log empty, .exit-code 1, the prompt echoed back inside the error — so it reports as an agent error, not a task failure. Any benchmark whose task text starts with -- hits it; it surfaced here because cmake output begins -- The CXX compiler identification is ….

There is a second case worth checking while in there: a task matching a subcommand name (claude [options] [command] [prompt]) is parsed as the command. -- fixes both.

Fix

-- "$TASK" before the prompt, per agent, verified against each CLI — some may not support --, and a couple take the prompt on stdin already, which is immune.

Not affected: aider (--message "$TASK", an option value) and copilot-cli (stdin).

Metadata

Metadata

Assignees

No one assigned

    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