Skip to content

fix command exits immediately in CI / non-interactive mode with no workaround #19

@AK11105

Description

@AK11105

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

  1. Run inference-engine fix models/sentiment/v1/ in a CI pipeline or any non-TTY context
  2. Command exits immediately with "sample input required"
  3. 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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions