Problem
When a user passes both an inline prompt and --prompt-file, the file silently
wins and the inline prompt is discarded with no warning:
assayer run "this is ignored" --prompt-file prompt.txt --models gpt-4o
There is no indication that "this is ignored" was dropped. This is confusing,
especially for users building wrapper scripts.
Location
assayer/cli/main.py, inside the run command:
if prompt_file:
with open(prompt_file) as f:
prompt_text = f.read().strip()
elif prompt:
prompt_text = prompt
What to do
Add a warning to stderr when both are supplied:
if prompt_file:
if prompt:
click.echo(
"Warning: --prompt-file takes precedence; the inline prompt is ignored.",
err=True,
)
with open(prompt_file) as f:
prompt_text = f.read().strip()
How to test
Add a test in tests/test_cli.py using CliRunner that passes both a prompt
argument and a --prompt-file, and asserts the warning appears in the output.
No mocking needed for this case, the validation runs before any API call.
Problem
When a user passes both an inline prompt and --prompt-file, the file silently
wins and the inline prompt is discarded with no warning:
There is no indication that
"this is ignored"was dropped. This is confusing,especially for users building wrapper scripts.
Location
assayer/cli/main.py, inside theruncommand:What to do
Add a warning to stderr when both are supplied:
How to test
Add a test in
tests/test_cli.pyusingCliRunnerthat passes both a promptargument and a
--prompt-file, and asserts the warning appears in the output.No mocking needed for this case, the validation runs before any API call.