I was checking Discord on my phone at work when I noticed my head agent wasn't tagging the Guardian.
My coding assistant disagreed. The screenshot showed @Guardian right at the top of the reply. Looked like a tag to it.
Then it pulled the message from Discord's API:
{
"time_local": "10:51:58",
"author": "HeadAgent",
"bot": true,
"type": 0,
"mentions": [],
"content_start": "@Guardian Yes, I hear you. I am reading this message right now..."
}
An excerpt from our diagnostic record, with the display name anonymized. Discord's raw author field is an object.
There it was: mentions: [].
The agent was saying “Yes, I hear you” in a message the other agent's routing rule would reject.
That was one of three ways their conversation broke on November 25. The last one had them arguing about reading comprehension when one of them had never received the whole message.
Two agents, one room, three different failures
I wanted them to work things through together without me carrying messages between them.
The Guardian runs on Hermes, an MIT-licensed agent framework, with a DeepSeek model. My head agent is my own Python agent using the Anthropic API. They share a private Discord channel.
My agent polls every ten seconds. Human messages are outside its bot-reply cap; Guardian messages have to be addressed to it. On the other side, Hermes is configured with DISCORD_ALLOW_BOTS=mentions, which normally requires a real mention, with an exception for recognized continuations.
That decides which messages get admitted. It doesn't stop two correctly tagged bots from bouncing replies forever. A separate rate cap handles that.
The trouble started before either agent had anything useful to reason about.
A reply the watcher didn't recognize
At 10:36, the Guardian used Discord's reply arrow:
{
"type": 19,
"mentions": ["HeadAgent"],
"reply_to_author": "HeadAgent"
}
Same diagnostic format: names replace IDs, and reply_to_author summarizes the referenced message.
Type 19 is a reply. My agent was even in the mentions list. But the watcher only searched the message text for <@id>. It found nothing and ignored the reply.
We changed “addressed to me” to recognize three routes:
def _mentions_me(self, content, m=None):
if f"<@{self.self_id}>" in content or f"<@!{self.self_id}>" in content:
return True
m = m or {}
if any(str(u.get("id")) == self.self_id for u in (m.get("mentions") or [])):
return True
ref = m.get("referenced_message") or {}
return str((ref.get("author") or {}).get("id", "")) == self.self_id
The negative case matters just as much: replying to someone else must not count as replying to my agent.
One boundary I keep separate: this decides whether a message is addressed to my agent, not whether it's allowed to make my agent do anything. Being tagged by another agent gets a message read. It doesn't grant authority.
A name that looked like a tag
Then came the message from my phone.
Selecting someone from Discord's mention autocomplete produces a mention containing their user ID. A bot sending literal @Guardian through the API hasn't done that. It has sent a name.
In our Hermes checkout, the bot-admission branch rejects a message with neither an explicit mention nor a recognized continuation. That branch has no log call. The saved gateway excerpt jumps from an inbound message at 10:31:50 to the next at 11:06:20.
The same model had written a real tag earlier and plain text later. I didn't want that formatting choice deciding whether the next agent received a turn. We normalized the known name on the way out:
text = re.sub(
r"(?<![<\w])@Guardian\b",
f"<@{self.guardian_id}>",
str(text),
flags=re.IGNORECASE,
)
Our tests check the useful conversion and the things it must leave alone: an existing <@id> tag and a@Guardianx.com.
We also restrict allowed_mentions to the intended participants. A valid mention is routing information; it isn't proof that the receiver ran a turn or that a phone notification appeared.
The agent that kept asking for the missing half
This one the Guardian found.
My agent kept asking for the second part of his answers. The Guardian insisted he had already sent it. He started treating the requests as a reading problem, even warning against manufacturing a second finding just because someone kept asking for one.
Then he checked how the messages had landed:
Stop. I was wrong… You never received the second half.
The bot message content limit is 2,000 characters. Hermes split the long answers. In the exchange that failed, the first piece carried the tag; the second didn't.
My watcher applied its mention check to each piece separately. Part one reached the model. Part two stayed in the channel but never reached the model's input.
The Guardian could see the complete answer in the channel and assumed the other agent could too. My agent kept apologizing for missing something its watcher had dropped.
This one wasn't new. The same failure was reported upstream in Hermes in May (issue #27265, closed in September), which is why Hermes has its own continuation exception. But the receiving side here was my own Python watcher, so the fix was still mine to make.
Before asking why an agent ignored an instruction, I now want to see which text actually reached it.
My first fix passed its tests and made a new mess
We initially merged any untagged Guardian message arriving within twenty seconds of a tagged one. The coding assistant's tests passed: 40 out of 40.
Then two other AI reviewers wrote their own fake-Discord tests without reading the maker's tests.
One recorded seven failing checks—not seven distinct bugs. The reviewers found overlapping problems: unrelated messages glued together, a second part lost when I spoke between the parts, a six-per-hour cap that reset on restart, and Discord memories labeled as Telegram conversations.
The green tests had described too little of the behavior we needed.
We stopped patching and wrote those behaviors down before the next build. The review of that specification took three drafts. The repair then used the sender's own split markers, (1/2), (2/2), and so on, instead of treating nearby messages as parts of the same answer.
These are some of the cases the new tests insist on:
| Messages arriving | Required behavior |
|---|---|
Addressed (1/2), then valid (2/2)
|
One Guardian turn containing both parts |
| Addressed message, then unrelated unmarked message | Never glue them together |
(1/2), my message, then (2/2)
|
Finish the Guardian turn, then answer me separately |
(1/2), then (2/3)
|
Different series size: do not merge |
| Next numbered part, but a reply to someone else | Do not merge |
| Six replies, then restart, then another bot message | Preserve the cap |
The actual continuation check also requires the configured Guardian ID and bot flag, a marker at the end of the message, the next part number, a matching total between two and six, and parseable timestamps no more than twenty seconds apart. One series can be open at a time.
Waiting is bounded too: at most three three-second waits for the whole series, outside the brain lock. An incomplete answer cannot hold the reader open indefinitely.
This is a convention between these two agents. (2/2) is not a unique message ID, and it is not a general solution for concurrent streams. If Hermes changes its marker format, our reader needs to change with it.
The rebuilt version passed 70 assertions plus one recorded observation in one independent runner, and 55 checks in the other. Both used fake HTTP and fake model calls. Running the first runner against the old code produced 40 failing checks. That showed it could detect the old defects; passing the new code was still fixture evidence, not proof of every live interaction.
The observation matters: the memory hook runs inside the brain lock. These tests did not measure the real latency of that extra work.
The cap limits bot replies. It doesn't tell me what the room costs.
My agent allows at most six replies to the Guardian in a sliding hour, followed by one pause message. The rebuilt reader saves the recent timestamps and pause state with the cursor, before attempting the send. Restarting no longer clears them in our tests.
On November 25, the channel record shows six replies followed by the pause line. About five minutes later, I wrote in the channel. The next head-agent message tagged the Guardian, and the gateway recorded another inbound message.
My messages are outside the bot cap, so a human turn can bring the Guardian back in. That does not erase the head agent's bot-reply limit. It means six bot replies per hour is not a total spending limit for the room.
For the Guardian's entire November 25 workload, the saved usage summary records 145 model calls, about 21.1 million input tokens, and 294,678 output tokens. About 87% of the input was cached.
Using the rates in our local provider catalog captured that evening—$1.32 per million uncached input tokens, $0.044 per million cached input tokens, and $3.96 per million output tokens—the estimate is $5.61. Pricing all that input as uncached would give $28.98.
That's a catalog calculation, not an invoice or a current price quote. It includes the Guardian's other work and our testing, not just this channel.
I still don't have the matching total for my head agent. Its code wasn't logging API usage. Until I have both sides, I can't honestly price the conversation.
What I'd check before changing the prompt
The screenshot looked right. The first fix passed its tests. The Guardian sounded certain the other agent had received his answer. Each of those was a different kind of incomplete evidence.
If you're wiring agents together, inspect the route all the way through:
Message posted → admission rule → complete input assembled → model turn
Check the raw mentions, message type, and reply reference. Test what should be ignored as carefully as what should get through. Verify the complete input, then test your repair against the old failure—not just against the examples you used to build it.
And give someone who didn't write the fix a chance to break it. In this case, that meant separate AI reviewers with separate fixtures, not asking the coding assistant whether it liked its own work.
Getting the words delivered leaves me with a harder question: once both agents have the whole message, what would you measure to tell whether their conversation is useful—or just an expensive exchange of agreement?
Top comments (40)
mentions: []with a visible @guardian in the text is the cleanest example of this I have seen. The display layer is not the transport, and everything downstream reads the transport.I hit the same shape in the other direction. Two assistants exchange a request and the receiving one acts on it, but what it acts on is the summary, not the original. The summary says "he wants X by Friday" and the original said "he asked whether X by Friday is possible." Both are readable, both are plausible, and only one of them is what was asked. The message "arrived" and the message was not heard, in your phrasing.
The habit that fixed it for me: the receiving side has to quote back the thing it is about to act on, in one line, before acting. If the quote does not match what the sender meant, you find out at the cheap moment instead of after the argument about reading comprehension.
Quote back before acting is a good habit, and it's cheap. The summary versus original thing is sneaky because both versions read fine, so nobody flags it. Paraphrasing could hide the same drift though. Does the receiver quote in its own words, or do you make it copy the original line exactly?
Exact copy for the load-bearing line, always. The paraphrase can ride along for understanding, but it can't stand in for verification — a drifted paraphrase reads fluently, and fluency is exactly what lets it pass unflagged. My rule: the receiver copies the original line byte for byte first; only after the copy matches does it get to restate anything in its own words. Paraphrase is for meaning. The quote is for proof.
The Guardian took channel visibility as proof that its whole answer had reached the other model. Every fix for the split answer happens on the receiving side, so the Guardian still has no delivery signal. Have the receiving agent open its turn with a receipt giving the part count and a short hash computed from the assembled input it was handed. The Guardian can hash its answer before splitting, compare the two, and spot the missing half on the first exchange.
Reply counts and mention counts measure traffic. In one agent message log I audited, cross-agent references formed 88 sender/receiver pairs. Only 7 pairs referenced each other in both directions. One pair accounted for 1,241 of the 1,406 mutual references, mostly from one side repeating the same pitch. I'd count a turn toward uptake only if it quotes or acts on a specific detail introduced in the other agent's previous turn that hadn't appeared in its own earlier turns. Agreement alone scores zero.
Once part 2 arrived, did the head agent's next turn use a detail from it?
You're right that the fix for the split only landed on the receiving side, so the Guardian still has no delivery signal of his own. To your question, yes, at least once. On a split after the fix went in, the head agent's next reply repeated a phrase that only appeared in part 2, that the fix was one layer too shallow. That's evidence it arrived, but I had to go dig for it. Your receipt would make it automatic. Would you have the receiver post the part count and hash from code before the model runs, so the model can't garble it?
For the usefulness test, I'd give both agents a task with a checkable outcome and compare the exchange against one agent working alone on the same inputs. Record which specific claim or correction from one agent changes the other's next step, then have an independent check score the final result. That separates genuine uptake from two agents repeating agreement, and the single-agent baseline shows whether the extra turns earned their cost.
The single agent baseline is the part I was missing. Right now I can see agreement but I can't tell uptake from echo, and two agents nodding at each other costs real money. Tracking which specific correction changed the other's next step is a clean way to score it. What would you use as the checkable task, something with a known answer or a bug they have to find?
I'd start with a small bug in a repository, with a hidden regression test and a fixed time or token budget. Give both setups the same code and failing symptom; score the patch against the held-out test and measure cost. Then inspect whether a specific correction from the second agent changed the patch, rather than counting agreement as uptake.
A real repo with a hidden regression test is a harder version of what I'm testing first, and it adds the part mine skips, a patch that has to actually pass and a cost to weigh it against. One agent alone against two on the same budget is the clean way to tell uptake from echo. How would you keep the hidden test out of reach when the agent can read the whole repo?
The screenshot looked like a tag but the raw message had mentions: [], a good reminder that what the UI shows and what the API delivers are different things. Having agents talk to each other needs that kind of delivery check. I work on Kiteline (open source, GitHub hon6/kiteline), where sessions from different agents can be put in a group and message each other, with each message's delivery and read state shown.
That gap between what the UI shows and what the API delivers is the whole lesson for me. Do you think a read receipt should come from the receiving agent itself or from whatever sits between the two?
The distinction between message delivery and message consumption is particularly important in multi-agent systems. A message can exist in Discord, carry the right visual tag, and still never reach the receiving agent's context. I'd take this one step further and introduce message-level traceability across the entire handoff: sender, recipient, message ID, correlation ID, delivery status, ingestion status, and processing outcome. At IT Path Solutions, this is the kind of detail that matters when engineering agentic workflows beyond simple demos. I'd also measure useful task completion per interaction rather than just reply counts or agreement rates. If two agents exchange 20 messages but don't resolve the original task, the orchestration isn't working efficiently. The real goal is reliable context transfer and measurable progress, not simply getting agents to talk to each other.
Ingestion status is the one I'm missing most. Right now I can show a message was in the channel, and after the fact what text the head agent was handed, but no single ID ties those two together, and nothing records whether it changed what he did next. Task completion per interaction is the right unit. Twenty messages that resolve nothing should score zero. Where do you record ingestion, in the receiving agent's own log or in something that sits between the agents?
The empty mentions list is a sharp example of a screen that looks right while routing fails. Since the rejecting branch had no log call, did you add one so the next silent drop shows up on its own?
Not on that branch. It lives in the framework's code and I haven't touched it. What I did add is on the receiving end, the head agent's diary records the exact text it was handed each turn, which is how I confirmed a split arrived whole. The sender side is still blind, so a drop on the Guardian's end would still be silent. Would you patch the framework to log there, or put a check outside it that compares what was sent against what was received?
A check outside the framework looks like the stronger first step, since it survives Hermes updates and can catch drops nobody thought to log. A log line on that branch would still help explain the reason, but could the Guardian record each chunk as it sends it, so the outside check has a sender side to compare with the diary?
Yeah that's the move. If the Guardian writes down each chunk as it sends it, the outside check has two sides to compare instead of guessing from one. The part I'm not sure about is where that log should live so the Guardian can't edit its own record after. Would you keep it outside the agent's reach, or is a hash on each line enough?
Outside the agent's reach seems safer to me, because a hash on each line proves little if the same process can rewrite both the line and its hash. Could a separate writer that only accepts appends stay simple enough to run next to Hermes?
I think so. It could be a tiny process running as a different user that only opens the log in append mode, so the Guardian can read the record but never touch it. The part I keep getting stuck on is the writer itself going down. If a line is missing, how would you tell a dropped message from a writer that just wasn't running?
"Before asking why an agent ignored an instruction, I now want to see which text actually reached it" is the line I'd keep. On a job that's the sub who built from sheet one of a two-sheet detail. He isn't a bad reader. He never got the second sheet, and the person who sent it can see both on his own desk. Transmittals exist for that reason: a list of what was sent, so the receiver can say what's missing. To your closing question, I'd count the turns where one agent changed what the other did next. A job meeting was useful if somebody left with a different plan than they came in with. Two people agreeing for an hour gets billed the same.
The transmittal is the part I want to steal. A list of what was sent so the receiver can say what's missing is the same receipt another commenter described, in a form anyone on a job site would recognize. And leaving the meeting with a different plan is a cleaner usefulness test than anything I had. On a job, who checks the transmittal, the sub or the person who sent it?
The first failure (mentions: [] while the text says @guardian) has a cousin we hit: an agent got a message with the exact absolute path to write its handoff note, said it understood, then wrote to a different file (~/NEXT.md) and its own note stayed stale. Message delivered, acknowledged, not applied. We have only partly fixed it (a watcher that keeps a backup of the shared file; nothing yet checks that the named file changed).
Question about your three failures: does your diagnostic record separate "never admitted by the routing rule" from "admitted, read, and the reply didn't act on it"? From the outside both look like "I hear you" with nothing happening, but only the second one is a reasoning problem. How many of the 25 Nov turns fall in each bucket?
That cousin is the one that worries me more. A message that never got in is easy to prove. One that got read, acknowledged, and then went to the wrong file looks like success until someone opens the file. Honestly we traced that day per failure, not per turn, so I can't give you a clean count without making one up. Your split is the right one though. What's stopping you from hashing the named file before and after the agent says done?
Nothing technical stops it; we hadn't tied the two together. What exists is partial: a watcher keeps a backup of the shared note file and a restore matched its baseline byte for byte, but that runs on a schedule and is not triggered by the agent saying "done". So today the claim and the file check are separate events, and the gap you describe is open.
Your version is the better design: hash the file the message named before, and again when the agent reports done, and make "done" fail if the hash didn't change (or changed some other file). I'll hand it to the agent that owns the watcher and say here if it ships. And fair enough on the count; a made-up number would have been worse than none.
Follow-up as promised. The owner shipped a narrower version than your hash idea: at end of wake the tooling now warns when a note file was written somewhere other than the agent's own home (it caught the original wrong-file case when replayed). It warns, it does not fail "done", because an unchanged note is normal for an agent that has nothing to report, so "unchanged = not done" would false-alarm constantly. Your before/after hash of the named file is still the stronger check; the warning only covers the wrong-directory case.
The split-message one is the failure I'd never have thought to test for — part one carries the tag, part two doesn't, and the watcher just drops it silently while the Guardian argues about reading comprehension. The receipt idea from anp2network feels like the honest fix: the receiver opens its turn with a part count and a hash, so a missing half shows up on the first exchange instead of three turns later. Do you think that receipt belongs in code before the model ever sees the turn, or in the prompt itself?
In code, before the model sees the turn. That's where our split fix went too, the watcher uses the sender's own (1/2) markers to decide which parts belong together instead of leaving it to the model. A prompt can ask the model to notice a missing half, but it already showed it would argue instead. Where would you put the check if the two agents ran on different frameworks?
The 20-second merge that passed 40/40 is the part that stuck. Proximity feels like a continuation rule until someone talks in the middle or an unrelated line lands in the same window. I'd steal the repair: write the "never glue" and "finish the series, then answer me separately" cases first, then let a second reviewer fail the old suite.
That order is what saved us. The old tests were green and still described too little of the behavior we needed, so we wrote the cases down before touching the code again. Has a second reviewer ever failed a suite you were sure about?