Repository navigation
fix(loop): never subscribe, because a run cannot end its own session - #8
Merged
Merged
Conversation
"Unsubscribe then stop" was the wrong target. A run has no way to end its session: two were observed active a full day after their work finished, including one that unsubscribed exactly as instructed and said so in its journal. persist_session:false governs whether the next fire reuses a session, not whether this one dies. So stop trying to end the session and remove the thing that can wake it. A subscription is the only route by which GitHub reaches a finished run, and it is the part we actually control. finalize-pr now polls pull_request_read get_status up to ceilings.ciPollAttempts times instead. If CI has not settled by then, that is a fact for the journal, not a reason to stay awake. The baton is what makes a stray wake safe, and it is worth stating rather than leaving implicit: a woken session re-derives its worklist from assignee:sydevs-bot, finds the item handed back to the reviewer, and exits with nothing to do. Under the old timestamp census the same wake would have seen fresh updated_at values across the backlog and found real work. Handing back the baton is what turns re-entry into a no-op. Co-Authored-By: Claude Opus 5 <[email protected]>
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.
Summary
subscribe_pr_activityentirely; CI is watched by bounded polling insteadChanges
workflow/skills/loop-run/SKILL.md— "Waking outside a run" becomes "Never subscribe to PR activity"; the ending section no longer tells the run to terminate itselfworkflow/skills/finalize-pr/SKILL.md— step 8 polls, with the reason statedloop-config.json—ceilings.ciPollAttempts: 20Test results
claude plugin validate ./workflow --strictpassesManual verification
RemoteTrigger list_runsmay still show a lingering session — that is now expected and harmless, not a failuresubscribe_pr_activityNotes for reviewer
The evidence for the change. Session
cse_01Kf54UnPYv4ZMVDykLAMYP6reported "unsubscribed before posting this, so this session ends rather than waking on later events" — and was stillactive35 minutes later.cse_017B5yzacfYNWCHfcSwkoAyufrom the previous day was also stillactive. The instruction was followed and did not achieve its goal, so the goal was wrong.Why polling is affordable here. CI on these repos settles in under ten minutes; 20 checks covers it. The cost is a handful of extra status reads per PR against a subscription that could keep a session spending for hours.