Skip to content

feat(ui): blue 'Agent activity' card status, drop the ugly body caption#271

Merged
floodsung merged 1 commit into
mainfrom
feat/agent-activity-blue-card
May 14, 2026
Merged

feat(ui): blue 'Agent activity' card status, drop the ugly body caption#271
floodsung merged 1 commit into
mainfrom
feat/agent-activity-blue-card

Conversation

@floodsung

Copy link
Copy Markdown
Contributor

Summary

The spontaneous between-turn card was prepending an italic `Agent activity between turns (background task return, teammate ping, or /goal evaluator):` caption to every body. Users said it was visual clutter, and the underlying signal ("this is a between-turn burst, not a normal turn") should come from card chrome anyway.

This PR moves the signal into the card header:

  • New `CardStatus = 'agent_activity'` — blue header, title "Agent activity", 🔵 icon. Distinct from `running` / `thinking` (also blue but titled "Running…"/"Thinking…") and from `complete` (green), so the user can tell at a glance whether the card is a live turn, a finished reply, or a between-turn burst.
  • `flushSpontaneous` uses the new status; `formatSpontaneousCardBody` returns just the latest snippet (plus the coalesced-count footer when N>1) — no italic caption.
  • Empty-buffer guard: if all snippets get filtered out (e.g. tool-only burst, per the feat(ui): compact 'Agent activity between turns' card — drop tool noise, show only final result #269 text-only extractor), `flushSpontaneous` drops the card entirely rather than emitting an empty one.
  • Status threaded through every renderer that pattern-matches on `CardStatus`: v1 + v2 Feishu card builders, Telegram `STATUS_EMOJI` / `STATUS_LABEL`, web frontend `CardStatus` union. The unused `SPONTANEOUS_CARD_HEADER` export and its phrasing-pinning regression tests are gone.

Before / After (v2 card)

Before After
🟢 Complete 🔵 Agent activity
Agent activity between turns (background task return, teammate ping, or /goal evaluator): Pushed commit abc1234.
(3 events coalesced; showing latest)
Pushed commit abc1234.
(3 events coalesced; showing latest)

Test plan

  • `npm run build` — clean
  • `npx vitest run` — 291 / 291 pass; new render tests in card-builder + card-builder-v2; rewritten message-bridge tests
  • `npm run lint` — 0 errors, 2 pre-existing warnings (untouched)
  • Manual: trigger an Agent Teams burst between turns, confirm the resulting Feishu card has a blue "Agent activity" header and the body starts directly with the agent's text — no italic caption
  • Manual: confirm a tool-only burst produces no card (previously would have surfaced a card with just the caption)

🤖 Generated with Claude Code

The spontaneous between-turn card was leading every body with an italic
`Agent activity between turns (background task return, teammate ping, or
/goal evaluator):` caption. Users called it out as visual clutter — and
the underlying signal (this is a between-turn burst, not a regular turn)
should come from card chrome anyway, not from a long preamble.

Drop the caption; carry the signal in the card header instead.

- New `CardStatus = 'agent_activity'` — rendered as a blue header with
  the title "Agent activity" + 🔵 icon. Distinct from `running` /
  `thinking` (also blue but titled "Running…"/"Thinking…") and from
  `complete` (green) so users can tell at a glance whether the card is
  a live turn, a finished reply, or a between-turn burst.
- `flushSpontaneous` now uses the new status; `formatSpontaneousCardBody`
  returns just the latest snippet (and the coalesced-count footer for
  N>1 bursts) — no italic caption.
- Add a guard in `flushSpontaneous`: if the buffer somehow has zero
  snippets (e.g. tool-only burst that got fully filtered by the
  text-only extractor in #269), skip the card entirely. The empty card
  case is now unreachable but the guard is cheap insurance.
- Mirror the new status into v1 + v2 card builders, the Telegram
  sender's STATUS_EMOJI/STATUS_LABEL maps, and the web frontend
  CardStatus union. Drop the now-unused SPONTANEOUS_CARD_HEADER
  export and the regression tests that pinned its phrasing.

Tests
  - card-builder + card-builder-v2: add an agent_activity render test
    asserting blue header + "Agent activity" title + no body caption.
  - message-bridge: rewrite formatSpontaneousCardBody tests to assert
    the body is exactly the latest snippet, with no italic caption and
    no "between turns" / "long-running" substrings.

291 / 291 vitest pass. Build + lint clean (2 pre-existing warnings).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@floodsung floodsung merged commit 1c98fc3 into main May 14, 2026
3 checks passed
@floodsung floodsung deleted the feat/agent-activity-blue-card branch May 14, 2026 01:06
SimonYeyi pushed a commit to SimonYeyi/metabot that referenced this pull request May 26, 2026
…on (xvirobotics#271)

The spontaneous between-turn card was leading every body with an italic
`Agent activity between turns (background task return, teammate ping, or
/goal evaluator):` caption. Users called it out as visual clutter — and
the underlying signal (this is a between-turn burst, not a regular turn)
should come from card chrome anyway, not from a long preamble.

Drop the caption; carry the signal in the card header instead.

- New `CardStatus = 'agent_activity'` — rendered as a blue header with
  the title "Agent activity" + 🔵 icon. Distinct from `running` /
  `thinking` (also blue but titled "Running…"/"Thinking…") and from
  `complete` (green) so users can tell at a glance whether the card is
  a live turn, a finished reply, or a between-turn burst.
- `flushSpontaneous` now uses the new status; `formatSpontaneousCardBody`
  returns just the latest snippet (and the coalesced-count footer for
  N>1 bursts) — no italic caption.
- Add a guard in `flushSpontaneous`: if the buffer somehow has zero
  snippets (e.g. tool-only burst that got fully filtered by the
  text-only extractor in xvirobotics#269), skip the card entirely. The empty card
  case is now unreachable but the guard is cheap insurance.
- Mirror the new status into v1 + v2 card builders, the Telegram
  sender's STATUS_EMOJI/STATUS_LABEL maps, and the web frontend
  CardStatus union. Drop the now-unused SPONTANEOUS_CARD_HEADER
  export and the regression tests that pinned its phrasing.

Tests
  - card-builder + card-builder-v2: add an agent_activity render test
    asserting blue header + "Agent activity" title + no body caption.
  - message-bridge: rewrite formatSpontaneousCardBody tests to assert
    the body is exactly the latest snippet, with no italic caption and
    no "between turns" / "long-running" substrings.

291 / 291 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant