Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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})"'
)
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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})"'
)
Original file line number Diff line number Diff line change
Expand Up @@ -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})"'