You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The sweep names the runs holding a project's slots, and the shutdown names what it stops (#1646)
A drain fanned out two agents under a cap of three while the Agents panel
showed nothing running: the daemon counted one live process, and a bare count
could not be questioned. The process was a card-started triage that had done
its work an hour earlier and never exited; the daemon's shutdown line said only
"stopped 1 agent(s)".
The runtime now reports the slots it holds — run id and pid, or "starting" —
instead of a number. The sweep measures the cap against their number as
before, and says their names: a stand-down at the cap reads "2 runs are already
going (<id> (pid N), …)", a fan-out that came out short reads "started 2 agents
alongside 1 already going (<id> (pid N))", and the shutdown line lists the ids
it stopped. The "a `starting` key that is never removed" hypothesis in the
issue is ruled out by the spawn's `finally`; the next occurrence names itself.
Copy file name to clipboardExpand all lines: FEATURES-SPEC.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -122,7 +122,7 @@ happens while nobody is at the keyboard.
122
122
- Auto PM: drain the confirmed queue, refill it when empty
123
123
- The routine rotation — update tickets from GitHub, triage quick wins, triage consensual work, plan tickets — plus a calendar-paced maintenance sweep
124
124
- Each routine individually switchable off
125
-
- Every stand-down reported with its reason ("it is a setting, not a bug")
125
+
- Every stand-down reported with its reason ("it is a setting, not a bug"); a stand-down at the concurrency cap, or a fan-out that came out short, names the runs holding the slots
126
126
- Concurrency cap: how many unattended agents per project
127
127
- Fan-out planning: several agents, one ticket each
128
128
- Cross-machine ticket claims so two agents never double-work; a claim whose agent ended with nothing to hand off is freed by the daemon
Copy file name to clipboardExpand all lines: packages/the-framework/src/auto-pm.SPEC.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Auto PM spends leftover subscription quota on the product's own roadmap: while t
16
16
- A claim whose agent settled with nothing to hand off is released by the sweep: the pull request that normally lifts the lock is never coming, and without the release the queue would jam forever on a dead claim. The freed work is not respawned by this daemon — one commitless run is evidence for a human, not an invitation to repeat it every cooldown. A claim whose agent never even started (a refused spawn, a stop mid-batch) is freed the same way.
17
17
- The queue coordinates a ticketless entry only once its check-off is on the data branch, and that leaves a window: an agent handed off to a cloud session settles locally before its published work is adopted, so until the check-off lands the entry still reads open, and past the cooldown it can be fanned out to a second agent. The same window opens when the daemon restarts, since only its in-memory pin covered the wait.
18
18
- The two triage routines each work on one fixed branch, and their agent refuses to start when that branch already exists, so two triages never run at once. Before firing either — from the schedule or from its "Run now" — the daemon deletes a leftover copy of that branch whose pull request is closed or merged; a branch with an open pull request, or with no pull request history at all, is kept, since that may be a triage still under way.
19
-
- Each routine can be switched off individually, and every stand-down is reported with its reason: a wedged sweep must not look like a healthy idle one.
19
+
- Each routine can be switched off individually, and every stand-down is reported with its reason: a wedged sweep must not look like a healthy idle one. A pass held back by the concurrency cap, or a fan-out that came out smaller than the cap, names the runs already occupying the slots — run id and process id — because the daemon counts live processes, while the dashboard shows each run's own status, and a process that outlives its finished run is visible only to the count.
20
20
- Switching the draining routine off means "do not *work* the queue", not "do nothing": the pass falls through to the rotation, which puts entries *on* the queue rather than taking them off. The one exception is a click that asked for the queue by name: a drain-only sweep says why it cannot, rather than borrowing the click.
Copy file name to clipboardExpand all lines: packages/the-framework/src/auto-pm.test.SPEC.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
Covers auto PM's decision policy — quota and queue both failing closed when unreadable, cooldowns, concurrency caps — the drain-before-refill cycle, rotation order and per-routine opt-outs (an unticked drain routine falls through to the rotation; a drain-only click still stands down), the calendar-paced maintenance sweep, fan-out with pinned entries and locked tickets, drains claiming their entry's ticket before starting (ticketless entries exempt; a lost claim drops the entry, not the batch), durable claims surviving restarts and hand-offs, a claim released when its agent settles with nothing to hand off and only then (the freed work not respawned; refused-spawn claims freed too; failed releases retried under a bound), on-demand and drain-only passes, a pass narrowed to a triage routine releasing its leftover branch before its one start (standing down when the routine is off, and never falling through to the queue or another routine), and the report the dashboard shows.
1
+
Covers auto PM's decision policy — quota and queue both failing closed when unreadable, cooldowns, concurrency caps — the drain-before-refill cycle, rotation order and per-routine opt-outs (an unticked drain routine falls through to the rotation; a drain-only click still stands down), the calendar-paced maintenance sweep, fan-out with pinned entries and locked tickets, drains claiming their entry's ticket before starting (ticketless entries exempt; a lost claim drops the entry, not the batch), durable claims surviving restarts and hand-offs, a claim released when its agent settles with nothing to hand off and only then (the freed work not respawned; refused-spawn claims freed too; failed releases retried under a bound), on-demand and drain-only passes, a cap stand-down and a short fan-out naming the runs holding the slots, a pass narrowed to a triage routine releasing its leftover branch before its one start (standing down when the routine is off, and never falling through to the queue or another routine), and the report the dashboard shows.
Copy file name to clipboardExpand all lines: packages/the-framework/src/daemon-runtime.SPEC.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ What the daemon does for a project: starting agents in isolated checkouts, retir
15
15
- The agents the daemon is still responsible for — spawning, running, or mid-retirement — are named for the background sweep, so it never reclaims a checkout out from under a teardown.
16
16
- A finished agent's history is archived onto the data branch (the dedicated branch the framework's shared records live on) — committed and pushed the moment the session settles — and its checkout is reclaimed once the work reaches the remote: the one retention rule, applied whatever the agent did. A push that cannot land keeps the checkout, and the background sweep retries it later.
17
17
- An agent killed by a transient connection error is continued automatically (at most twice), and a child that died before booting is marked failed with the cause surfaced — never left "waiting to start" forever.
18
-
- On shutdown, live agents are stopped rather than orphaned; each keeps its worktree and branch, so the dashboard can continue the same conversation in the same checkout when asked. A start that lands while the daemon is shutting down is refused rather than spawned into the gap between the stop pass and the server closing, where nothing would ever stop it. The refusal takes back the fresh worktree and branch it had already allocated, which no agent ever owned. An agent can also be forwarded to a connected device, its events relayed back.
18
+
- On shutdown, live agents are stopped rather than orphaned, and named in the log as they are stopped — a run the dashboard had long shown as finished turning up here is how a process that outlived its work is found; each keeps its worktree and branch, so the dashboard can continue the same conversation in the same checkout when asked. A start that lands while the daemon is shutting down is refused rather than spawned into the gap between the stop pass and the server closing, where nothing would ever stop it. The refusal takes back the fresh worktree and branch it had already allocated, which no agent ever owned. An agent can also be forwarded to a connected device, its events relayed back.
19
19
- Stopping resolves when the daemon has let go of the repo, not when the processes die: a child's exit event lands after its pid disappears, and the teardown that event starts — archive the agent, commit its work, keep or remove its checkout — runs well past that. A teardown that wedges costs the shutdown at most its bounded grace period — it never blocks the exit for good.
0 commit comments