Skip to content

Waiting runs go on by themselves, and texts say what actually happens - #924

Merged
nambok merged 5 commits into
mainfrom
waits-go-on-by-themselves
Dec 1, 2026
Merged

nambok merged 5 commits into
mainfrom
waits-go-on-by-themselves

Conversation

@nambok

@nambok nambok commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Runs that wait on a person now go on by themselves when the input arrives, and the texts that still handed people work CoderHelm does (or promised what didn't happen) say what actually happens.

Rebased onto main after #918 merged; it reuses common::rendered::{person_text, clip} from there.

Changes

  • Waiting runs wake by themselves (common::run_wake, gateway/routes/run_wake.rs):
    • A comment or reply on the ticket of a run waiting on a person resumes it, unless a person stopped the run or put its PR back to draft (only their Retry or ready undoes that). Jira comments carry the wait to the worker (resumes, waiting_for), and the run they start takes up the waiting run's plan and branch the way Retry does. A plain comment on a GitHub issue whose run waits now does the same (it used to be ignored unless it mentioned CoderHelm). The worker treats any reply to a waiting run as its answer, except a status-only note or "done elsewhere".
    • Access granted on GitHub (repositories added to the installation, permissions accepted, the app installed again or unsuspended) and a repository turned on in Repositories wake the runs that waited for that access.
    • Saving usage limits that allow runs wakes the runs that waited on the limit, and the worker's 15-minute sweep starts them once the team's limit allows runs again (so a new month resets them).
    • A run whose change closed goes back to waiting when the change is reopened, and goes on when it merges; a changed ticket starts a new run. The wait no longer says "press Retry". Only a run whose wait is that stop is read this way: a run keeps the change it waited on after it went on, so a later question, approval or person's stop is left alone.
    • An answered approval (dashboard or signed link) resumes the same run with the work it kept, so the one-time grant applies.
    • An alert run resumes when its alert fires again and closes when it clears. Its wait says what to do first, then Retry on the run page, since an alert has no ticket thread.
    • A woken run marks the waiting run superseded with a conditional write, so two events never start two runs. If its new run can't be queued, it goes back to waiting with the key and ending it had (run_wake::put_back), so the next event, sweep or Retry starts it. A woken security fix run starts as Retry starts it, as a new request for its unit's findings.
  • Wait actions (run_recovery, run_fail, worker waits): no more "then press Retry" or "put it right". Each action names the one thing to do and where, and says the run continues by itself. Only an approval and a person's own stop of the run stay as decisions made where they are made.
  • Merged-ticket notes: the wait asks for a reply and says the run continues when it arrives. The covered note says a reply that asks for work starts the run by itself.
  • Wrong-repo note: names the place (a Repo: owner/name line in the ticket's description, which the repo pick reads first; editing the ticket starts a new run). The "why that repo" text is cut at a word (clip), here and where the pick reason is made. "Turn it on in Repositories and re-run" now says the run continues once the repository is on.
  • Model text out of person notes: the tests-and-scope note lists what is wrong (each item's first sentence). The coding model's instructions ("Put it back with restore_file (omit from_ref)", "say why in your Evidence") stay in the fix round's prompt only.
  • Description tool in fix rounds: the coder gets update_pr_description in every fix round on a pull request, with the same guard as the feedback round. A round CoderHelm started asks for a rebuild from the branch, and the round's caller rebuilds the description. The round note tells the model to use the tool. The hand-off check now also catches "no tool that edits the PR description" and "someone needs to paste in ...".
  • Outside-change report: adding PR labels is CoderHelm's own work whatever workflow the label starts (only a label whose item names production, a release or a publish, such as deploy-prod, stays the team's call). An unblock that ends in "or run the command yourself" or "or a person runs the command" is cut to its one way.
  • Updater: a stack that is still working, or still finishing an earlier rollback, makes an update wait and retry by itself with the throttling backoff, never "press Update again". An update that rolled back because AWS throttled it schedules its own retry. A failed log-reader update stack in another account gets one action for an AWS admin (delete and create again, run the update again, or continue the rollback, depending on its state; a rollback still running is told to wait), since CoderHelm's role there only reads.
  • OpenAPI example: the RunWaitingOn.detail example no longer says "Mark it ready once".
  • Guards: person_text now also fails on "put it right", "and re-run", "press Update again", "delete the failed stack, then", "add PR label", "no tool that edits", "paste in the replacement", and on words written for the model ("(omit ...)", "in your Evidence", "put it back with ...").
  • Incident case wz_waits_go_on_by_themselves with its page.

Verification

  • cargo fmt --all --check, rustfmt --check --edition 2021 worker/src/passes/incidents/*.rs
  • cargo clippy -p common -p worker -p gateway --all-targets -- -D warnings
  • cargo test -p common -p worker -p gateway
  • python3 -m unittest discover -s lambda/tests
  • brand_spelling.py, domain_examples.py

@nambok nambok added the ch-review CoderHelm reviews this pull request label Nov 30, 2026
coderhelm[bot]

This comment was marked as outdated.

@nambok
nambok force-pushed the waits-go-on-by-themselves branch from aa3af31 to ec42334 Compare November 30, 2026 22:24
coderhelm[bot]

This comment was marked as outdated.

@coderhelm
coderhelm Bot dismissed their stale review November 30, 2026 22:32

Superseded by CoderHelm's latest review

@nambok
nambok force-pushed the waits-go-on-by-themselves branch from ec42334 to c3c13cb Compare December 1, 2026 03:07
coderhelm[bot]

This comment was marked as outdated.

@coderhelm
coderhelm Bot dismissed their stale review December 1, 2026 03:15

Superseded by CoderHelm's latest review

@coderhelm

coderhelm Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Auto-merge
New commit. Waiting for CoderHelm to review it before merging.
Commit into main. Merges on its own once every item is done.
Stop auto-merge or comment @coderhelm stop auto-merge.

coderhelm[bot]

This comment was marked as outdated.

A run waiting on a person resumes when what it waits for arrives: a
comment or reply on its ticket (Jira, or a plain comment on the GitHub
issue), access granted on GitHub or a repository turned on, or usage
limits saved that allow runs. Wait actions name the one thing to do and
where, never "then press Retry".

The wrong-repo note names the `Repo:` line and cuts its reason at a word.
Tests-and-scope notes no longer quote the coding model's instructions.
Fix rounds get update_pr_description with the feedback round's guard.
PR labels are CoderHelm's to add, and an unblock never ends in "or run
the command yourself". The updater waits out a busy stack and retries a
rollback caused by throttling by itself; a failed update stack in another
account gets one AWS admin action. person_text guards each of these texts.
…elves

Runs waiting on the usage limit start again from the 15-minute sweep once
the team's limit allows runs, so a new month resets them. A run whose
change closed goes back to waiting when the change is reopened, and goes
on when it merges. An answered approval resumes the same run with the
work it kept. An alert run resumes when its alert fires again and closes
when it clears; its wait says what to do first, then Retry on the run page.
…ange's stop is read as one

- A wake (gateway event or the worker's limit sweep) that marked the waiting
  run superseded but couldn't queue its new run puts it back to waiting, with
  the status key and ending it had, only while it still holds that wake's
  write (common::run_wake::put_back). The ticket is serialized before the
  write, so only the send can fail after it.
- A woken security fix run starts as Retry starts it: a new request for its
  unit's findings (security::retry_event), not its ticket again.
- The change-wait sweep reads a run as "its change closed" only when its wait
  is that stop (change_wait::waits_on_close). A run keeps the change it
  waited on after it went on, so a later question, approval or person's stop
  is never overridden.
- A comment no longer restarts a run a person stopped or put back to draft
  (HumanOnly::PersonAction); only that person's Retry or ready does.
- A label item that names production, a release or a publish in any word
  (deploy-prod, release, CI:DEPLOY_PRODUCTION) stays the team's call.
- An update stack still rolling back (_IN_PROGRESS) is told to wait, never
  to update again or delete.
- one_way finds its cut in an ASCII-lowercased copy, so the offset is
  always a char boundary of the text it cuts.
The stack-fix asserts in live::permissions and the wz incident case no
longer interpolate the text built from the (invented) account id into
their failure messages, and the incident's round summary local is named
round_summary rather than account.

@coderhelm coderhelm Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approved with notes 31ee453 (superseded by later commits)

None => {}
}
}
// Runs that stopped because their change closed: reopened, they wait

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💬 Nit: Reopened runs are counted as resumed (correctness)

out.resumed += check_closed(state).await adds every run that moved to the sweep's resumed total. That includes runs that were only put back to waiting because their change was reopened, and those have not resumed. The log line resumed = ... at the end of check_all therefore overstates how many runs went on. Nothing in the code branches on this count, so it is a small logging inaccuracy.

@nambok
nambok merged commit 48f4212 into main Dec 1, 2026
18 checks passed
nambok added a commit that referenced this pull request Dec 1, 2026
Conflicts with #924's merged commits are resolved on this branch's side:
the token-limit pause replaces the unknown-error stop and widens the
limit sweep's filter. The tree equals main plus this branch's own two
commits.
nambok added a commit that referenced this pull request Dec 1, 2026
…ror reads as one a person must repair (#937)

* A hand-off to a person is typed, and CoderHelm owns its own limits

A hand-off is a PersonOnly from a closed set (a named permission an owner or
admin grants, a product decision, an approval the rules require, a credential,
work someone else holds, a real-world action), built only through
common::person_only. Words about CoderHelm's sandbox, allowlist, budgets,
tools, CI use, labels, tests or reads make an OwnProblem instead: an internal
alert and one run-page line. The person gate, hand-backs and a fix round's
NEEDS A PERSON line all go through it.

On its own pull request the reviewer blocks only on what a route can satisfy
(review_feasible). A pull request with no progress for a day is diagnosed,
retried along its next route and alerted (own_problems::check on the sweep).
Hand-offs are counted per team by reason, own problems by subject, with the
time each pull request spent blocked.

Incident case xd_own_limits_never_a_persons.

* Waiting runs go on by themselves, and texts say what actually happens

A run waiting on a person resumes when what it waits for arrives: a
comment or reply on its ticket (Jira, or a plain comment on the GitHub
issue), access granted on GitHub or a repository turned on, or usage
limits saved that allow runs. Wait actions name the one thing to do and
where, never "then press Retry".

The wrong-repo note names the `Repo:` line and cuts its reason at a word.
Tests-and-scope notes no longer quote the coding model's instructions.
Fix rounds get update_pr_description with the feedback round's guard.
PR labels are CoderHelm's to add, and an unblock never ends in "or run
the command yourself". The updater waits out a busy stack and retries a
rollback caused by throttling by itself; a failed update stack in another
account gets one AWS admin action. person_text guards each of these texts.

* Usage-limit, reopened-change, approval and alert waits go on by themselves

Runs waiting on the usage limit start again from the 15-minute sweep once
the team's limit allows runs, so a new month resets them. A run whose
change closed goes back to waiting when the change is reopened, and goes
on when it merges. An answered approval resumes the same run with the
work it kept. An alert run resumes when its alert fires again and closes
when it clears; its wait says what to do first, then Retry on the run page.

* A woken run that couldn't be queued waits again, and only a closed change's stop is read as one

- A wake (gateway event or the worker's limit sweep) that marked the waiting
  run superseded but couldn't queue its new run puts it back to waiting, with
  the status key and ending it had, only while it still holds that wake's
  write (common::run_wake::put_back). The ticket is serialized before the
  write, so only the send can fail after it.
- A woken security fix run starts as Retry starts it: a new request for its
  unit's findings (security::retry_event), not its ticket again.
- The change-wait sweep reads a run as "its change closed" only when its wait
  is that stop (change_wait::waits_on_close). A run keeps the change it
  waited on after it went on, so a later question, approval or person's stop
  is never overridden.
- A comment no longer restarts a run a person stopped or put back to draft
  (HumanOnly::PersonAction); only that person's Retry or ready does.
- A label item that names production, a release or a publish in any word
  (deploy-prod, release, CI:DEPLOY_PRODUCTION) stays the team's call.
- An update stack still rolling back (_IN_PROGRESS) is told to wait, never
  to update again or delete.
- one_way finds its cut in an ASCII-lowercased copy, so the offset is
  always a char boundary of the text it cuts.

* A run the token limit refuses pauses and goes on by itself, and no error reads as one a person must repair

A model call refused by the team's monthly token limit ("limit reached")
was read as an error nobody knew, so the run stopped as "an error it
doesn't know how to repair ... put it right, then press Retry" and waited
on a person past the month's turn.

- The refusal is a typed pause (common::token_room, Kind::TokenLimit):
  the run keeps its continuation and resumes in place, from the step that
  was refused, when the month turns or the limit is raised. #924's
  wake_limit_waits hands these waits to token_room::wake_team.
- New runs wait for token room when what is left is less than a run of
  their kind takes; a run under way waits before building; runs in
  progress come first on what is left.
- Warnings at 80% and 95%, once each a month, with the day the limit runs
  out at this pace; /api/usage gives warn_level and projected_at.
- A schedule at 00:00 and 00:01 UTC on the 1st sends the sweep; a saved
  limit sends it at once; a paused run gets no reminder.
- A teammate's branch is left as it is: the run works on <branch>-N and
  says so once.
- An error nobody classified is CoderHelm's own problem: retried with
  longer waits, then parked with an internal alert (#930's own_problems);
  the generic frame is gone and person_text refuses it.
- Runs an older release stopped this way are found by their stored words
  and resumed after the deploy.
- Incident case xg_token_limit_pauses_and_resumes.

* A paused run reads as paused in the runs list and the palette, and sends run.paused

- RunSummary gains pause (the list reads waiting_on), and the search the
  command palette uses carries it too, so a run paused on the token limit
  is never listed as waiting for an answer.
- A pause sends the new webhook event run.paused, with its line in error;
  run.needs_input stays for waits a person ends. Both are in the catalog,
  so the OpenAPI document lists them.
- The event scrubber no longer redacts the plain word after "token"
  ("token limit"); a credential after it still is.

---------

Co-authored-by: coderhelm[bot] <272032808+coderhelm[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ch-review CoderHelm reviews this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants