Skip to content

fix(agents): raise maxTurns ceilings that silently truncate swarm deliverables - #169

Open
midineutron wants to merge 1 commit into
rmzi:mainfrom
midineutron:fix/agent-maxturns-and-teammate-dispatch
Open

fix(agents): raise maxTurns ceilings that silently truncate swarm deliverables#169
midineutron wants to merge 1 commit into
rmzi:mainfrom
midineutron:fix/agent-maxturns-and-teammate-dispatch

Conversation

@midineutron

Copy link
Copy Markdown

Summary

Three agents' maxTurns ceilings are set below what a real 6-phase swarm consumes, so they exhaust their budget mid-report and return truncated final messages.

Found while running /pds:swarm end-to-end on a production repo (a ~1500-line OpenAPI spec resync, 11 acceptance criteria, 2 workers). Measured tool-call counts from that run:

Agent maxTurns Tool calls used Outcome
scout 15 27 Report never reached the orchestrator — Phase 6 deliverable lost
reviewer 25 39 Truncated; recovered after a manual follow-up SendMessage
validator 40 64 Truncated; recovered after a manual follow-up SendMessage

Why it matters

The failure is quiet and it lands on the deliverable, not the work.

The validator and reviewer had both finished their actual work — merging, testing, reviewing — and were cut off while writing it up. A follow-up message retrieved it. The scout was worse: its report never arrived at all, so the orchestrator recorded it as a failed agent and substituted its own observations. scout-report.md is one of the three artifacts the teardown gate checks for, so losing it degrades the gate to a no-op.

Note also that scout runs on haiku, which tends to use more tool calls to reach the same result, against the tightest ceiling in the roster.

Change

scout      15 -> 40
reviewer   25 -> 50
validator  40 -> 80

Sized above observed usage with headroom, and kept proportionate to existing roster values (orchestrator: 100, shepherd: 80, worker: 50).

These are ceilings, not budgets — raising them costs nothing on runs that don't need the turns, while hitting one silently destroys a report.

Scope

Frontmatter only, three one-line changes. No behavioral or prompt changes.

Not included

Other issues from the same run are filed separately rather than bundled here, since they need root-cause discussion rather than a mechanical fix:

  • worker.md hardcodes isolation: worktree, which fails with "WorktreeCreate hook failed: hook succeeded but returned no worktree path" — this makes pds:worker unspawnable.
  • Agent(name=...) is rejected for teammate-spawned orchestrators, which breaks the named-worker dispatch pattern documented in skills/swarm/SKILL.md Phase 3.

Three agents exhausted maxTurns mid-report during a real 6-phase swarm,
returning truncated final messages. Measured tool-call counts from that run:

  scout      maxTurns 15, used 27
  reviewer   maxTurns 25, used 39
  validator  maxTurns 40, used 64

The validator and reviewer recovered after a manual follow-up SendMessage —
the work was done, only the report was cut off. The scout did not: its report
never reached the orchestrator, so the single Phase 6 deliverable was lost and
the orchestrator had to substitute its own observations.

Raise the ceilings above observed usage:

  scout      15 -> 40
  reviewer   25 -> 50
  validator  40 -> 80

These are ceilings, not budgets. Raising them costs nothing when unused, while
hitting one silently destroys a deliverable that gates the teardown check.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xkhq5SW3R3Ufy2CVakq1uu

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

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