misherate blog
19 October 2026 · agentsroutingevaluation

Measure the router, then make its mistakes cheap

Misha's iterate mind hands every message to one of its agents, and the one that decides which is Jev, a small routing model.

Jev got 100 of 118 messages right. The interesting part was the other 18: sixteen of them were the same mistake, and the fix was one number, not a better prompt.

Every message Misha sends his mind has to land somewhere. It can join the conversation of an agent that is already working on something, or it can start a new thread with a fresh agent. Jev decides, asked one multiple-choice question: here is the message, here are the agents active in this chat in the last two hours (plus the one whose message it replies to, however old), up to five of them, and one more option, NEW. It answers with a choice and a probability for each option. If it doesn't answer within three seconds, the message starts a new thread, which is what happened before routing existed.

That is easy to build and hard to judge by feel. A wrong route shows up as an agent that cannot tell what a message refers to, and it is tempting to fix each one by rewording the question. On 19 October we counted instead.

Count before tuning

Each agent's log records why each input reached it, so the routing decisions of the previous four days could be read back and marked by hand: 118 routed messages, 18 of them in the wrong place.

The interesting part was not the 18 but their shape. Sixteen of them were the same mistake: a short follow-up that belonged to a conversation, sent to a new thread instead. The kind of message that only makes sense next to the one before it, like "make it 8pm" after a table was booked, or a photo sent with a question about something already under discussion.

Looking at the probabilities the model gave in those cases told the rest. Where it chose NEW wrongly, it had mostly given the right conversation somewhere between 0.2 and 0.4. Where the subject really was new, every conversation usually got less than 0.1. The model's ranking was fine; its choice leaned towards NEW.

That makes the fix a threshold on what the model already returns, not a better prompt:

const JOIN_AT = 0.2; // the model leans to NEW; this much for a conversation is enough

function pick(answer: { choice: string; probabilities: Record<string, number> }) {
  const [likeliest, p] = Object.entries(answer.probabilities)
    .filter(([option]) => option !== "NEW")
    .sort(([, a], [, b]) => b - a)[0] ?? ["NEW", 0];
  return p >= JOIN_AT ? likeliest : answer.choice;
}

Replayed over the same 118 messages, joining the likeliest conversation at 0.2 or more took the router from 100 right to 107, at the cost of two messages that now join a conversation they shouldn't. Over the last two days of the sample alone it went from 37 of 46 to 45.

The comment above the constant in the code carries those numbers. A threshold with no record of where it came from is one that gets nudged back the first time it misfires; with the counts next to it, the next change has something to be measured against.

Then make a wrong route survivable

The threshold trades one kind of mistake for another. Two of the 118 now over-join, and a router will always get some wrong. So the second change on the same day was about what an agent sees when a message joins it, right or wrong.

Until then, an agent got the chat's recent lines once, when it started. A message that joined it later arrived alone. If other agents had been talking in the same chat in the meantime, the joined agent had no idea: a follow-up routed to the wrong conversation showed nothing of what it was following up on, so the agent could only ask.

Now a message that joins a conversation brings the lines that agent hasn't seen. The mind keeps the chat's recent lines in its book, and each of its own lines records which agent said it. "Hasn't seen" is everything after the agent's own last answer, or after the last message routed to it, whichever is later:

function chatSince(lines: ChatLine[], agent: string, before: string): ChatLine[] {
  const upTo = lines.findIndex((line) => line.id === before);
  const earlier = upTo === -1 ? lines : lines.slice(0, upTo);
  const seen = earlier.findLastIndex(
    (line) => line.agent === agent || routedTo(line.id) === agent,
  );
  return earlier.slice(seen + 1);
}

Those lines go in ahead of the message, as a developer item labelled [in this chat since you last spoke …] and marked as information, not instructions. The mind's own lines in it name the agent that said them, so the joined agent can tell "I said this" from "another agent said this", and its instructions say how to read that other agent's conversation when it needs what that agent found.

With that, a misrouted follow-up is no longer a dead end. The agent that received it can see that the message answers something another agent just did, and either act on it with the other agent's findings in hand or say plainly that it belongs elsewhere.

The test needed a clock

One small thing came out of testing this. The test for the catch-up wrote a few messages and answers and checked which lines a joining message brought. Whether an agent "spoke last" depends on timestamps, and with the real clock two lines written in the same millisecond could compare either way. The test now pins the clock and moves it explicitly between steps, so the expected lines, timestamps included, are exact strings rather than patterns.

What we'd do again

Want this in your own iterate mind? The button copies a note for it: it reads this page, tells you what it would change, and changes nothing until you say yes.

Linking here

← Let code do the looking, and wake an agent only when there is something to read
Commit the manifest, not the build →

One email per new post, at most two a day. Unsubscribe any time. Your address is kept privately and never shown.