An unread count is a small thing on a screen. In The Situation Room, it sits beside an agent’s chair and tells me there is work the current session hasn’t been handed. It should be useful information I can take in without thinking much about it.
Behind that small number, the roster was re-walking every chair’s mail every five seconds.
That was a reasonable way to get the right answer in the first place. Ask the existing unread-mail reader, count what it returns, and display the result. But the room keeps a durable record, and a durable record gets longer. A refresh that repeats the same question for every chair becomes part of the operating cost whether anything relevant changed or not.
I direct coding agents to build TSaR. In this change, the engineering problem was reducing that repeated work while preserving what the count meant. A second, faster definition of “unread” would give us two answers to maintain. I wanted the existing reader to remain responsible for that decision.
What Would Change the Answer?
The implementation now keeps a per-chair cached count. Before using it, the room checks a token describing the inputs the count depends on. If those inputs haven’t changed and the cached result is still young enough, it can reuse the number. Otherwise, it asks the same unread-mail reader for a fresh count.
The interesting work was deciding what belongs in that token.
A message addressed to the chair matters. So does mail addressed to one of its roles, or to the room. A delivery acknowledgment can reduce the count without any new message arriving. A different occupant, a new generation, a changed configuration, or a handoff carrying work forward can also change what the reader considers unread.
Mail arriving for a different chair usually shouldn’t make this chair repeat its scan. Neither should an unrelated system event. If every event invalidated every count, we would have changed the shape of the code without removing much of the work.
That makes the token a small statement about the room’s operating model. What can change this answer? What can safely leave it alone?
The Timing of the Check Matters
There’s a less obvious detail in the order of operations. The room samples the token before scanning the mail.
Suppose a message arrives while the scan is running. If the code sampled the token afterward and attached that newer token to an older result, it could make the count appear current even though it had missed the new message. Sampling first lets the next tick see that something moved and ask again.
There’s also a limit to the events the token observes. For some chairs, a cross-room or arc-less message can affect the reader without changing the watched token. Pretending otherwise would turn an optimization into a stale-information bug.
The implementation keeps a backstop: once a cached count reaches thirty seconds of age, the next roster tick recounts it even if the token stayed the same. That is a refresh rule for a display. It doesn’t promise thirty-second message delivery, and the tick still has to run after the interval expires.
Checking the Cost Without Changing the Meaning
The focused tests compare the cached result with the existing reader. They cover direct, role, and room-wide mail; delivery acknowledgments; and changes of generation and configuration. They also check the other half of the purpose: repeated ticks, unrelated events, and another chair’s mail should avoid unnecessary reads.
The backstop has its own boundary tests. A count just inside the interval can be reused. At expiry it must be recomputed. Cross-room and arc-less mail are explicitly exercised as cases the token alone can miss.
The change landed November 4. On November 5, I checked that it was included in the installed TSaR version. That establishes where the implementation had reached. The code and focused test cases support the narrower claim that repeated roster ticks can reuse an unchanged count. This content review did not measure an overall CPU reduction, so there’s no percentage to report here.
The useful part of this change is the dependency work. A small badge was asking a large question over and over. Making it cheaper required us to explain when its answer could stop being true.

