Skip to content

fix(loop): never subscribe, because a run cannot end its own session - #8

Merged
Ardnived merged 1 commit into
mainfrom
claude/never-subscribe
Aug 31, 2026
Merged

Ardnived merged 1 commit into
mainfrom
claude/never-subscribe

Conversation

@Ardnived

Copy link
Copy Markdown
Contributor

Summary

  • Removes subscribe_pr_activity entirely; CI is watched by bounded polling instead
  • Stops instructing a run to end its own session, which it cannot do
  • States the baton as the reason a stray wake is now harmless

Changes

  • 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 itself
  • workflow/skills/finalize-pr/SKILL.md — step 8 polls, with the reason stated
  • loop-config.json — ceilings.ciPollAttempts: 20

Test results

  • Lean gate: ✓ claude plugin validate ./workflow --strict passes

Manual verification

  1. After the next run, RemoteTrigger list_runs may still show a lingering session — that is now expected and harmless, not a failure
  2. Confirm no run calls subscribe_pr_activity

Notes for reviewer

The evidence for the change. Session cse_01Kf54UnPYv4ZMVDykLAMYP6 reported "unsubscribed before posting this, so this session ends rather than waking on later events" — and was still active 35 minutes later. cse_017B5yzacfYNWCHfcSwkoAyu from the previous day was also still active. 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.

"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]>
@Ardnived
Ardnived merged commit 26c9fb0 into main Aug 31, 2026
@Ardnived
Ardnived deleted the claude/never-subscribe branch August 31, 2026 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant