Skip to content

feat(agent-runs): let helpers draw shared turns as they work - #824

Merged
astyfx merged 3 commits into
mainfrom
feat/team-turns-30
Oct 25, 2026
Merged

astyfx merged 3 commits into
mainfrom
feat/team-turns-30

Conversation

@astyfx

@astyfx astyfx commented Oct 25, 2026

Copy link
Copy Markdown
Member

Summary

Team turns keep their 30 / 100 limits, but a supervised helper no longer reserves almost the whole shared budget when it starts. Helpers draw turns as they work, a person's replies in the main run no longer count, and the Team turns warning follows spent turns.

Changes

Features

  • agent-runs: a supervised helper holds only its first two turns (TEAM_LIMITS.helperStartTurns) and draws each later turn from the shared budget as it starts, up to its own max turns, while one turn stays free for the parent to integrate. Several helpers can now work at once with the default request of 30 turns; before, the first one reserved remaining - 1 and the second was refused.
  • agent-runs: a person's reply in the main run spends no shared turn, matching the run's own turn count. Replies to a helper still count.

Fixes

  • agent-runs: a helper's turns, replies included, never exceed its own max turns.
  • agent-runs: a helper that reached its own max turns, or for which only the parent's integration turn is left, ends with turn-cap-reached on a dispatch, a reply in its task or the Reply control, so its parent reads a finished child instead of waiting on a blocked one. A paused parent or a released reservation refuses the turn without ending the helper.
  • agent-runs: the Team turns warning and meter value follow spent turns, not a helper's held start turns. The budget explanation (en/ko), the model-facing team-limits instruction and the docs describe the new accounting.

Test Evidence

  • bun test tests/agent-run-*.test.ts tests/delegated-*.test.ts tests/adaptive-*.test.ts tests/run-team-limits-ui.test.tsx: 848 pass, 0 fail. New cases: concurrent default-request helpers, drawing past held turns, ending when only the parent's turn is left, own max turns with replies, paused parent keeps the helper, Reply control at the cap, replies in the main run spend nothing, helpers' turns halt the run and Extend continues it, warning ignores held turns.
  • Mutation checks: removing the own-max-turns guard, the stop-reason check, the Reply-control stop or the dispatch stop each fails its new test.
  • bun run typecheck, bun run lint (warnings only, in untouched files), bun run check:i18n: pass.
  • bun run build:pages: pass.
  • Local full bun test: 9248 pass, 205 fail; the failures are process/timing tests (CLI probes, ACP, Lens, git scripts) that pass when rerun alone, none in the changed area. CI is the authority.
  • Independent review on the other provider (Codex) of each commit; its findings are fixed in the third commit and re-verified.

Notes

  • Reservations saved by the previous code (capacity up to 30, child max turns equal to it) still parse and project; no migration is needed.
  • Known follow-up: a helper for which only the parent's turn is left ends even if another active helper still holds up to two unused start turns that would come back when it finishes. Waiting for them would need a helper wait state; the case arises only at the very end of a team budget.
  • Not verified: a real provider-backed helper end to end, and the rendered Team turns panel (layout unchanged; warning rule and copy only).

🤖 Generated with Claude Code

astyfx and others added 3 commits October 25, 2026 16:40
A supervised helper used to reserve min(requested, remaining - 1) turns at
start. With the default request of 30 the first helper held nearly the whole
budget, so a second helper was refused and a person's reply was refused while
it worked, although helpers used about one turn.

A helper now holds only its first two turns and draws each later turn from the
shared budget as it starts, up to its own max turns, while one turn stays free
for the parent to integrate. A helper that would need that turn stops with
turn-cap-reached instead of getting stuck. A person's reply in a primary run no
longer spends the shared budget, which matches the run's own turn count; a
delegated run's reply still draws on it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The team turns warning and meter value counted reserved turns as used, so one
starting helper turned the budget amber. Both now follow spent turns, and the
budget explanation says replies do not count and helpers draw as they work.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Once a helper could draw past its held start turns, nothing capped its replies:
a reply does not raise a run's turn count, so a blocked helper with max turns 1
took replies from the shared budget until the parent's turn. A helper's turns,
replies included, now never exceed its own max turns.

A helper that cannot take another turn because it reached its own max turns or
only the parent's integration turn is left ends at its cap, on a dispatch, a
reply in its task or the Reply control, so its parent reads a finished child
instead of waiting on a blocked one. A paused parent or a released reservation
refuses the turn without ending the helper.

The reply exemption copy now says it covers the main run only; replies to a
helper still count.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@astyfx
astyfx requested a review from a team as a code owner October 25, 2026 08:03
@astyfx
astyfx requested review from heath-s and schang124 and removed request for a team October 25, 2026 08:03
@upwind-code-us

upwind-code-us Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Upwind Upwind IaC Scan - ✅ Passed

0 newly introduced misconfigurations · 0 resolved · 0 total in this PR vs main

View full analysis in Upwind Console →

Scan completed in 1s

Scan history (1 scan)
Commit Scanned at New Resolved Net
17e7ff8 < 2026-10-25 08:03 UTC 0 0 0

Last scanned: 17e7ff8 · 2026-10-25 08:03 UTC

@heath-s heath-s left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved

@astyfx
astyfx merged commit ceb03c5 into main Oct 25, 2026
6 checks passed
@astyfx
astyfx deleted the feat/team-turns-30 branch October 25, 2026 10:50
@astyfx astyfx mentioned this pull request Oct 25, 2026
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.

2 participants