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
{{ message }}
Repository navigation
[SuperAgent] RFC: following up on CI after a worker has reported
#8251
waiting. Dormant after 5 days with nothing (#8243)
"No access, so this round cannot finish"
The round ends blocked. The input that clears it reopens the task
"Grant the access and tell me, then I go on"
waiting
"CI is running; I go on when it finishes"
Nothing yet. This is what the RFC is about
What happens today
A worker cannot be woken later. It has two choices:
wait inside its turn (polling gh pr checks, sleeping), holding one of the three worker slots the whole time;
report and end, so the result goes out while CI is still running.
The router's timers don't help. The router has timers (timers.mjs), but a timer fires as a router input. Workers have no timer tool by design (docs/scheduler.md: "never a delivery, a decision, a timer or a memory write").
What one week of online traffic shows
The data covers one instance, 7.7 days, 221 tasks and 537 worker turns. Two caveats: it comes from an older build (before rounds), and report text was matched with a regex, so the counts are approximate.
Long turns are real work, not waiting. Worker turns took 2.3 min at p50, 13.7 min at p90 and 54.5 min at p99. All 17 turns over 30 minutes ended done after substantial work: implementation, large scrapes, a research reproduction, full reviews. None of them was spent waiting.
Waiting on CI or a build appeared in 7 tasks (3%). In 6 of them the worker reported done while CI was still running. The seventh sent only a progress report.
Those tasks barely held slots. Only 2 turns over 15 minutes belonged to them: 56 of 3,768 worker-minutes (1.5%).
People had to come back. Of the 6 tasks delivered while CI was still running, 3 later got input from the requester's side. 2 of those inputs were about CI or a failure.
So waiting inside a turn costs little slot time today. The gap comes after delivery: a result goes out while CI is still running, and nobody looks at how CI ended until a person comes back.
Options
A. Guidance only. Workers report done while CI is still running, say so in the draft, and include the link. No code changes. The gap stays.
B. A generic task wait.
A worker tool task_wait({ after_minutes, reason }) puts the task in a new live status, sleeping, with a wake_at_ms.
A sleeping task holds no slot and survives a restart.
When it wakes, the task gets a turn in the same round ("woken after waiting for X: check it now"). Owner input wakes it early.
Each round has a cap on wakes and a deadline.
It is generic (CI, a deploy, a release). But every check costs a model turn, and the requester waits for the whole result unless the worker reports first.
C. Deliver, then watch deterministically.
The worker reports done as it does today and names what to watch, e.g. watch: { pr: <url> }.
The daemon polls that pull request's checks with a fixed, validated command (gh pr checks <url> --json) until they finish or a deadline passes. No model is involved.
If the checks fail, the daemon reopens the task for a round whose origin is the delivered round. The worker fixes the failure, and the answer goes where the result went.
If they pass, the daemon does nothing, or adds one line.
It is cheap and narrow: GitHub pull requests only. The requester gets the result at once, and a turn runs only when there is something to do.
D. Router timers. The router sets a timer to look at a task's CI later. This reuses timers.mjs, but every check costs a router turn and a routing decision, and it puts task scheduling into the conversation layer.
E. Events. A GitHub webhook or notification connector routes check results to the task. This is the cleanest design in the long run, but each instance would need a public endpoint or to poll notifications. Out of scope here.
Proposal
Not B for now: the data does not show workers holding slots while they wait. If we build anything, it should be C, behind a config switch that is off by default at first, and we measure how often CI fails after a result has gone out. A is worth doing either way.
Questions
Is the gap worth closing at about two follow-ups a week on a busy instance, or is A enough?
When CI fails after delivery, should the task reopen on its own? That would be a round nobody asked for, answered where the result went. Or should the router only be told, and decide whether to tell the requester?
When CI passes: stay silent, add a reaction on the delivered message, or post one line?
Should C stay GitHub-only, or start as a small interface (GitLab, Buildkite)?
How long should a watch last (CI that hangs, a queue that takes hours), and what does the requester see when it times out?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Follow-up to #8123, after #8239 and #8243. A task stalls in one of four ways. Those two PRs settle three of them:
waiting. Dormant after 5 days with nothing (#8243)blocked. The input that clears it reopens the taskwaitingWhat happens today
gh pr checks, sleeping), holding one of the three worker slots the whole time;timers.mjs), but a timer fires as a router input. Workers have no timer tool by design (docs/scheduler.md: "never a delivery, a decision, a timer or a memory write").What one week of online traffic shows
The data covers one instance, 7.7 days, 221 tasks and 537 worker turns. Two caveats: it comes from an older build (before rounds), and report text was matched with a regex, so the counts are approximate.
doneafter substantial work: implementation, large scrapes, a research reproduction, full reviews. None of them was spent waiting.donewhile CI was still running. The seventh sent only aprogressreport.So waiting inside a turn costs little slot time today. The gap comes after delivery: a result goes out while CI is still running, and nobody looks at how CI ended until a person comes back.
Options
A. Guidance only. Workers report
donewhile CI is still running, say so in the draft, and include the link. No code changes. The gap stays.B. A generic task wait.
task_wait({ after_minutes, reason })puts the task in a new live status,sleeping, with awake_at_ms.C. Deliver, then watch deterministically.
doneas it does today and names what to watch, e.g.watch: { pr: <url> }.gh pr checks <url> --json) until they finish or a deadline passes. No model is involved.D. Router timers. The router sets a timer to look at a task's CI later. This reuses
timers.mjs, but every check costs a router turn and a routing decision, and it puts task scheduling into the conversation layer.E. Events. A GitHub webhook or notification connector routes check results to the task. This is the cleanest design in the long run, but each instance would need a public endpoint or to poll notifications. Out of scope here.
Proposal
Not B for now: the data does not show workers holding slots while they wait. If we build anything, it should be C, behind a config switch that is off by default at first, and we measure how often CI fails after a result has gone out. A is worth doing either way.
Questions
All reactions