Skip to content

fix(flow): don't start the OCR prewarm for --help, and wait for it at exit - #1242

Merged
abrichr merged 2 commits into
mainfrom
fix/prewarm-help-abort
Oct 18, 2026
Merged

abrichr merged 2 commits into
mainfrom
fix/prewarm-help-abort

Conversation

@abrichr

@abrichr abrichr commented Oct 18, 2026

Copy link
Copy Markdown
Member

openadapt-flow demo and tutorial started loading OCR on a background thread before parsing their arguments, so tutorial --help did too. If the help printed and Python exited while onnxruntime was still loading, the native runtime aborted the process with exit -6. That is the intermittent agent shim (py3.12) failure (test_default_flow_cli_invokes_the_installed_tutorial_help) that blocks #1217, #1234 and #1239.

The help, -h and --version flags no longer start the prewarm. When it does start, exit now waits up to 30 seconds for the OCR load to finish rather than tearing it down mid-load.

The new tests fail on main (test_help_does_not_start_the_prewarm, 6 cases) and pass here, along with the rest of tests/test_ocr_backends.py. tutorial --help exits 0 in five runs in a row locally.

🤖 Generated with Claude Code

abrichr and others added 2 commits October 18, 2026 01:51
… exit

`demo` and `tutorial` started loading OCR on a background thread before
the arguments were parsed, so `tutorial --help` did too. When the help
printed and the interpreter exited while onnxruntime was still loading,
the native runtime aborted the process ("terminate called without an
active exception", exit -6). That is the intermittent `agent shim
(py3.12)` failure in test_partner_kit on #1217, #1234 and #1239.

- `-h`, `--help` and `--version` no longer start the prewarm.
- When the prewarm does start, exit waits up to 30 s for the OCR load to
  finish instead of tearing it down mid-load.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@abrichr
abrichr merged commit 8a7d105 into main Oct 18, 2026
30 checks passed
@abrichr
abrichr deleted the fix/prewarm-help-abort branch October 18, 2026 07:35
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