Skip to content

feat: assign agent models by a measured rule (0.51.0) - #64

Merged
Shahinyanm merged 1 commit into
masterfrom
fix/agent-model-assignment
Jul 26, 2026
Merged

feat: assign agent models by a measured rule (0.51.0)#64
Shahinyanm merged 1 commit into
masterfrom
fix/agent-model-assignment

Conversation

@Shahinyanm

Copy link
Copy Markdown
Member

What

Five agents move from haiku to sonnet: tp-run, tp-api-surface-tracker, tp-dep-health, tp-doc-writer, and tp-incident-timeline.

That last one was inherit, meaning it silently took whatever model the session happened to be running — so a production incident investigation could land on haiku.

Why

The old 9/15/1 split had no stated basis, so there was no way to place a new agent without guessing. Two measurements on identical prompts through tp-run gave one:

Task Haiku Sonnet
List exported symbols, strict output format 19,020 tok · 9.4s — format exact 25,798 tok · 12.6s — added a verdict line the prompt forbade
Find a defect in a decision function 27,916 tok · 89s — narrow type issue 30,307 tok · 50s — the functional defect plus the follow-up

Haiku wins shape-bound work outright: cheaper, quicker, and more literal about the format. Sonnet wins the moment the answer requires deciding what matters — which is exactly where haiku's answer came back narrower.

How

The rule, now written into docs/agents.md:

  • haiku — output with a predetermined shape: a commit message, an orientation map, a session briefing, a coverage list, a chain of commits quoted without interpretation.
  • sonnet — anything that weighs, ranks, or explains.

tp-run sits in the second group because it exists to take work no specialist claimed, so its difficulty is unknown at dispatch time.

Risk

Cost goes up slightly for the five reassigned agents. Worth keeping in proportion: the gap between models is 8–26%, while dispatching general-purpose instead of a specialist costs 3x. The model is the small lever; the agent is the large one.

That also settles borderline cases — since the gap is small, they go to sonnet, because a wrong answer costs more than the model does.

Notes for reviewer

Two measurements are two data points, not a study. They agree with each other and with the direction of the change, but if a haiku agent starts producing thin work in practice, that is better evidence than this table and the line should move again.

The five staying on haiku were checked one by one against the rule rather than left alone by default.

Five agents move from haiku to sonnet: tp-run, tp-api-surface-tracker,
tp-dep-health, tp-doc-writer, and tp-incident-timeline — the last was
`inherit`, so it silently took whatever the session ran and could land on
haiku for a production incident.

The old split had no stated basis. Two measurements on identical prompts
through tp-run gave one:

  list exported symbols, strict format
    haiku   19,020 tok /  9.4s — format exact
    sonnet  25,798 tok / 12.6s — added a verdict line the prompt forbade

  find a defect in a decision function
    haiku   27,916 tok / 89s — narrow type issue
    sonnet  30,307 tok / 50s — the functional defect plus the follow-up

Haiku wins shape-bound work outright: cheaper, quicker, more literal about
the format. Sonnet wins once the answer requires deciding what matters,
which is precisely where haiku came back narrower.

So: haiku for output with a predetermined shape (commit message,
orientation map, session briefing, coverage list, commits quoted without
interpretation), sonnet for anything that weighs, ranks or explains.
tp-run is in the second group because it takes whatever no specialist
claimed — its difficulty is unknown at dispatch.

In proportion: the model gap is 8-26%, while dispatching general-purpose
over a specialist costs 3x. The model is the small lever. And since the
gap is small, borderline tasks go to sonnet — a wrong answer costs more
than the model does.
@Shahinyanm
Shahinyanm merged commit c6751b1 into master Jul 26, 2026
3 checks passed
@Shahinyanm
Shahinyanm deleted the fix/agent-model-assignment branch July 26, 2026 11:33
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