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?

![[Gemini in Action] Dev.to Text & Image Translator: Redrawing Chinese Screenshots with Nano Banana Pro & Gemini 4 Neon as Judge](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmqgw1txph1efru186j3r.jpg)