Multi-Agent Reliability: Fix the Handoffs Before the Model
Most multi-agent failures are orchestration failures, and a smarter model does not repair a handoff that never said what done means. Before I tune any model, I would implement four controls: typed handoffs, explicit state contracts, task-level evals and transactional rollback. GitHub's engineering deep dive, published on February 24, shows the same core pattern.
Where multi-agent workflows break
The deep dive covers what happens when a single coding assistant becomes several specialized agents. The pain points are practical, and none of them is about model intelligence:
- Handoffs are ambiguous, so downstream agents infer missing context.
- Shared state mutates without schema discipline, causing drift and duplication.
- Success checks run at the end of the run, so bad branches accumulate cost.
- Failed steps are hard to isolate, so recovery means "start over" instead of rollback.
The last one is the most expensive. "Start over" has the precision of turning the laptop off and on again, and it pays the full token bill every time. The replacement is a checkpoint after every passed gate, so a failure rolls back one step instead of the whole run.
One weak handoff can trigger a cascade of retries across the planner, implementer and verifier roles. That failure costs both tokens and time.
Controls mapped to failure patterns
Reliability comes from workflow design before model tuning. Each failure pattern gets one control and one rollback trigger.
| Failure pattern from GitHub deep dive | Reliability control | Implementation detail | Rollback trigger |
|---|---|---|---|
| Missing context between agents | Typed handoff envelope | Every agent emits goal, constraints, artifacts, done_criteria | Envelope missing required keys |
| Shared memory drift | State contract with versions | Keep state_version and an immutable event log per step | State schema validation fails |
| Late quality detection | Step-level eval gates | Run checks after each agent output, not only at the end | Eval score below threshold |
| Retry storms | Bounded retries + policy routing | Max retries per class (format, tool, logic) | Retry budget exhausted |
| Full restart recovery | Transactional checkpoints | Snapshot repo + plan after each passed gate | Gate fails after side effects |
The handoff envelope
Every inter-agent transfer uses a strict JSON envelope. An agent that infers missing context is guessing on the token budget, which is the most expensive way to read a ticket. The fix is a set of required keys, goal, constraints, artifacts and done_criteria, with the envelope rejected at the boundary when any of them is missing.
{
"handoff_id": "uuid",
"from_agent": "planner",
"to_agent": "implementer",
"goal": "Apply fix for flaky checkout test",
"constraints": ["no schema changes", "keep API stable"],
"artifacts": ["failing_test_trace.md", "target_file_list.json"],
"done_criteria": ["tests pass", "diff limited to 2 files"],
"state_version": 12
}
This mirrors GitHub's emphasis on explicit structure in tool inputs and outputs, and it keeps downstream behavior deterministic.
The state and eval loop
Checks run after every agent output, and retries have a budget. A retry loop without a budget is while (true) with an invoice attached. A max retry count per failure class (format, tool, logic) turns it into a decision: when the budget runs out, the workflow rolls back to the last checkpoint and escalates with a failure report.
Evals that run per step
Each step gets checked before the next agent sees its output. The format, tool and task evals look like this:
- Format Eval
- Tool Eval
- Task Eval
{
"eval_type": "format",
"check": "Output matches required schema",
"why": "Prevents parser/runtime failures in next agent",
"pass_criteria": "JSON schema validates without errors"
}
{
"eval_type": "tool",
"check": "Tool call used allowed inputs only",
"why": "Prevents silent side effects and permission drift",
"pass_criteria": "All tool inputs in allowlist"
}
{
"eval_type": "task",
"check": "Unit target passed for scoped files",
"why": "Catches regressions before next handoff",
"pass_criteria": "All targeted tests green"
}
The policy eval adds constraint checks such as no-depr-api and no-secret on top of the others.
| Eval type | Example check | Why it matters |
|---|---|---|
| Format eval | Output matches required schema | Prevents parser/runtime failures in the next agent |
| Tool eval | Tool call used allowed inputs only | Prevents silent side effects and permission drift |
| Task eval | Unit target passed for scoped files | Catches regressions before the next handoff |
| Policy eval | Constraints respected (no-depr-api, no-secret) | Keeps compliance and security intact |
A deprecation warning lets a bad step pass with a note attached. My call is to make it a hard stop.
Treat deprecated APIs and deprecated workflow patterns as an immediate eval failure, not a warning. When an agent proposes a deprecated hook, function or integration path, fail fast and route it back with a replacement hint in the envelope.
Agent lifecycle states
Every run ends either checkpointed and back to idle, or rolled back and escalated with a report. No state leads to "start again from scratch".
Migration checklist
- Define typed handoff envelope schema
- Implement state versioning and immutable event log
- Add step-level eval gates after each agent output
- Configure bounded retry budgets per failure class
- Implement transactional checkpoints with rollback
- Add deprecation check to policy eval
- Wire eval results into monitoring/alerting
What I learned
- Multi-agent reliability is mostly an interface design problem: handoff contracts beat prompt tweaks.
- State versioning plus event logs makes incident replay and root cause analysis much faster.
- Step-level evals reduce blast radius and token waste because bad branches are cut early.
- Rollback has to be first-class. Without it, every failure becomes a full restart.
- A deprecation gate is cheap insurance against subtle breakage during upgrades.
Related posts
- Netomi enterprise lessons playbook
- Flowdrop agents review
- Agentic AI without vibe coding
References
- https://github.blog/ai-and-ml/github-copilot/lessons-from-githubs-multi-agent-system/
- https://github.blog/engineering/how-github-engineering-uses-mcp-github-copilot-to-ship-faster/
- https://docs.github.com/en/github-models/prototyping-with-ai-models
- https://modelcontextprotocol.io/specification/2025-06-18/schema
