Skip to content

route claim-swarm sub-agents by each issue's model:/effort: labels - #6374

Merged
atomantic merged 1 commit into
mainfrom
cos/task-mtpfimg1/agent-87d05f0f
Sep 6, 2026
Merged

route claim-swarm sub-agents by each issue's model:/effort: labels#6374
atomantic merged 1 commit into
mainfrom
cos/task-mtpfimg1/agent-87d05f0f

Conversation

@atomantic

Copy link
Copy Markdown
Owner

Summary

  • Planners have been labeling issues model:/effort: and nothing consumed it. Every constant in dispatchLabels.js was producer-side — how to choose a label. The claim swarm fanned out N sub-agents and ran all of them at its own run's default, so model:heavy + effort:max bought the issue nothing.
  • Adds the consumer half as two shared forms split by audience: DISPATCH_HINT_READING_GUIDANCE (what the labels mean — safe for any agent handed labeled issues) and DISPATCH_HINT_FANOUT_GUIDANCE (that plus the one line only an orchestrator can act on). The fan-out form is the reading form plus a line, never a second copy of the vocabulary, and both render their tiers/levels from DISPATCH_MODEL_TIERS / DISPATCH_EFFORT_LEVELS.
  • Swarm block now carries each picked issue's labels out of Phase 1's listing through the partition step, tells the orchestrator to dispatch each fan-out agent at that issue's tier and budget, and requires the routing used to be named per issue in the run summary.
  • Preloaded open-issues data input carries the reading form, outside the <portos-task-data> fence since it is PortOS instruction about how to read the block rather than forge data. Which inputs earn it is declared on the catalog entry (carriesDispatchLabels) rather than sniffed from the id; it is charged against MAX_TOTAL_CHARS; and it is skipped when the prompt already embeds it, so a swarm run with open-issues selected doesn't state the same contract twice.

Not in scope

branch-reconcile is the repo's second fan-out orchestrator and needs the same treatment, but it also needs a label fetch in formatInFlightForPrompt plus a PROMPT_VERSIONS bump — filed as #6373.

Test plan

  • cd server && npm test — 2008 files, 39,914 passing.
  • New coverage: the definition-site test pins both forms against the tier/level arrays and asserts the fan-out form is the reading form plus one line; the swarm test asserts the block carries the shared constant verbatim and the per-issue summary requirement; the data-input test asserts the paragraph appears only for issue-bearing inputs, sits outside the untrusted fence, is absent for a non-orchestrating consumer, and is not duplicated when the prompt already carries it.

Planners have stamped `model:` and `effort:` dispatch labels on issues for a
while, but every constant in dispatchLabels.js was producer-side — how to CHOOSE
a label. Nothing told the agents that later read those labels what to do with
them, so a carefully-routed backlog was dispatched exactly as if it were
unlabeled: the claim swarm fanned out N sub-agents and ran all of them at its own
run's default, and `model:heavy` + `effort:max` bought the issue nothing.

Adds the consumer half as two shared forms that split by audience:
`DISPATCH_HINT_READING_GUIDANCE` (what the labels mean — safe for any agent
handed labeled issues) and `DISPATCH_HINT_FANOUT_GUIDANCE` (that plus the one
line only an orchestrator can act on). The fan-out form is the reading form plus
a line, never a second copy of the vocabulary, and both render their tiers and
levels from DISPATCH_MODEL_TIERS / DISPATCH_EFFORT_LEVELS so the reading prose
cannot drift from the validators.

Wired into the two places issues reach an agent:

- The swarm block (resolveSwarmBlock) now carries labels out of Phase 1's
  listing through the partition step and tells the orchestrator to dispatch each
  fan-out agent at its own issue's tier and budget, then name what it used per
  issue in the run summary.
- The preloaded `open-issues` task data input carries the reading form, outside
  the `<portos-task-data>` fence since it is PortOS instruction about how to read
  the block rather than forge data. Which inputs earn it is declared on the
  catalog entry (`carriesDispatchLabels`) instead of sniffed from the id, it is
  charged against MAX_TOTAL_CHARS, and it is skipped when the prompt already
  embeds it — a swarm run with open-issues selected would otherwise state the
  same contract twice.

branch-reconcile is the second fan-out orchestrator and needs the same treatment;
it takes a prompt-version bump plus a label fetch in formatInFlightForPrompt, so
it is filed as #6373 rather than rolled in here.
@atomantic
atomantic merged commit 6d32edd into main Sep 6, 2026
7 checks passed
@atomantic
atomantic deleted the cos/task-mtpfimg1/agent-87d05f0f branch September 6, 2026 06:46
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