fix(bridge): show full agent activity content in Feishu card#314
Merged
Conversation
The "agent activity" status card was hiding most of what each spontaneous event reported. Two compounding causes: 1. extractSpontaneousSnippet hard-capped each event at 400 chars via a raw slice() — long tool results, plan bodies, and progress lines were chopped well below the card's actual budget. 2. formatSpontaneousCardBody only rendered the *latest* snippet, dropping every earlier coalesced event from view (the 30s debounce window often gathers 3-5 events). Now each snippet caps at 4000 chars with a trailing ellipsis marker, and the body renders every snippet chronologically joined by horizontal-rule separators under a 12000-char budget (safely under the 28K card limit). On overflow, the oldest events drop with a prepended "(N omitted; M shown)" notice so the user can see the activity is being trimmed.
SimonYeyi
pushed a commit
to SimonYeyi/metabot
that referenced
this pull request
May 26, 2026
…tics#314) The "agent activity" status card was hiding most of what each spontaneous event reported. Two compounding causes: 1. extractSpontaneousSnippet hard-capped each event at 400 chars via a raw slice() — long tool results, plan bodies, and progress lines were chopped well below the card's actual budget. 2. formatSpontaneousCardBody only rendered the *latest* snippet, dropping every earlier coalesced event from view (the 30s debounce window often gathers 3-5 events). Now each snippet caps at 4000 chars with a trailing ellipsis marker, and the body renders every snippet chronologically joined by horizontal-rule separators under a 12000-char budget (safely under the 28K card limit). On overflow, the oldest events drop with a prepended "(N omitted; M shown)" notice so the user can see the activity is being trimmed.
This was referenced May 26, 2026
floodsung
pushed a commit
that referenced
this pull request
Jun 15, 2026
GitHub-only commits #312 (ExitPlanMode auto-approve) and #314 (full agent activity content) are already present in this branch via their internal equivalents (exit-plan-mode.ts is byte-identical; #314 = internal 8316195). GitLab is the source of truth, so this branch's tree is kept verbatim (-s ours); this merge only makes GitHub main an ancestor so the cutover is a clean fast-forward.
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.
Why
The "agent activity" status card emitted between turns by
MessageBridge.flushSpontaneous()was dropping most of what each spontaneous event carried.Root cause
Two compounding bugs in the snippet pipeline (
src/bridge/message-bridge.ts):extractSpontaneousSnippet. Tool results, plan bodies, and any multi-line progress output got chopped well below the Feishu card's actual capacity.formatSpontaneousCardBody. The 30s coalesce window (SPONTANEOUS_COALESCE_MS) routinely batches 3-5 events, but the body only showedsnippet[N-1]— every earlier event silently vanished.Fix
SPONTANEOUS_SNIPPET_MAX_CHARS = 4000with an ellipsis marker on overflow.formatSpontaneousCardBodyto render every snippet chronologically, joined by\n\n---\n\n, under aSPONTANEOUS_BODY_MAX_CHARS = 12000body budget (well under the 28K card hard limit)._(N earlier events omitted; M shown)_notice so the user can see the activity is being trimmed.Tests
tests/message-bridge.test.ts— 34 tests pass. New cases: