Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When one document worker raises, the CLI currently discards the submitted future, can report success, and can continue to the
Processed ...completion log. Separately, an exception while running or consuming an inference batch terminates the daemon thread while leaving callers' futures unresolved, so they can wait indefinitely.This change makes both failure paths observable:
result()as they complete, so worker failures reach Typer and produce a nonzero exit;The tests cover the real CLI exit/log behavior, multi-item batch failure followed by recovery, too-few model outputs, and generator failure during output iteration.
Validation:
CUDA_VISIBLE_DEVICES='' uv run pytest tests/unit/test_cli.py tests/unit/test_steps.py tests/unit/test_queue.py— 11 passedCUDA_VISIBLE_DEVICES='' uv run pytest tests/unit --ignore=tests/unit/test_wordsegmentation.py— 55 passed, 1 skippeduv run ruff format --check src/htrflow/cli.py src/htrflow/pipeline/steps.py tests/unit/test_cli.py tests/unit/test_steps.pyuv run ruff check src/htrflow/cli.py src/htrflow/pipeline/steps.py tests/unit/test_cli.py tests/unit/test_steps.pyThe full suite is not claimed here: on the current unlocked dependency resolution, the model-backed word-segmentation test failed independently of this patch. PR #57 addresses the lock file and current-stack compatibility work.
OpenAI Codex assisted with implementation and testing, and Claude Sonnet independently reviewed the patch. I reviewed the final changes and take responsibility for them.
Checklist
ruff formatto format my code.ruff check.