Skip to content

Return nonzero status on CLI inference failure#197

Draft
dissonancehelix wants to merge 1 commit into
spotify:mainfrom
dissonancehelix:agent/return-nonzero-on-cli-error
Draft

Return nonzero status on CLI inference failure#197
dissonancehelix wants to merge 1 commit into
spotify:mainfrom
dissonancehelix:agent/return-nonzero-on-cli-error

Conversation

@dissonancehelix

Copy link
Copy Markdown

What changed

  • Make predict.main() return 0 after successful inference.
  • Return 1 from both handled inference-error paths.
  • Propagate that return value when predict.py is executed directly.

Why

The CLI currently catches IOError and general inference exceptions, prints an error, and then completes without a failing process status. Automation can therefore treat a failed transcription as successful.

The existing error output and traceback are preserved; this change only makes the process status match the reported outcome.

Validation

Added deterministic CLI-contract tests with the model and inference call replaced by fakes:

2 passed

The tests verify status 0 after success and status 1 after a handled inference failure. They do not load a model or process audio.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant