<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:media="http://search.yahoo.com/mrss/"><channel><title>Agents' Codex</title><link>https://agentscodex.com/tags/agent-routing/</link><description>Practical, no-hype insights on AI agents — cost optimization, multi-agent architecture, and real-world operations.</description><generator>Hugo -- 0.166.0</generator><language>en-us</language><lastBuildDate>Fri, 25 Sep 2026 07:36:40 -0300</lastBuildDate><atom:link href="https://agentscodex.com/tags/agent-routing/index.xml" rel="self" type="application/rss+xml"/><item><title>State-Aware A2A Routing: How Sprix SAGE Decides Mid-Task</title><link>https://agentscodex.com/posts/2026-09-18-state-aware-a2a-routing-sprix-sage-router/</link><pubDate>Fri, 18 Sep 2026 06:00:00 -0300</pubDate><author>Agents' Codex</author><guid>https://agentscodex.com/posts/2026-09-18-state-aware-a2a-routing-sprix-sage-router/</guid><category>a2arouting</category><category>agentrouting</category><category>stateawareorchestration</category><category>multiagentnetworks</category><description>A2A routing stops at discovery. Sprix SAGE adds checkpoint-aware SELF, COLLABORATE, and HANDOFF modes that re-route in-flight work across multiple agents.</description><content:encoded><![CDATA[<p><strong>TL;DR</strong></p>
<ul>
<li>Sprix SAGE Router adds checkpoint-aware routing on top of the A2A protocol, cutting wasted work by 43% versus a progress-masked baseline.</li>
<li>Three decision modes (SELF, COLLABORATE, and HANDOFF) pick the cheapest continuer based on completed work, artifact portability, and contextual trust.</li>
<li>Contextual trust (requirement-conditioned posteriors) reaches a Brier score of 0.0125 versus 0.0355 for naive reputation.</li>
</ul>
<p>Most multi-agent stacks treat routing as a pre-execution step: discover agents, form a team, run; the A2A protocol, now a Linux Foundation project with 25,831 GitHub stars, hands you discovery and JSON-RPC transport, then stops [2]. When a task runs long and a specialist stalls, the stack cannot answer one question: who takes over? Sprix SAGE Router fills exactly that gap, adding checkpoint-aware SELF, COLLABORATE, and HANDOFF decisions against a live model of completed work. The real value of A2A routing is not transport; it is knowing which agent should keep working once the DAG is already half-done.</p>
<h2 id="the-routing-gap-why-a2a-discovery-isnt-enough">The Routing Gap: Why A2A Discovery Isn&rsquo;t Enough</h2>
<p>The A2A protocol, maintained by Google under the Linux Foundation, standardizes agent discovery and JSON-RPC 2.0 communication through Agent Cards [2]; that part works. What the protocol does not provide is a decision layer; once an agent is running, A2A holds no opinion about whether the incumbent should continue, recruit help, or hand the task to someone better suited. Should it? Nobody specified.</p>
<p>Static coalition formation shares this blind spot: frameworks like AutoGen model multi-agent conversation, and research systems such as DyLAN and GPTSwarm optimize team composition before anything runs [6]. None of them reconfigure mid-task with an explicit model of what has already been finished; that pre-execution decision is where the failure modes hide on long, multi-requirement jobs, and they are not subtle when they surface.</p>
<p>Consider a feature build that moves from planner to coder; if the coder stalls halfway through, a discovery-only stack either waits or blindly re-dispatches. It cannot tell whether the half-written code is portable to another agent, nor whether restarting means paying for completed requirements a second time [3]. Portability, not progress, is the missing signal: SAGE&rsquo;s premise is that these calls belong to execution state, not static metadata.</p>
<div class="alert alert-alert">
  <p class="alert-heading">ALERT</p>
  <p>SAGE is a policy layer, not a transport. It assumes A2A handles discovery and messaging, then adds routing decisions on top.</p>
</div><h2 id="three-routing-modes-that-decide-who-keeps-working">Three Routing Modes That Decide Who Keeps Working</h2>
<p>Every routing decision is weighed against the same objective, then committed to one of three modes [1]. SELF means the incumbent continues: its capability and context already cover the remaining work. COLLABORATE recruits peers while the incumbent keeps ownership. HANDOFF transfers ownership outright when a specialist&rsquo;s edge outweighs the rework cost of migration: the specialist advantage, minus the transfer loss.</p>
<p>Because the three modes share one auditable objective, the choice is a comparison rather than a heuristic; what differs is assumed carry-forward. When ownership stays with the incumbent, completed artifacts count in full; when it transfers, a portability factor discounts how much of that work survives the handoff [1]. (The discount is the whole trick.)</p>
<table>
	<thead>
			<tr>
					<th>Mode</th>
					<th>Ownership</th>
					<th>When it wins</th>
					<th>Key cost</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>SELF</td>
					<td>Incumbent keeps</td>
					<td>Context and capability are enough</td>
					<td>No rework, accepts stall risk</td>
			</tr>
			<tr>
					<td>COLLABORATE</td>
					<td>Incumbent keeps</td>
					<td>Needs help, can delegate</td>
					<td>Coordination overhead</td>
			</tr>
			<tr>
					<td>HANDOFF</td>
					<td>Transfers to peer</td>
					<td>Specialist edge exceeds transfer loss</td>
					<td>Partial rework from portability</td>
			</tr>
	</tbody>
</table>
<figure>
    <img loading="lazy" src="/images/posts/2026-09-18-state-aware-a2a-routing-sprix-sage-router/image-1.jpg"
         alt="Three routing modes: self, collaborate, handoff branching from a single agent state evaluation"/> <figcaption>
            <p>Decision flow for Sprix SAGE&rsquo;s state-aware A2A routing</p>
        </figcaption>
</figure>

<h2 id="checkpoint-aware-state-the-difference-between-progress-and-position">Checkpoint-Aware State: The Difference Between Progress and Position</h2>
<p>SAGE&rsquo;s ExecutionState tracks active agents, active assignments, completed requirements, and in-flight requirements with their progress and quality metrics [3]; it also records per-artifact transferability. This is what lets the router distinguish a checkpoint from a vague progress bar: coarse progress says the task is 60% done, while checkpoint-aware state says which nodes are done and whether their output can move.</p>
<p>Artifact reuse is the mechanism that prevents double-charging. When the owner keeps an artifact, reuse equals the completed fraction alone; when ownership changes, reuse equals that fraction multiplied by a transferability term, reflecting the risk the next agent redoes part of the work (a portability discount) [4]. Without this discount, every handoff would look ruinously expensive and the router would almost never delegate.</p>
<p>The upshot is a continuation-cost projection per candidate, built from what is finished, what is in flight, observed quality, and whether artifacts survive a transfer; that projection feeds the utility comparison across all three modes.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#75715e"># Pseudocode: reusing completed artifacts to project continuation cost</span>
</span></span><span style="display:flex;"><span>reuse <span style="color:#f92672">=</span> completed_fraction                   <span style="color:#75715e"># owner retained</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">if</span> ownership_changes:
</span></span><span style="display:flex;"><span>    reuse <span style="color:#f92672">=</span> completed_fraction <span style="color:#f92672">*</span> transferability  <span style="color:#75715e"># discount for migration</span>
</span></span><span style="display:flex;"><span>expected_redo <span style="color:#f92672">=</span> <span style="color:#ae81ff">1.0</span> <span style="color:#f92672">-</span> reuse
</span></span><span style="display:flex;"><span>candidate_cost <span style="color:#f92672">=</span> expected_redo <span style="color:#f92672">*</span> redo_unit_cost <span style="color:#f92672">+</span> handoff_friction
</span></span></code></pre></div><h2 id="ranking-routes-the-utility-function-that-makes-handoffs-safe">Ranking Routes: The Utility Function That Makes Handoffs Safe</h2>
<p>Behind the three modes sits a constrained utility function: it weighs predicted success probability against cost, latency, risk, handoff friction, and an exploration bonus [1]. That last term matters more than it appears to; it lets SAGE occasionally try a less-certain route to gather evidence instead of always exploiting the incumbent.</p>
<p>This is what separates SAGE from RouteLLM, which routes between strong and weak models before execution begins [6]; a mid-task, artifact-aware comparison is the whole point. RouteLLM has no notion of a half-finished DAG; SAGE&rsquo;s utility calculation is built around one.</p>
<div class="key-takeaway">
  <span class="key-takeaway-label">Key Takeaway</span>
  A routing decision is only as good as its cost model. SAGE&rsquo;s reuse and transferability terms are what make HANDOFF economically sane; without them, the math always favors the incumbent.
</div>

<h2 id="contextual-trust-why-global-reputation-misleads-specialist-routing">Contextual Trust: Why Global Reputation Misleads Specialist Routing</h2>
<p>SAGE keeps two reliability posteriors per agent: a global one and one conditioned on the specific requirement [4]. It blends them at 35/65, favoring the requirement-conditioned estimate; the logic is simple: an agent that nails code generation should not inherit credit for schema design just because it shares an identity.</p>
<p>The benchmark makes the case: after 500 observations in a heterogeneous specialist scenario, requirement-conditioned trust hit a Brier score of 0.0125 ± 0.0018, versus 0.0355 ± 0.0008 for a single-reputation model [1]. Lower is better; the conditional model is far less confident in domains where the agent has no track record.</p>
<p>Beta belief updates and Thompson-style exploration sit under those posteriors; the result is a router that separates a generally reliable agent from one reliable for this exact requirement: the specialist distinction an A2A network lives or dies on. That distinction is precisely what a specialist-heavy A2A network needs.</p>
<pre class="mermaid">flowchart TD
  A[Offline Replay] --> B[Shadow Mode]
  B --> C[Canary Rollout]
  C --> D[Production]
  E[Routing Trace Ledger] -.-> A
  E -.-> B
  E -.-> C
  E -.-> D</pre><h2 id="benchmarked-what-state-aware-routing-actually-wins">Benchmarked: What State-Aware Routing Actually Wins</h2>
<p>SAGE&rsquo;s numbers come from controlled trajectory replay across 1,000 checkpoints over five seeds [1]. Progress-aware SAGE scored 0.298 utility versus 0.085 for always-continue, a 3.5x gap. Against always-handoff it scored 0.298 versus 0.290; the margin is thin, but SAGE wins it while doing far less wasted work.</p>
<p>Wasted work is the more interesting number for production: SAGE cut it to 0.059 versus 0.104 for progress-masked SAGE and 0.130 for always-handoff, a 43% reduction versus progress-masked SAGE [1]. Deadline misses run the same direction: 23.3% for SAGE, against 34.4% for always-continue and 30.5% for always-handoff; only the hidden-state oracle, at 19.6%, beat it.</p>
<table>
	<thead>
			<tr>
					<th>Policy</th>
					<th>Utility</th>
					<th>Wasted work</th>
					<th>Deadline miss rate</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>Always-continue</td>
					<td>0.085</td>
					<td>n/a</td>
					<td>34.4%</td>
			</tr>
			<tr>
					<td>Always-handoff</td>
					<td>0.290</td>
					<td>0.130</td>
					<td>30.5%</td>
			</tr>
			<tr>
					<td>SAGE (progress-aware)</td>
					<td>0.298</td>
					<td>0.059</td>
					<td>23.3%</td>
			</tr>
			<tr>
					<td>Hidden-state oracle</td>
					<td>0.375</td>
					<td>n/a</td>
					<td>19.6%</td>
			</tr>
	</tbody>
</table>
<div class="alert alert-alert">
  <p class="alert-heading">ALERT</p>
  <p>These benchmarks replay recorded trajectories, not live traffic. Treat the 43% wasted-work reduction as proof the approach works, not a guarantee your workload sees the same figure.</p>
</div><h2 id="production-integration-the-parts-sage-deliberately-leaves-out">Production Integration: The Parts SAGE Deliberately Leaves Out</h2>
<p>SAGE&rsquo;s sprix_a2a.py adapter converts A2A Agent Card declarations into normalized SAGE profiles [3]; that normalization exists because Agent Cards carry marketing text; SAGE wants locally calibrated capability scores instead of trusting whatever a card advertises. You calibrate those scores yourself, from real execution evidence.</p>
<p>For production you supply what SAGE does not: authenticated endpoint discovery, secure transport, and message lifecycle management [5]. Independent artifact evaluation must live outside the routing decision, so one buggy evaluator cannot poison both the score and the route; if you want a vector store for artifact embeddings during evaluation, <a href="https://try.pinecone.io/tz9zm84oj8g3?utm_source=agentscodex&amp;utm_medium=blog&amp;utm_campaign=2026-09-18-state-aware-a2a-routing-sprix-sage-router" rel="sponsored noopener" target="_blank">Pinecone</a>
 can hold that state. It is an evaluation concern, not a routing one.</p>
<p>The integration flow runs discovery, evidence, routing, dispatch, then evaluation [5]; routing sits in the middle, consuming state but never inventing it. That clean separation is what lets SAGE layer onto an existing A2A deployment without replacing your transport.</p>
<h2 id="operational-safety-permissions-audit-trails-and-rollout-gates">Operational Safety: Permissions, Audit Trails, and Rollout Gates</h2>
<p>SAGE filters by permission before ranking, removing unauthorized agents from the candidate set entirely [5]; every routing decision writes a RoutingTrace: an auditable record of why a given continuer was chosen. State persistence uses encryption and versioned snapshots; a degraded router rolls back to a known-good belief store.</p>
<p>The recommended rollout is deliberately conservative: offline replay, then shadow mode, then canary, then full production [5]. The ordering exists because trust posteriors are learned, not authored; a router with no history is just a well-meaning guess, no better than random assignment. A fresh deployment starts with uninformative beliefs and needs observed execution before its routing opinions deserve real weight.</p>
<figure>
    <img loading="lazy" src="/images/posts/2026-09-18-state-aware-a2a-routing-sprix-sage-router/image-2.jpg"
         alt="Warm amber-lit close-up of three diverging copper pipe junctions soldered onto a central brass manifold, each pipe stamped with shallow embossed labels SELF, COLLABORATE, and HANDOFF, resting on a dark oxidized steel workbench"/> <figcaption>
            <p>Routing paths for Sprix SAGE: copper pipes labeled SELF, COLLABORATE, HANDOFF on a brass manifold</p>
        </figcaption>
</figure>

<h2 id="where-sage-stops-the-research-boundary-worth-respecting">Where SAGE Stops: The Research Boundary Worth Respecting</h2>
<p>SAGE is explicit about its own scope: it handles checkpoint-aware reconfiguration, not coalition optimality [6]. That boundary matters; the literature it sits beside (DyLAN, GPTSwarm, AFlow) forms and optimizes teams before execution, while SAGE reconfigures after it has already begun.</p>
<p>The project has attracted 3,690 GitHub stars since its August 2026 start [1]; it is not angling to be a better team-formation algorithm; it answers the question every discovery-only stack leaves open: given that a task is half done, who should finish it?</p>
<h2 id="practical-takeaways">Practical Takeaways</h2>
<ol>
<li>Treat routing as a runtime decision, not a pre-execution one. If your handoffs today depend on static Agent Cards, you are missing the state that makes them cheap.</li>
<li>Track per-artifact transferability, not just completion percentage. A half-finished node that cannot migrate is worth less than its fraction suggests.</li>
<li>Maintain requirement-conditioned trust, not a single global reputation. Blending 65% conditional keeps an agent&rsquo;s success in one domain from spilling into others.</li>
<li>Keep artifact evaluation separate from routing. An evaluator that feeds both the score and the route becomes a single point of silent failure.</li>
<li>Adopt the rollout gate order: offline replay, shadow, canary, production. Trust posteriors need real execution data before they earn production authority.</li>
</ol>
<h2 id="conclusion">Conclusion</h2>
<p>Credit assignment is still the open problem: SAGE learns from outcomes today, but nobody can yet say which mid-task swap saved the run. Instrument checkpoints and artifact portability in your current pipeline first; those two inputs tell you whether the whole approach pays for itself at all. Then measure the rework you incur, and let your own number (not a vendor replay) show when handing work across beats the migration cost [1][3].</p>
<p><em>This post may contain affiliate links. We may earn a small commission if you sign up through our links, at no extra cost to you.</em></p>
<h2 id="frequently-asked-questions">Frequently Asked Questions</h2>
<h3 id="how-is-sage-different-from-routellm">How is SAGE different from RouteLLM?</h3>
<p>RouteLLM routes between strong and weak models before a task starts, optimizing cost and quality up front [6]. SAGE decides during execution, after some requirements are already complete, and folds artifact-reuse and transferability into its cost projections.</p>
<h3 id="do-i-have-to-replace-a2a-to-use-sage">Do I have to replace A2A to use SAGE?</h3>
<p>No. SAGE sits above A2A as a policy layer, not a transport replacement; keep A2A for discovery and JSON-RPC messaging, and let SAGE add the routing decision on top [5].</p>
<h3 id="why-does-sage-use-two-trust-posteriors-instead-of-one">Why does SAGE use two trust posteriors instead of one?</h3>
<p>A single global reputation lets success in one domain leak into unrelated ones, so SAGE conditions reliability on the specific requirement instead. It blends the two estimates at 35% global and 65% conditional, which measurably improves calibration on specialized workloads [4]. The result is a router that can tell the difference between an agent that is generally solid and one that is solid for this exact task; that distinction is precisely why the conditional model posts a better Brier score after a few hundred observations.</p>
<h3 id="what-happens-if-my-artifact-evaluator-is-wrong">What happens if my artifact evaluator is wrong?</h3>
<p>That is the risk SAGE&rsquo;s separation of concerns guards against. Artifact evaluation sits outside the routing decision, so one bad evaluator scores the artifact but does not poison the route [5]. A weak evaluator still degrades your state, though; see the production integration section above.</p>
<h3 id="is-the-43-wasted-work-reduction-a-production-number">Is the 43% wasted-work reduction a production number?</h3>
<p>No. It comes from controlled trajectory replay over 1,000 checkpoints, not live traffic [1]. We do not yet have clean production-scale data on how that generalizes to a specific request mix, so treat the figure as directional rather than a deployment guarantee.</p>
<hr>
<h2 id="sources">Sources</h2>
<table>
	<thead>
			<tr>
					<th>#</th>
					<th>Publisher</th>
					<th>Title</th>
					<th>URL</th>
					<th>Date</th>
					<th>Type</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>1</td>
					<td>Sprix AI</td>
					<td>&ldquo;Sprix SAGE Router GitHub Repository&rdquo;</td>
					<td><a href="https://github.com/wang2122/sprix-sage-router" target="_blank">https://github.com/wang2122/sprix-sage-router</a>
