Repository navigation
docs(admission): ADR-1125, a cancelled tool call's worker runs to completion (#728, slice 5) - #946
Conversation
…pletion (#728, slice 5) Issue #728 asks to keep work counted "until completion or a documented cooperative cancellation boundary". Slices 1-4 (#885, #903, #902, #936, #943) implement and prove the first: the slot is released by the worker's done callback, the caller awaits through asyncio.shield, abandoned workers are reported in memory_stats.abandoned_workers. Nothing forwards the cancellation into the worker thread, so no cooperative boundary exists. ADR-1125 records those semantics, amends ADR-0329 (the slot belongs to the worker), states what a handler that wants to stop early must specify, and lists the tests that hold each point. Mirror regenerated with wiki_decision_mirror.generate_mirror. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018kyZYs8nydviS39BjwT88E
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Claude finished @cdeust's task in 2m 19s —— View job Review of PR #946 done
Result: no Blockers. The review posts 3 Notes that need no action before merge:
Not done: I didn't run Verdict: approve |
Review 1 of 3: PR #946 (ADR-1125, #728 slice 5)I ran five reviews: code quality, documentation accuracy, security, performance and test coverage. None of them found a Blocker. I checked each ADR claim against the code. The slot is taken and handed to the worker with no Notes, no action before merge
Verdict: approve |
… to completion (#728, slice 5)
|
Réponse à la revue 1 :
Generated by Claude Code |
|
Claude finished @cdeust's task in 2m 27s —— View job Review 2 of 3 of PR #946 is done
Result: no Blockers. Both new claims match
Not done: Python wasn't permitted in this job, so I didn't run Verdict: approve |
Review 2 of 3: PR #946 (ADR-1125, #728 slice 5)Review 1 (at Both new claims match the code. The slot is released from the worker's done callback ( Notes, no action before merge
Verdict: approve |
|
Réponse à la revue 2 (notes optionnelles, pas de push pour elles) :
Generated by Claude Code |
Summary
Last slice of #728. The issue's first acceptance item reads "Keep work counted until completion or a documented cooperative cancellation boundary". Slices 1-4 (#885, #903, #902, #936, #943) implemented and proved the first branch:
run_admittedreleases the admission slot from the worker's done callback, the caller awaits throughasyncio.shield, abandoned workers are reported inmemory_stats.abandoned_workers, and real MCP cancel/disconnect is exercised with the realrememberon an isolated Cortex store. Nothing forwards the caller's cancellation into the worker thread, so no cooperative boundary exists.ADR-1125 records these semantics as the decision: no cooperative cancellation boundary; the slot belongs to the worker (amends ADR-0329); abandoned work is reported, not hidden; a handler that wants to stop early must amend the ADR and specify the consistent stopping point, how cancellation reaches the thread, that the slot is kept until return, and the
abandoned_workoutcome. Out of scope:safe_handlerwithouttool_name(no admission).Root cause addressed by the series: the slot was owned by the caller instead of the worker. This PR adds no code.
Closes #728
Type of change
Test plan
tests_py/infrastructure/test_project_wiki_mirror.py,tests_py/handlers/test_admission_cancellation.py,tests_py/server/test_safe_handler_cancellation.py,tests_py/handlers/test_abandoned_work_status.py,tests_py/handlers/test_memory_stats_mapping.py: 51 passed.tests_py/handlers/test_project_wiki_tools.py,tests_py/scripts/test_craftsmanship_decisions.py,tests_py/scripts/test_migrate_decision_blocks.py: 52 passed.wiki_decision_mirror.check_mirror(.)returns[]aftergenerate_mirror;python scripts/check_craftsmanship.py: OK.Audit notes
torch, its download host is blocked in this environment); theruffavailable here (not the lock-pinned one) reports E501 on files this PR does not touch, so lint is left to CI.Reviewer checklist
Generated by Claude Code