fix(kanban): make run finalization shutdown-safe - #66915
Conversation
|
teknium1
left a comment
There was a problem hiding this comment.
The finalization and shutdown-tracking direction addresses gaps still present on current main: _end_run does not inspect its run-row update result (hermes_cli/kanban_db.py:3262-3290), dispatch does not reconcile orphaned runs before reclaim/claim work (hermes_cli/kanban_db.py:7551-7556), and gateway shutdown does not track Kanban to_thread work (gateway/run.py:8452; gateway/kanban_watchers.py:298).
Problems
- The shared DB-health prerequisite (
e97692b) overlaps the active consolidation in #66912, as the MEMBER comment notes. Please split that prerequisite from the targeted finalization slice so it can be reviewed independently. tests/hermes_cli/test_kanban_core_functionality.py:3749renames an existing test to_legacy_gateway_dispatcher_retries_after_ttl; pytest will no longer collect it, leaving obsolete dead test code.
Suggested changes
- Keep the
e7639f2finalization/shutdown slice separate from the DB-health prerequisite and consolidate the latter through #66912. - Remove the uncollected legacy helper, or make it an executed assertion of the supported recovery behavior.
Automated hermes-sweeper review.
| @@ -3756,25 +3749,23 @@ async def _sleep(_delay): | |||
| ) | |||
There was a problem hiding this comment.
This rename removes the previous test from pytest collection but retains its obsolete implementation as dead code. Please delete it, or replace it with an executed test for the supported recovery contract.
Summary
This branch includes the prerequisite DB-health commit from #65899 because that dependency is not yet on main.
Test plan
scripts/run_tests.sh tests/hermes_cli/test_kanban_db.py tests/hermes_cli/test_kanban_db_health.py tests/hermes_cli/test_kanban_dispatch_lock.py tests/hermes_cli/test_kanban_run_finalization.py tests/gateway/test_kanban_db_circuit.py tests/gateway/test_kanban_watchers_mixin.py -q(256 passed)uv run ruff check gateway/kanban_watchers.py gateway/run.py hermes_cli/kanban_db.py tests/gateway/test_kanban_watchers_mixin.py tests/hermes_cli/test_kanban_run_finalization.pypython -m compileall -q ...git diff --check