Skip to content

fix(overnight): say stopped and exit 2 when a limit ended the run - #1171

Draft
sosidudku1 wants to merge 3 commits into
mainfrom
fix/ato-1323-overnight-limit-exit
Draft

sosidudku1 wants to merge 3 commits into
mainfrom
fix/ato-1323-overnight-limit-exit

Conversation

@sosidudku1

@sosidudku1 sosidudku1 commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

What

When a budget, time or step limit (or no progress) ended an overnight run, the task store records it as completed with a stopCause. atomic-agent overnight printed "overnight completed" and exited 0, so a script calling it took unfinished work for success. It now prints overnight stopped (<cause>) with the plain reason line and exits 2. The same goes for a resume the runner blocked because earlier attempts had already used the budget or the time (budget_spent: / time_spent:), and for credit_exhausted. Exit 0 stays for a run the agent finished on its own; 1 is still failed or cancelled. The help text lists the exit codes.

Why

A caller has to be able to tell "done" from "stopped at the limit". Linear: ATO-1323.

How it was verified

  • Updated and new tests in src/cli/overnight-progress.test.ts.
  • Not run yet: lint, tsc and vitest go in one combined pass on the second Mac.

Merge notes

Not yet checked on the second Mac.

The task store records a run a budget, time or step ceiling ended as
completed, with the cause beside it. The overnight command printed
"overnight completed" and exited 0 for it, so a script calling it took
unfinished work for a success. It now prints "stopped (<cause>)" with
the plain reason line and exits 2; 0 stays for a run the agent finished
on its own.

ATO-1323
…topped

Review: a resume the runner blocked with budget_spent: or time_spent:
still said "overnight blocked" and exited 1, while the same limit hit
mid-run exits 2. It now says stopped and exits 2 too. The help text
names credit_exhausted, which also exits 2.

ATO-1323

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant