Skip to content

Fix CLI commands silently exiting 0 on failure - #270

Merged
vmdocua merged 6 commits into
masterfrom
bf-click-exit
Aug 10, 2026
Merged

Fix CLI commands silently exiting 0 on failure#270
vmdocua merged 6 commits into
masterfrom
bf-click-exit

Conversation

@vmdocua

@vmdocua vmdocua commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Testing bids-inject against real data on Linux (#266) revealed that the CLI process always exited 0, even when the underlying operation failed. Root cause: Click's main() runs in standalone mode by default, which silently discards a command callback's plain return res.

Tasks:

  • Audited all commands under reprostim.cli. Fixed the same return resctx.exit(res) pattern.
  • The existing test suite had no coverage of this failure mode — every mocked do_main returned 0. Added CliRunner-based regression tests for it.
  • Updated .ai/cli/exit-codes-spec.md/-tasks.md.

@vmdocua vmdocua self-assigned this Aug 10, 2026
@vmdocua vmdocua added bug Something isn't working documentation Changes only affect the documentation enhancement New feature or request patch Increment the patch version when merged tests Add or improve existing tests labels Aug 10, 2026
@vmdocua
vmdocua marked this pull request as ready for review August 10, 2026 16:03
@vmdocua
vmdocua merged commit 95acd42 into master Aug 10, 2026
10 checks passed
@vmdocua
vmdocua deleted the bf-click-exit branch August 10, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Changes only affect the documentation enhancement New feature or request patch Increment the patch version when merged tests Add or improve existing tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant