What happened?
run_fix always reads sample_input from input(). If stdin is not a TTY it immediately exits with an error. There is also no --sample-input flag on the fix subcommand in __main__.py, so there is no way to pass it non-interactively even if you wanted to.
# current fix.py
if _is_interactive():
sample_input = input("Sample input for validation: ").strip()
else:
console.print("[red]Error:[/red] sample input required. Run in an interactive terminal.")
sys.exit(1)
Steps to reproduce
- Run
inference-engine fix models/sentiment/v1/ in a CI pipeline or any non-TTY context
- Command exits immediately with "sample input required"
- No
--sample-input flag exists to work around this
Expected behavior
Add --sample-input to the fix subparser in __main__.py. In run_fix, prefer the flag value; fall back to input() only when interactive and the flag was not provided; exit with a clear message only when neither is available.
# __main__.py
fix_parser.add_argument("--sample-input", dest="sample_input", default=None)
# fix.py
def run_fix(model_dir: str, sample_input: str | None = None) -> None:
if sample_input is None:
if _is_interactive():
sample_input = input("Sample input for validation: ").strip()
else:
console.print("[red]Error:[/red] --sample-input required in non-interactive mode.")
sys.exit(1)
Environment
- Area:
app/cli/commands/fix.py, app/cli/__main__.py
- Phase: 8 (fix before Phase 9 begins)
- Priority: High
Relevant logs or error output
Error: sample input required. Run in an interactive terminal.
What happened?
run_fixalways readssample_inputfrominput(). If stdin is not a TTY it immediately exits with an error. There is also no--sample-inputflag on thefixsubcommand in__main__.py, so there is no way to pass it non-interactively even if you wanted to.Steps to reproduce
inference-engine fix models/sentiment/v1/in a CI pipeline or any non-TTY context--sample-inputflag exists to work around thisExpected behavior
Add
--sample-inputto thefixsubparser in__main__.py. Inrun_fix, prefer the flag value; fall back toinput()only when interactive and the flag was not provided; exit with a clear message only when neither is available.Environment
app/cli/commands/fix.py,app/cli/__main__.pyRelevant logs or error output
Error: sample input required. Run in an interactive terminal.