Skip to content

fix(listener): cancel a manager whose wake mail failed - #682

Merged
TheGreatAxios merged 2 commits into
mainfrom
cl-11594-end-a-manager-the-listener-deployed-but-could-not-mail
Oct 27, 2026
Merged

TheGreatAxios merged 2 commits into
mainfrom
cl-11594-end-a-manager-the-listener-deployed-but-could-not-mail

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

When a wake mail from the listener to a manager it just deployed fails for any reason, the listener now cancels that manager. Before this change the manager stayed deployed with nothing to end it.

  • The listener's mail step no longer fails the body when a mail does not go. A new unwoken step after it cancels each manager whose mail failed. It uses the stock stop-run route (DELETE /workflows/runs/:runId) through the existing endRun helper, under the manage grant stock gives a deployment's creator. The step's output lists each cancelled run with the reason its mail failed, so it shows in the stock run events. The tolerant mail reply type Mailed now carries that reason, and the judge and code review share it.
  • The hub's claim (apps/hub/src/manager-state.ts) no longer treats a run as up once its cancellation has been requested. The hub mails such a run nothing and its own take is refused. The pull request's next event deploys a fresh manager that claims it, and so does the reconciler re-queuing the head, which has no verdict.
  • docs/ARCHITECTURE.md and the triage-manager README describe the behaviour. The user manual needed no change because nothing a person sees changes.

How it was verified:

  • bun --conditions=intx-src test packages/triage-manager apps/hub: 501 pass, 0 fail. New tests:
    • "a manager whose wake mail did not go is cancelled once, and the listener deploys no other for it": one deploy, one stop of that run, and the run and reason in the step's output.
    • "PostgreSQL: a manager being cancelled holds no pull request and takes none, so the next one claims it".
  • bun run test:chain: 8 pass, 0 fail. In the new scenario, "a manager whose wake mail failed is cancelled, and the next event deploys a fresh one that posts the verdict", the manager's public key is kept from being recorded, as when a sidecar never acknowledges a deploy. The manager run ends cancelled, and the listener's unwoken output names that run with the timeout as the reason. Nothing is written to the pull request meanwhile, and the next push deploys a second manager that posts Triage: Pass and ends the claim.
  • bun run check and bun run lint pass, with no new warnings.

Closes CL-11594

@linear-code

linear-code Bot commented Oct 27, 2026

Copy link
Copy Markdown

CL-11594

@TheGreatAxios
TheGreatAxios force-pushed the cl-11594-end-a-manager-the-listener-deployed-but-could-not-mail branch from 5a28e7c to 14f3eed Compare October 27, 2026 15:43
@TheGreatAxios
TheGreatAxios marked this pull request as ready for review October 27, 2026 15:43
@corbits-triage

Copy link
Copy Markdown
Contributor

Triage: Unsure

Waiting on:

  • checks are still running: check

Notes:

  • Risk: medium (3 recently fixed files)

@TheGreatAxios
TheGreatAxios force-pushed the cl-11594-end-a-manager-the-listener-deployed-but-could-not-mail branch from e46f474 to 00b0e90 Compare October 27, 2026 18:02
@TheGreatAxios
TheGreatAxios merged commit 2e2b08d into main Oct 27, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant