Skip to content

Warn before tasks run on extra usage, defer until reset - #18

Merged
jbutton merged 5 commits into
mainfrom
work/26-warn-before-tasks-run-on-extra
Nov 13, 2026
Merged

jbutton merged 5 commits into
mainfrom
work/26-warn-before-tasks-run-on-extra

Conversation

@jbutton

@jbutton jbutton commented Nov 13, 2026

Copy link
Copy Markdown
Owner

PRJ-26 is built and committed: the board now reads each agent's usage window, warns when an agent runs on paid extra usage, and acts on a new setting, usage.extra (allow, ask or defer). The 20 new tests pass. My one full run of npm run check -- --all had two failures; after the fix those two pass, but I haven't re-run the full check, so the board's own check is the final word.

How it detects, with no model calls:

  • Codex: reads the last token count in each saved conversation (both windows, reset times, whether credits are on), plus refusals. Your newest Codex session is read once a minute, so its window is known before any task runs it.
  • Claude Code: reads refused requests in the saved conversation, which carry the exact reset time. While answers keep coming, the only live signal is what Claude Code passes to its status line. The settings file the board already gives each Claude agent now points the status line at herdr-projects statusline. That keeps the window readings beside the task, then runs your own status line, so the agent's pane looks the same.
  • Other programs: no signal; the setting does nothing for them and show says so.

What you see, for every task:

  • The row says "On extra usage since 14:10".
  • details shows since when and until when.
  • board.notify fires once per task and window, with the event extra usage.
  • The header shows e.g. "Claude: extra usage since 14:10, resets 17:00".

The setting:

  • allow (the default): only the warnings above.
  • ask: the agent is stopped at once with its work kept, and the task waits for you. Carrying on lets it use extra usage until that window resets. While the program is on extra usage, a task won't start until you retry it.
  • defer: the next agent on worker.fallback that isn't on extra usage takes over. Otherwise the agent is stopped at once, waits, and carries on by itself when the window resets. If the reset time isn't known, it waits for you. A start is held in the queue without taking a slot, or goes to the fallback. A turn that ends because the usage limit was hit also waits for the reset.

The full write-up is in docs/extra-usage.md.

Where I left the plan:

  • defer stops the agent at once, as you decided, so there's no stop at the end of the turn except after a turn that ran out of allowance.
  • tests/main.rs was at the 300-line limit; I removed its one blank line so the new test module fits.
  • The limit.tokens test checks that a task stopped at its token limit stays stopped there, since defer no longer stops at the end of a turn.

Checks:

  • Full check, run once: 1389 passed, 2 failed. The new settings group pushed two settings-page tests past their fixed screen heights. I raised the heights by two lines and those areas now pass.
  • Real Claude Code 2.1.323: one short Haiku session using the board's status line. The window readings arrived and were kept (5h 63%, week 71%). It left one small conversation file under ~/.claude/projects for this worktree.
  • The new statusline command, run on a scratch board: it printed your own status line unchanged, and kept nothing when given a wrong token.
  • The real board on a scratch board: the header showed "Codex: extra usage since 12:17, resets 12:31". I wrote that record by hand from your newest real Codex reading, not through the board's own update.

Also noticed:

  • crates/flow/src/plan/build.rs: after the plan was approved, this agent stayed in the read-only sandbox until a second message.
  • docs/settings.md leaves check.again and merge.pushTimeout out of the repo file's list of allowed settings; docs/fallback.md and docs/gate.md still say "seven facts".
  • crates/board/src/board/update/actions.rs and tests/main.rs are now at the 300-line limit.
  • tests/coordinator*.rs: compiler warnings for unused top variables.

Task: PRJ-26 (herdr-projects/26)

jbutton and others added 5 commits November 13, 2026 12:17
Codex: the last token_count's rate_limits in its saved conversation (both
windows, their resets, and its credits), and a refusal after it. Claude
Code: a refused request's quotaLimits (the hard stop, with its exact
reset), and its status line input: the board's settings file for a Claude
agent now names `herdr-projects statusline` as its status line, which keeps
rate_limits beside the task (window-<role>.json) and then runs your own
status line command on the same input, so the pane shows yours. Each
program's window on the machine is kept in usage.json, with its episode of
extra usage (a window at 100% while answers are served) until it resets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The keeper's pass reads each working agent's usage window, keeps it as its
program's window, and marks the task while its agent is on extra usage:
its row says since when, `details` has a `usage` entry, board.notify is told
once per task and episode (`extra usage`), and the board's header shows each
program's window where it is known.

usage.extra (task, repo entry, you, the repo's file, built in `allow`):
- allow: today's behaviour, with the warnings.
- ask: the agent is stopped at once (the limits' own stop, `what: usage`),
  its work kept, and the task waits for you; carrying on is leave for that
  episode; no task starts on extra usage without your retry.
- defer: the next agent on worker.fallback not on extra usage takes over;
  else the agent is stopped at once and waits for its window, carrying on
  by itself at the reset (reset not known: it waits for you). A start is
  held in the queue without a slot until the reset, or goes to the
  fallback. A turn out of allowance waits for its window too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The page shows each area of settings as a group of its own, so the new
`usage.` area takes two more lines on the screens these tests size to fit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… setting

Review fixes:
- A defer hand-over to worker.fallback no longer takes the task's extra
  usage mark off before board.notify was told: a mark goes only once told,
  and the row says it only for the agent that is on it.
- A task stopped for extra usage follows usage.extra as it reads now: set
  from ask to defer while it waits, it waits for the window (not for you)
  and its line says so; back to ask, it waits for you again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jbutton
jbutton marked this pull request as ready for review November 13, 2026 14:42
@jbutton
jbutton merged commit a0bac5d into main Nov 13, 2026
4 checks passed
@jbutton
jbutton deleted the work/26-warn-before-tasks-run-on-extra branch November 13, 2026 14:42
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