How removing a choice fixed a broken agent
In microsoft/amplifier-foundation, session-analyst is the REQUIRED agent for analyzing, debugging, searching, and repairing Amplifier sessions — performing transcript surgery to recover sessions with orphaned tool calls, ordering violations, or incomplete assistant turns.
And the way it was built to do that surgery is where the story turns.
The agent's frontmatter sets model_role to fast, with a Haiku-class model as its top provider preference. It is a quick, cheap model doing delicate surgery — and that speed is the fact the whole story hinges on.
A fast model is fine — until it is handed a choice it can get wrong.
The repair capability arrived with a transcript parser and a diagnostic engine — but it gave the agent TWO paths: a safe Python repair script, and a documented manual fallback for hand-editing transcript.jsonl.
Two doors. The audience now knows both before the wrong one gets chosen.
Per the fix commit's own rationale, the Haiku-class fast model was choosing manual JSONL editing instead of the Python tool, which “made broken sessions worse.” The removed guidance admitted it in plain text.
So the tool built to repair sessions was breaking them further. What do you fix?
Rather than teaching the model to behave, the fix removed the manual procedures and the “When to Fall Back to Manual Repair” escape hatch outright — a net removal of guidance across two files.
Take capability out of the context, and the wrong choice disappears with it.
With the manual option gone, the guidance leaves a single script-only path and an explicit prohibition. If the script fails, the agent reports the error and stops — it has nowhere wrong left to go.
The correct action became the only available action.
By removing the choice, the fix takes the decision away from the fast model. It can no longer pick wrong — because there is nothing wrong left to pick. Safety came from deleting the option, not from a smarter agent.
The leverage was not intelligence — it was what the agent could reach. Remove the wrong door instead of teaching the agent to avoid one, and the mistake becomes impossible by construction.
Delete the option. Keep the outcome.
Source repo: microsoft/amplifier-foundation (verified: git remote -v → origin = git@github.com:microsoft/amplifier-foundation.git)
Feature status: Shipped / in main-line agent guidance Shipped
Research performed:
wc -l agents/session-analyst.md (399 lines) and sed -n '25,40p' agents/session-analyst.md (model_role: fast; claude-haiku-* top preference)git show 62fde35~1:agents/session-analyst.md | grep -n 'Manual repair fallback\|Manual rewind procedure'git log -1 --format='%B' 62fde35 ("made broken sessions worse... eliminate the decision point entirely")git show 62fde35 --stat / --numstat (87 insertions / 196 deletions across 2 files)git show 62fde35 -- agents/session-analyst.md | grep -n 'proven to break sessions'grep -n 'MANDATORY: Script Only\|NEVER attempt to manually edit transcript' agents/session-analyst.mdGaps: No repository artifact quantifies HOW MANY sessions the manual path broke; the "made worse" / "break further" claims are grounded in the fix commit message and the removed guidance text authored by the maintainer. The exact PR number for the enforcement fix (62fde35) is not embedded in its subject. Runtime model may vary by provider selection (haiku-* is the top preference; the commit characterizes it as "Haiku-class").
Primary contributor: Brian Krabach <brkrabac@microsoft.com> — author of commits 81c05d3, 8d950ae, 62fde35, and 2679c9b.