Repository navigation
Fix: worker and client lifecycle (F13 F17 F18 F19 F21) - #42
Merged
Merged
Conversation
…n a dead worker (F17), kill the process group when the host is gone (F18), round progress (F19), retry os.replace on Windows (F21) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y2SN8SuEakTdiWy3F2WUqN
…tage break re-pointed for rounding Two existing tests are edited, with approval, because they encoded the F19 truncation bug: - test_roundtrip_failures.WhatAToolReturns.test_many_progress_messages_all_arrive_and_the_task_still_ends: expected maximum 0.99 -> 1.0 (19999/20000 rounds to 100 %). - tests/test_sabotage.py: the 'progress is off by one percent' break now patches math.floor(...) in worker._whole_percent and is guarded by test_every_whole_percent_arrives_as_itself. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y2SN8SuEakTdiWy3F2WUqN
…g it Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y2SN8SuEakTdiWy3F2WUqN
…exit status 0, coverage written) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y2SN8SuEakTdiWy3F2WUqN
This was referenced Oct 8, 2026
Fix: Windows quoting (F10) and table inputs (F2 F3 F4 F7), merged and conflict-resolved together
#47
Merged
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.
Fixes the lifecycle theme of the round-trip findings; their cases now run as normal tests and the findings are removed from
tests/roundtrip_known_failures.py.Before -> after
track=Falseon Python 3.13+, otherwise the tracker registration is skipped during the attach), so the host's block survives the worker and crash messages no longer carry the "leaked shared_memory" warning. The host still unlinks its own block.setsid, unless it already leads one) and, when stdin closes (or afterORPHAN_GRACE_Sfor a tool that ignores cancel), SIGKILLs every other member of the group, then exits normally. Members are found withps -A -o pid=,pgid=; ifpsfails it logs a warning and kills the whole group. Because the worker does this itself, no host change is required (Appose andProcessBuildercannot callsetsid).floor(100 f + 0.5), like Java'sMath.round):progress(0.29)shows 29 % (was 28), 0.99995 shows 100 %.PermissionError(WinError 5) fromos.replacein the registry's atomic write is retried (REPLACE_ATTEMPTS = 6,REPLACE_PAUSE_S = 0.2, each retry logged) and, if it persists, raises an error naming the file and saying an antivirus, indexer or viewer probably holds it. The test harness' registration retry is removed.Existing-test exceptions (both approved, both named in commit 56606c0):
test_roundtrip_failures.py::WhatAToolReturns.test_many_progress_messages_all_arrive_and_the_task_still_endsexpected the truncated maximum 0.99 (now 1.0, with the reason in a comment);tests/test_sabotage.py: the progress break now patches the new rounding line and is guarded bytest_every_whole_percent_arrives_as_itself. Deadis_known("lifecycle:...")skips were removed from two tests (strengthens them).New
tests/test_lifecycle_fixes.py(11 tests; the only OS-call mocks are theos.replaceones, which test our retry logic). Docs:PROTOCOL.md,REGRESSION_LEDGER.md.Host follow-ups: progress: use
current/maximumas sent, and round half up if a percent is computed from a fraction; hosts that write shared memory own the unlink; a task on a dead worker should be shown as CRASHED with the worker's output (Napari). Process group: Napari already starts the worker withstart_new_session=True; Fiji (ApposeService) and QuPath (ProcessBuilder) rely on the worker's ownsetsid.Verified by the author on Linux, Python 3.11: black, ruff, mypy, vulture; full suite 409 tests with only the two environmental sandbox failures; coverage 85.95 % (floor 85); sabotage passes. I re-ran black, ruff, mypy and the lifecycle and failure-injection tests. Not verified: F21 on real Windows, the
track=Falsepath on Python 3.13+, macOS (ps, process groups), and Fiji/QuPath with the worker's ownsetsid: the host regressions must be re-run against this Tools version before the hosts are considered green.🤖 Generated with Claude Code
https://claude.ai/code/session_01Y2SN8SuEakTdiWy3F2WUqN
Generated by Claude Code