Repository navigation
Fold automated message bursts into one compact list at the delivery layer - #224
Merged
Merged
Conversation
…ayer When a burst of non-urgent inter-agent messages lands in one delivery, fold them into a single compact list (count + one line per item + a t3team_read_message pointer) instead of one verbose block each. One compact renderer (t3team-actorBurstFold.ts) beside the digest framing and the restart-hold summary, so every automated source (silence watches, abnormal stops, completion notices, workflow steps) inherits the fold by passing through it - no per-notifier copies. Urgent entries bypass the fold (their own full block). Sub-threshold and single-entry batches keep the full per-entry shape byte-exact, so the restart rehydrate matcher (B4 invariant) is unaffected. Human messages never fold (the actor mailbox is inter-agent-only). Dedup runs first (the #222 terminal-notify ledger), so the fold renders an already-deduplicated set. Measured on the thread fbdb583b shape (12 distinct 'stopped' silence-watch notices after the #222 dedup): digest 2616B -> 1163B (56% smaller), restart-hold 2531B -> 1511B (40% smaller).
This was referenced Sep 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bar
So the fold is a delivery-layer concern, built ONCE beside the digest framing + the restart-hold summary, not inside each notifier. Every automated source inherits it by passing through the shared renderer — no per-notifier copies that could drift.
What this changes
New
t3team-actorBurstFold.ts: one compact renderer (renderAutomatedBurstBlock) + the fold decision (splitAutomatedBurst). Two call sites:buildActorReactionDigestInput): a batch of more than the threshold of non-urgent entries renders as ONE compact list — a header naming the count, one line per item (id · «sender» · thread · urgency — short subject), and at3team_read_messagepointer.buildActorRestartHoldSummary): the held-messages section folds the same way.Invariants:
actor.messageIds+ single-entry bases) is unaffected.Every automated source folds — none left behind
All automated sources publish to the actor mailbox and reach the recipient through exactly these delivery surfaces:
startActorReaction→ the digest (folded).startActorRestartHoldSummary→ the restart-hold summary (folded).buildActorReactionCompressedInput, which is already a compact grouped list.So silence watches, abnormal stops, completion notices, and workflow steps all fold. No automated source is left unfolded.
Measured on real rows (thread fbdb583b shape)
32 raw silence-watch messages → 12 distinct after the #222 dedup. Reconstructed 12 "stopped" notices with the real
buildSilenceMessageTextbody + the emit's sender summary:After shape (digest):
Verification
fe484ad8c: 0 new violations, 0 new warnings (the new module is 89 LOC, well under the cap).t3team-actorReactionInput.tswas already over the 200 cap on main (255, from the overhaul); this change adds 16 lines to it.t3team-actorMessageReaction.ts(233) is untouched.