@sjawhar/pi-legion 19.30.2 → 19.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -30,7 +30,7 @@ and 7 (a conflict, the hand-over, the close) is in
|
|
|
30
30
|
| `review-stuck` | A review round the daemon cannot end on its own, in one of three ways: no review decides the round, the approval is of code the current head may not carry, or GitHub will not merge the head. The `review-stuck` paragraphs of your own role prompt give each one, its `topic` and what answers it. The third carries no `topic`. Its remedy, the close and the reopen at the same head, is for one named case only, and your role prompt gives the sort and the remedy's test in full; this row is their summary. Read what the base requires as `skill://legion-worker/references/merge-gate.md` reads it, rulesets and branch protection both, where a `code_scanning` rule requires an analysis no status-check list names. Read what the head carries in two lists, every page: its check runs (counted by `gh api repos/<owner>/<repo>/commits/<head>/check-runs --jq .total_count` and listed by `gh api --paginate 'repos/<owner>/<repo>/commits/<head>/check-runs?per_page=100' --jq '.check_runs[] | [.name, .status, .conclusion] | @tsv'`) and its commit statuses (`gh api --paginate 'repos/<owner>/<repo>/commits/<head>/status?per_page=100' --jq '.statuses[] | [.context, .state] | @tsv'`), since a commit status is no check run. A required item in either list is reported, and a check run whose status is `queued`, `requested`, `waiting`, `pending` or `in_progress`, or a commit status whose state is `pending`, is running, not missing, and a check run concluded `failure`, `timed_out`, `cancelled` or `startup_failure`, or a status in state `failure` or `error`, is red; never read the status endpoint's top-level `state`, which reads `pending` with no status at all. A required item in neither list falls in a named case: a fork pull request whose runs wait for a maintainer's approval (`action_required`), a check only a commit status would report, and a workflow another repository defines each take a person through a `dispatch ask`; a required workflow whose own path filter skips every file of the change gets no run, and a reopen sends the same event, so while the base still carries that filter the head takes a change to the workflow or to the head, and once the base has dropped it the head is the remedy's own case. The remedy's own case is a required workflow no event started on a pull request already open, and its test is the role prompt's: not a fork and no run `action_required`; a workflow file, as the merge commit holds it, has a job reporting the required item whose `on:` runs it for `pull_request` with no `types`, `branches` or path filter that excludes this change; and neither list holds a run of it. Such a head takes the reopen. A head that matches none of the named cases takes a person through a `dispatch ask`, never the reopen, since GitHub has more cases than these; so does a head whose required item still has no run once every run the reopen started has concluded. Close the pull request, wait a minute, and reopen it at the same head, since in cybermonklabs/legion a quicker reopen can have its CI run cancelled by the close's own run and leave `ci-ok` failing (`tests-closed.yaml`); tell the reviewer on its role topic to do it, since a repository action is the phase worker's. It costs two things: the close writes a `pr-closed-unmerged` notice, which is this close and ends no work, and the reopen starts the head's other checks again. It is for no other state: not a check that is running, not a check that is red, and not a head GitHub holds for a review the repository requires. A round whose head has no settled run gets no `review-stuck` notice of any kind, so read it in your own record with the `legion` tool's `read_record`, where the issue's `mergeWait` names the head: its `checkRuns` counts only the runs a CI settlement applied, so 0 there is no evidence of what GitHub holds, and you read the head's two lists before you act. A run still running there is waited for; for a GitHub Actions job GitHub ends the wait itself (24 hours queued on a self-hosted runner, `timeout-minutes` or 6 hours hosted and 5 days self-hosted running, 35 days for a whole workflow run), whose settlement moves the round, a `waiting` run waits on a person's approval of an environment, up to 30 days, and another App's check run, one a workflow created through the API and a `pending` commit status have no such bound and go to a person once they stand longer than their CI usually takes. Every run concluded while `checkRuns` stays 0 is a settlement not yet arrived, which Dispatch's CI reconcile pass repairs where it runs, a pass every 5 minutes reaching each head within a cycle of passes, so read the record again after a few passes; a head still at 0 then is sorted as above: a red required check is `request_backward_move` to `implementing`, a required item with no run takes the reopen only when the test matches, and every other head takes a person. A conflicting head never waits in `mergeWait` once a read has answered for it, because the daemon sends it back itself with a `checks-red` notice. |
|
|
31
31
|
| `message-refused` | Dispatch refused a write the daemon was making on an issue of your tree, the way it would refuse every attempt, so the daemon makes it no more. A close reason is held to Dispatch's bound at the call that carries it (`close_root` answers `CLOSE_REASON_TOO_LONG`, naming the bound and how far over the text is), so this is a refusal that check did not predict. Read its `reason`: on a status write the daemon writes the status all the same, so the status is set unless Dispatch refused the status itself, which the reason says — with the status set, only the reason beside it is on no issue, and you post what a person still needs yourself; with the status refused, the issue keeps the status it had while the daemon's own record reads the one the write carried, a disagreement no retry of the daemon's closes, so ask a person with `dispatch ask` to set it. On a message write nothing of what it carried reached the issue, and the `reason` gives its length and its first line, so post what a person needs yourself. |
|
|
32
32
|
| A reply on an ask you follow | Interpret the reply in the issue's design context. Answer in its thread (`dispatch comment --reply-to <comment id>`; under an open ask whose next move is yours, such as the approval request you must revise or hand back, `--reply-to-ask <ask id> --turn agent`, since a default-turn reply hands that request back to the human and a corrected `--summary` is then refused) where the reply carries a question, a disagreement, a correction or a fact you do not have, and whenever you are unsure; an approval, or an answer that settles the question with nothing left to say, draws no comment and no message back to the person who answered. Then adjust the plan or relay the reply via `envoy_publish` to the responsible worker's role token, which an answer needing nothing from you still needs; scope and product decisions remain with you. |
|
|
33
|
-
| `worker-died` | Its `role` and `phase`. That role's claim failed: its launches or prompts ran out, or its provider refused every turn of its session (its `failure.detail` reads `the provider refused <n> turns in a row: <message>`). For a phase worker the daemon holds the issue (phase `held`) and starts nothing more on it. It carries `failure` as well (the notice of a held phase, and that of a role which does not work the issue's phase; the one that ends a closed issue's production-check look carries neither `failure` nor `phase`, its `reason` naming the cause already): `cause`, one cause word of the seven the daemon chooses from (`launch_refused`, `died`, `never_registered`, `stale_plugin`, `prompt_retires_exhausted`, `provider_error`, and `unrecorded` for a failure recorded before the daemon kept a cause), `detail`, the sentence written beside that word, `death` and `startFailure`, what the runtime and the launcher last said of this claim where it recorded either, and `launchFailures`, `deaths`, `promptFailures` and `promptRetires`, each a `count` beside the `limit` it ran out at. The claim's record in `read_record` carries the same `failure`, and the issue's `heldFrom` names the phase the hold took it out of. Reassess the work, then decide with `retry_or_escalate`: `retry` when the failure looks agent-specific or transient, `escalate` to hand the held issue to the controller when it looks environmental. `reason` is optional on either decision: a `retry`'s reaches the restarted worker's task, so say in it what you changed or what you want done differently, and an `escalate`'s reaches the controller as the `escalation` key of the `held` notice that records it, so say in it why the tree cannot go on without a decision of the controller's. A `retry` of a claim that failed on refusals starts a **new session**, since resuming the one the provider refused would be refused again: that worker has read none of its own earlier work, and is told so in its first task, which names its branch and the handoffs to read. Expect it to re-read before it continues, and tell it anything only you know. |
|
|
33
|
+
| `worker-died` | Its `role` and `phase`. That role's claim failed: its launches or prompts ran out, or its provider refused every turn of its session (its `failure.detail` reads `the provider refused <n> turns in a row: <message>`), or its system prompt is too large for its pod's start frame (a `launch_refused` with no count at its limit, whose `detail` names the role, the size and the limit: only a shorter prompt starts it, so a `retry` before the prompt is cut fails again at once; `escalate` it). For a phase worker the daemon holds the issue (phase `held`) and starts nothing more on it. It carries `failure` as well (the notice of a held phase, and that of a role which does not work the issue's phase; the one that ends a closed issue's production-check look carries neither `failure` nor `phase`, its `reason` naming the cause already): `cause`, one cause word of the seven the daemon chooses from (`launch_refused`, `died`, `never_registered`, `stale_plugin`, `prompt_retires_exhausted`, `provider_error`, and `unrecorded` for a failure recorded before the daemon kept a cause), `detail`, the sentence written beside that word, `death` and `startFailure`, what the runtime and the launcher last said of this claim where it recorded either, and `launchFailures`, `deaths`, `promptFailures` and `promptRetires`, each a `count` beside the `limit` it ran out at. The claim's record in `read_record` carries the same `failure`, and the issue's `heldFrom` names the phase the hold took it out of. Reassess the work, then decide with `retry_or_escalate`: `retry` when the failure looks agent-specific or transient, `escalate` to hand the held issue to the controller when it looks environmental. `reason` is optional on either decision: a `retry`'s reaches the restarted worker's task, so say in it what you changed or what you want done differently, and an `escalate`'s reaches the controller as the `escalation` key of the `held` notice that records it, so say in it why the tree cannot go on without a decision of the controller's. A `retry` of a claim that failed on refusals starts a **new session**, since resuming the one the provider refused would be refused again: that worker has read none of its own earlier work, and is told so in its first task, which names its branch and the handoffs to read. Expect it to re-read before it continues, and tell it anything only you know. |
|
|
34
34
|
| `worker-stalled` | Its `role` and `reason`. The daemon's stall backstop acted on that worker's stalled turn: its agent had not stepped for longer than the `worker_stall_backstop_hours` this deployment gives the role, and most often the daemon ended the turn and brought the same session back on a new process. The `reason` is the record the daemon read — when the agent last stepped and how long ago that was, the bound it passed, when the turn began, and the last call the daemon saw, with its tool, its call id, when it started and whether it ended — and never a call's arguments, whose text the daemon keeps in no column. It says what the daemon did as well, which is not always a relaunch: where the daemon's wake pacing parked the replacement, the task was taken back and the launch that replaces the stalled process is queued, due at the moment the notice names, and that process runs on until the launch's turn, which may start nothing — a suspension waiting for the claim, a refused lifecycle recheck or the tree's close can end the claim there instead; where a suspension was already waiting for that turn, that suspension ran instead of a replacement and the claim is suspended with nothing queued for it, waiting on a resume; where the launch that replaces the process could not be written, the daemon is still retrying that launch; and where every try at that launch was refused, the claim has failed, and the `worker-died` that comes with it is yours to answer as that row says. It says what became of the stalled process too, for every end but the parked one: that it was stopped, or that the runtime did not confirm the stop, in which case that process may be running still and holding what it runs on — tell the controller of that one, because the daemon stops it again only at its next launch of that claim or at its next restart. No second notice follows any of these unless the daemon restarts while a relaunch is parked, which decides the claim again. The task that worker was serving is still owed to it, and what its return waits on is the one the notice names — the parked launch's turn, the retried launch, or a resume; the stall itself charged the claim nothing, and no phase moved: on every end but the failed one the phase goes on by itself and you start nothing. Your part is to read what the record says the agent was doing and to judge whether that work needs a decision of yours — a call that hung on something the plan did not foresee is one, a turn that comes back and finishes is not. A stall of your own session reaches you the same way, on your own issue; when the stalled claim is a tree's architect, the controller is told of it too. |
|
|
35
35
|
| `worker-silent` | Its `role` and `reason`. That worker stopped between turns rather than inside one: its process is up, it holds no task, and its agent has not stepped for longer than the `worker_silence_minutes` this deployment sets, so nothing in the daemon and nothing in that process was going to prompt it again. The `reason` is the record the daemon read — the issue, the role, the phase, when the agent last stepped and how long ago that was — and it ends with what the daemon wrote about it, read from the phase entry the role's phase row names: the start row that sends the work of that entry, where the worker's claim was never given it, or the start row that sends the phase's task again, where the claim is on that entry already, naming the entry where the row holds one. That row is written and the worker is coming back with that work: read the issue's record with the `legion` tool's `read_record` to see where the phase stands, and start nothing yourself. The one thing that still refuses the start is a suspension an operator holds over the claim, which the outbox reads when it runs the row and which the `reason` names: ask the operator to resume that claim, and message the role on its topic (`envoy_publish`) where its phase cannot wait. It comes once for each silence, and a worker that takes a step and then goes quiet again is told again. |
|
|
36
36
|
| `worker-background-stalled` | Its `role` and `reason`. That worker's own session reports background work of its own — an async job, a subagent, a background task — still running, and it has reported the same thing without change for longer than the `worker_background_hours` this deployment sets. The `reason` is the record the daemon read: the issue, the role, the phase, the kinds the session named, when it last reported them and how long ago that was. Nothing was sent to that worker and nothing will be sent for this: the daemon cannot tell a job that hung from a long one, so it names the worker to you and decides nothing. Your part is to read what the session says it is waiting on and to judge whether that work needs a decision of its own — a job waiting on a surface that does not exist, or on a person, is one; a long build or a long test run is not. Read the issue's record with the `legion` tool's `read_record` for where the phase stands, then either leave the work to finish or message the role on its topic (`envoy_publish`) with what you decide. The worker is not prompted by the silence repair while it reports such work, so nothing else is coming for it either. It comes once for each standing report: a worker whose reported work changes — a job that ends and another that starts — is told of again under the new report. |
|
|
@@ -35,7 +35,9 @@ you release it. Read the record, then choose the release.
|
|
|
35
35
|
`promptFailures`, and `prompt_retire_limit` bounds `promptRetires`. The count that reached its
|
|
36
36
|
limit is the budget that ran out, and the cause word says what spent it. The architect reads
|
|
37
37
|
the same `failure` in its own record and reads these limits nowhere, so name the limit when you
|
|
38
|
-
answer it.
|
|
38
|
+
answer it. A `launch_refused` with no count at its limit is a system prompt too large for its
|
|
39
|
+
pod's start frame, and its `detail` names the role, the size and the limit: only a shorter prompt
|
|
40
|
+
starts that role, so a release before the prompt is cut fails again at once.
|
|
39
41
|
3. **The release.** The `held` wake gives each release its price. On a root whose tree does not
|
|
40
42
|
linger, `set_status` to `todo` releases the hold and costs nothing: the issue returns to the
|
|
41
43
|
phase `heldFrom` names, that phase's role starts with its task, and the generation, the review
|