Commit 27da25b
feat(ui): compact 'Agent activity between turns' card — drop tool noise, show only final result (#269)
PR #268 hid the running tool list from the main card. The "Agent activity
between turns" spontaneous card had the same problem one layer deeper —
it accumulated every assistant message (including bare `tool_use` blocks
that rendered as `🔧 Bash`/`🔧 Read` lines) into a numbered list, exactly
the play-by-play we just hid from the main card.
Apply the same UX bet here:
- `extractSpontaneousSnippet`: tool_use-only assistant messages now
return null. Text snippets (the agent's actual conclusion) still
survive. Mixed messages still surface the text and ignore the
adjacent tool_use, same as before.
- `formatSpontaneousCardBody`: render only the LATEST snippet (the
conclusion of the burst), not a numbered list of all snippets. When
N>1 were coalesced, append a small `_(N events coalesced; showing
latest)_` footer so the user knows there was more activity if they
want to dig into pm2 logs or the web UI.
Side effects:
- A between-turn burst that produced ONLY tool calls (no agent text)
no longer triggers a card at all — the buffer stays empty, the
30 s flush is a no-op. This is the correct outcome: nothing
user-meaningful to report.
- The continuation-turn render path (handleContinuationTurn) was
already covered by PR #268 since it goes through the same
card-builder.ts surface. No change needed there.
Tests:
- extractSpontaneousSnippet: assert tool_use-only returns null,
text+tool_use still returns the text, multi-tool_use returns null.
- formatSpontaneousCardBody: assert single-snippet renders without a
numbered prefix; N>1 renders the latest snippet plus the
coalesced-count footer, and the earlier snippets are NOT in the
body.
290/290 vitest pass. Build + lint clean (2 pre-existing warnings).
Co-authored-by: Flood Sung <floodsung@xvirobotics.ai>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>1 parent d6291a8 commit 27da25b
2 files changed
Lines changed: 74 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
80 | 85 | | |
81 | 86 | | |
82 | 87 | | |
| |||
85 | 90 | | |
86 | 91 | | |
87 | 92 | | |
88 | | - | |
89 | | - | |
90 | 93 | | |
| 94 | + | |
91 | 95 | | |
92 | 96 | | |
93 | 97 | | |
94 | 98 | | |
95 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
96 | 107 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
102 | 116 | | |
103 | 117 | | |
104 | 118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
85 | 90 | | |
86 | 91 | | |
87 | 92 | | |
88 | 93 | | |
89 | | - | |
| 94 | + | |
90 | 95 | | |
91 | 96 | | |
92 | | - | |
| 97 | + | |
93 | 98 | | |
94 | 99 | | |
95 | 100 | | |
| |||
100 | 105 | | |
101 | 106 | | |
102 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
103 | 119 | | |
104 | 120 | | |
105 | 121 | | |
| |||
124 | 140 | | |
125 | 141 | | |
126 | 142 | | |
127 | | - | |
| 143 | + | |
128 | 144 | | |
129 | 145 | | |
130 | 146 | | |
| |||
142 | 158 | | |
143 | 159 | | |
144 | 160 | | |
145 | | - | |
146 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
147 | 181 | | |
148 | | - | |
149 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
150 | 189 | | |
151 | 190 | | |
152 | 191 | | |
| |||
0 commit comments