Skip to content
Python

run: --prompt-text is gone; the flag is --prompt

Rohit C Prasadd2ef01889489
diff --git a/coworker/headless/runner.py b/coworker/headless/runner.py
index f36bf163..7db9ad22 100644
--- a/coworker/headless/runner.py
+++ b/coworker/headless/runner.py
@@ -63,7 +63,7 @@ def parse_args(argv: Optional[list[str]] = None) -> argparse.Namespace:
)
# With neither flag, the task is read from standard input when it is piped in.
src = p.add_mutually_exclusive_group()
- src.add_argument("--prompt", "--prompt-text", dest="prompt_text", help="the task text")
+ src.add_argument("--prompt", help="the task text")
src.add_argument(
"--prompt-file", help="file containing the task text (UTF-8); - reads standard input"
)
@@ -618,8 +618,8 @@ class NoPrompt(Exception):
def _read_prompt(args: argparse.Namespace) -> str:
- if args.prompt_text is not None:
- return args.prompt_text
+ if args.prompt is not None:
+ return args.prompt
if args.prompt_file not in (None, "-"):
return Path(args.prompt_file).read_text(encoding="utf-8")
# Piped in: `cat task.md | openworker run`. A terminal is not read: the command would
diff --git a/tests/test_headless_run.py b/tests/test_headless_run.py
index 6b75e91f..467d5693 100644
--- a/tests/test_headless_run.py
+++ b/tests/test_headless_run.py
@@ -371,7 +371,11 @@ def test_run_help_and_the_top_level_help_mention_the_command() -> None:
@pytest.mark.parametrize(
- "old", [["--mode", "bypass-approvals"], ["--persona", "code"], ["--attendance", "auto"], ["--approval-mode", "interactive"]]
+ "old",
+ [
+ ["--mode", "bypass-approvals"], ["--persona", "code"], ["--attendance", "auto"],
+ ["--approval-mode", "interactive"], ["--prompt-text", "x"],
+ ],
)
def test_the_earlier_flag_names_are_gone(tmp_path: Path, old: list[str]) -> None:
# `--mode` in particular must be refused, not read as a shortened `--model`.