Repository navigation
Refuse a stop that leaves work in flight with nothing watching it - #44
Closed
jeremymanning wants to merge 2 commits into
Closed
jeremymanning wants to merge 2 commits into
jeremymanning wants to merge 2 commits into
Conversation
The first commit proposed a lesson with a script to run by hand. That is the softer version of what works: the session that forgets to keep a waiter going forgets the lesson that says to keep one too. What stopped the failure locally was a Stop hook that refuses the stop, so that is what ships. hooks/inflight-stop-check.sh is byte-identical to the hook registered locally. It refuses a stop once when work is still in flight with nothing watching it: a detached process that looks like a test suite or a launched job, a workflow run dispatched by hand (cron runs are not the session's to watch), or the user's own pull request with pending checks, and no polling loop alive. It reads stop_hook_active and stays silent on the stop that follows a block. The mod's classic.Stop handler runs it and joins its reason to any owed-lesson refusal. A script that is missing, times out or prints something unreadable lets the stop through. The same file can be registered directly in settings.json. The lesson is removed from the pool: it also failed test_docs and test_general_pool, which list everything the pool ships. claude plugin test: 286 pass (4 new). run_tests.sh: OK, 23 files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V7QkYvK7jaE1QVY1ZMfAt2
Member
Author
|
Closing without merging: the branch is out of date, and the hook conflicts with the repository's rules.
The check is still available as the user lesson |
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.
Adds an in-flight check at the stop, as a hook rather than a lesson.
Why a hook
The failure: a turn starts a long run, dispatches a workflow, opens pull requests, writes a status summary and ends. Nothing fails. The work finishes or stalls unseen, and the next anyone hears of it is the user asking why the monitors are gone.
This PR first proposed a lesson with a script to run by hand. That is the softer version of what works: the session that forgets the waiter forgets the lesson too. What actually stopped it was a Stop hook that refuses the stop, so that is what ships. The lesson is removed (it also failed
test_docsandtest_general_pool, which list everything the pool ships).What it does
hooks/inflight-stop-check.shrefuses a stop once when any of these exist and no polling loop is alive:It reads
stop_hook_activeand stays silent on the stop that follows a block, so it cannot loop. The mod'sclassic.Stophandler runs it and joins its reason to any owed-lesson refusal. A script that is missing, times out or prints something unreadable lets the stop through. The same file can be registered directly as a Stop hook insettings.json.Limits
gh, a pid or a log. A waiter wrapped in a script file is not recognised, so the stop is refused once unnecessarily.pytest, a Claude scratchpad path,nohup); a long-lived unrelated process matching it would also trigger one refusal.Tests
claude plugin test .: 286 pass, 4 new (refusal carries what is in flight; the script is told when a stop follows a block; nothing in flight or unreadable output lets the stop through; an owed lesson and unwatched work share one refusal)../run_tests.sh: OK, 23 files.🤖 Generated with Claude Code
https://claude.ai/code/session_01V7QkYvK7jaE1QVY1ZMfAt2