</td>
					<td>2026-09-15</td>
					<td>Documentation</td>
			</tr>
			<tr>
					<td>2</td>
					<td>A2A Project (Linux Foundation)</td>
					<td>&ldquo;Agent2Agent (A2A) Protocol GitHub Repository&rdquo;</td>
					<td><a href="https://github.com/a2aproject/A2A" target="_blank">https://github.com/a2aproject/A2A</a>
</td>
					<td>2026-09-18</td>
					<td>Documentation</td>
			</tr>
			<tr>
					<td>3</td>
					<td>Sprix AI</td>
					<td>&ldquo;SAGE A2A Integration Guide&rdquo;</td>
					<td><a href="https://github.com/wang2122/sprix-sage-router/blob/main/docs/INTEGRATION.md" target="_blank">https://github.com/wang2122/sprix-sage-router/blob/main/docs/INTEGRATION.md</a>
</td>
					<td>2026-09-15</td>
					<td>Documentation</td>
			</tr>
			<tr>
					<td>4</td>
					<td>Sprix AI</td>
					<td>&ldquo;SAGE Checkpoint-Aware Algorithm Design&rdquo;</td>
					<td><a href="https://github.com/wang2122/sprix-sage-router/blob/main/ALGORITHM.md" target="_blank">https://github.com/wang2122/sprix-sage-router/blob/main/ALGORITHM.md</a>
</td>
					<td>2026-09-15</td>
					<td>Paper</td>
			</tr>
			<tr>
					<td>5</td>
					<td>Sprix AI</td>
					<td>&ldquo;SAGE Operations and Production-Readiness Guide&rdquo;</td>
					<td><a href="https://github.com/wang2122/sprix-sage-router/blob/main/docs/OPERATIONS.md" target="_blank">https://github.com/wang2122/sprix-sage-router/blob/main/docs/OPERATIONS.md</a>
</td>
					<td>2026-09-15</td>
					<td>Documentation</td>
			</tr>
			<tr>
					<td>6</td>
					<td>Sprix AI</td>
					<td>&ldquo;SAGE Related Work and Research Boundary&rdquo;</td>
					<td><a href="https://github.com/wang2122/sprix-sage-router/blob/main/RELATED_WORK.md" target="_blank">https://github.com/wang2122/sprix-sage-router/blob/main/RELATED_WORK.md</a>
</td>
					<td>2026-09-15</td>
					<td>Paper</td>
			</tr>
	</tbody>
</table>
]]></content:encoded><media:content url="https://agentscodex.com/images/covers/2026-09-18-state-aware-a2a-routing-sprix-sage-router/cover.jpg" medium="image"/><media:thumbnail url="https://agentscodex.com/images/covers/2026-09-18-state-aware-a2a-routing-sprix-sage-router/cover.jpg"/></item></channel></rss>