Fix stale durable live command blocking - #484
Merged
Merged
Conversation
Co-Authored-By: Codex <noreply@openai.com>
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.
The live cycle validated every matching durable command before checking whether it was terminal. Historical commands with a stale runtime identity therefore raised
ValueErrorand failed the cycle; a queued stale command must remain protected, while terminal history must not block or trigger a duplicate same-day command.This change skips binding validation and reconciliation only for trusted terminal states. It first validates every unresolved command before reconciling any of them. A fixed invalid-binding result blocks the cycle without evaluating a new signal, claiming, writing command events or markers, or submitting orders. The report projects only the approved blocked reason; arbitrary error text is not included.
The existing queued command remains blocked. This PR does not cancel, rebind, delete, claim, or submit it, and it does not deploy or automatically restore live execution.
Validation:
PYTHONPATH="...worktree:...QPK d51...:...UES b83..." python3 -m pytest -q tests/test_rebalance_service.py tests/test_request_handling.py(120 passed, 22 subtests passed)python3 -m ruff check application/rebalance_service.py main.py tests/test_rebalance_service.py tests/test_request_handling.pygit diff --check