diff --git a/.amplifier/evaluation/deep-swe/src/deepswe_agents/amplifier_agent.py b/.amplifier/evaluation/deep-swe/src/deepswe_agents/amplifier_agent.py index 04e40de6..5de75de7 100644 --- a/.amplifier/evaluation/deep-swe/src/deepswe_agents/amplifier_agent.py +++ b/.amplifier/evaluation/deep-swe/src/deepswe_agents/amplifier_agent.py @@ -106,8 +106,12 @@ def run_command(self, instruction_path: str) -> str: # SESSION_ID). `--output json` appends the final envelope -- including # metadata.durationMs -- to agent.log; it does NOT suppress the # human-readable `[usage]` lines, so nothing is lost by adding it. + # + # The `--` before the prompt is load-bearing: without it, any instruction + # whose text begins with `-` is parsed as a flag and the CLI exits with a + # usage error before the agent ever runs. return ( f"amplifier-agent run -y --config {HOST_CONFIG_PATH} " f"--session-id {shlex.quote(SESSION_ID)} --output json " - f'"$(cat {instruction_path})"' + f'-- "$(cat {instruction_path})"' ) diff --git a/.amplifier/evaluation/deep-swe/src/deepswe_agents/amplifier_foundation.py b/.amplifier/evaluation/deep-swe/src/deepswe_agents/amplifier_foundation.py index 27182bba..1330bdf3 100644 --- a/.amplifier/evaluation/deep-swe/src/deepswe_agents/amplifier_foundation.py +++ b/.amplifier/evaluation/deep-swe/src/deepswe_agents/amplifier_foundation.py @@ -172,11 +172,15 @@ def run_command(self, instruction_path: str) -> str: No `--model` flag: it requires `--provider` alongside it, and the model is already pinned by `default_model` in settings.yaml. + + The `--` before the prompt is load-bearing: without it, any instruction + whose text begins with `-` is parsed as a flag and the CLI exits with a + usage error before the agent ever runs. """ return ( f"amplifier run --bundle '{self._anchors_ref}' " f"--mode single --output-format json " - f'"$(cat {instruction_path})"' + f'-- "$(cat {instruction_path})"' ) def populate_context_post_run(self, context) -> None: # type: ignore[no-untyped-def] diff --git a/.amplifier/evaluation/deep-swe/src/deepswe_agents/opencode_amplifier.py b/.amplifier/evaluation/deep-swe/src/deepswe_agents/opencode_amplifier.py index d79e2260..b8b27f7d 100644 --- a/.amplifier/evaluation/deep-swe/src/deepswe_agents/opencode_amplifier.py +++ b/.amplifier/evaluation/deep-swe/src/deepswe_agents/opencode_amplifier.py @@ -71,7 +71,12 @@ def agent_install_steps(self) -> list[InstallStep]: ] def run_command(self, instruction_path: str) -> str: + # Two separators, doing two different jobs. The first `--` hands the rest + # of the line to opencode (click consumes only that one). The second is + # load-bearing for the same reason as the other adapters: without it, any + # instruction whose text begins with `-` is parsed as a flag and the agent + # never runs. Click forwards the second `--` verbatim via os.execvp. return ( f"amplifier-opencode launch -- run --auto --model amplifier/{self.model} " - f'"$(cat {instruction_path})"' + f'-- "$(cat {instruction_path})"' ) diff --git a/.amplifier/evaluation/deep-swe/src/deepswe_agents/opencode_vanilla.py b/.amplifier/evaluation/deep-swe/src/deepswe_agents/opencode_vanilla.py index e12bb0c6..261bc3a5 100644 --- a/.amplifier/evaluation/deep-swe/src/deepswe_agents/opencode_vanilla.py +++ b/.amplifier/evaluation/deep-swe/src/deepswe_agents/opencode_vanilla.py @@ -144,4 +144,9 @@ async def _dump_opencode_log(self, environment) -> None: self.logger.warning(f"could not read opencode log: {exc}") def run_command(self, instruction_path: str) -> str: - return f'opencode run --model anthropic/{self.model} --auto "$(cat {instruction_path})"' + # The `--` before the prompt is load-bearing: without it, any instruction + # whose text begins with `-` is parsed as a flag, opencode prints its usage + # banner, and the agent never runs. yargs is configured with + # `populate--: true`, and opencode's run command merges `argv["--"]` back + # into the message, so the prompt still arrives intact. + return f'opencode run --model anthropic/{self.model} --auto -- "$(cat {instruction_path})"'