Skip to content

test(agent): pin the conversation message contract - ConversationMessage - #2033

Merged
dmitrii-f-t27 merged 1 commit into
queenfrom
zcode/tests-1569-conversation-message
Oct 15, 2026
Merged

dmitrii-f-t27 merged 1 commit into
queenfrom
zcode/tests-1569-conversation-message

Conversation

@dmitrii-f-t27

Copy link
Copy Markdown
Collaborator

Summary

Hold the one export of trios/agent-server/apps/agent/entrypoints/app/agent-command/ConversationMessage.tsx β€” ConversationMessage β€” against its contract (#1569), so the next change to that file has something to fail against.

The message is a render plan over the turn, and what is pinned is what it answers today:

  • the live turn (streaming, a running tool in the batch): the user text in its bubble; the done thinking part behind the closed reasoning trigger with its Thought for a few seconds label; the task entry with the Working… (3 actions) title, the wrench trigger, and every tool row β€” status icon (lucide-loader-circle / lucide-circle-check / lucide-circle-x), label, Β· subject, and the measured duration (1.5s); the produced-files strip with the file name and size; and the assistant text draws nothing β€” the shared streamdown renderer's default stream mode mounts empty, the same measured reality the ChatMessages suite pins β€” with the bouncing-dots placeholder away while parts exist;
  • the streaming empty turn: the bot avatar with exactly three bouncing dots, and no strip;
  • the strip-only mount: the strip alone β€” the user text and the task stay away;
  • the done turn: the singular Agent activity (1 action) title with the task rows collapsed away (the task's defaultOpen wiring).

No module is mocked here at all: the strip's turn-files fallback rides a real query client the way the outputs-rail suite mounts it, and every kit stays real β€” so this suite adds no global stand-ins for any other suite to race.

Verification

  • bun test entrypoints/app/agent-command/ConversationMessage.test.ts β€” 4 pass, 0 fail.
  • Broken-copy proof: swapping the task-title ternary (allDone β†’ !allDone) turns exactly the first and fourth tests red (2 fail); the copy restores clean via git checkout.
  • Mixed-order run with the whole entrypoints/app/agent-command/ group: 47 pass + the one pre-existing ConversationInput local-order failure that fails identically without this suite (the marker-stub readdir artifact, not touched by this change β€” this suite registers no mocks).
  • biome ci on the suite file: clean. tsgo --noEmit: 0 mentions of the suite file.

Closes #1569

Dmitrii Fedorov (@dmitrii-f-t27)

Hold the one export of entrypoints/app/agent-command/ConversationMessage.tsx
against its contract (#1569): the live turn answers the user
text, the closed done-thinking trigger with its Thought label, the working
task with the wrench trigger and every tool row with its status icon,
subject and measured duration, and the produced file strip - the assistant
text rides the streamdown renderer that mounts empty, the same measured
reality the ChatMessages suite pins. The streaming empty turn answers the
bot avatar with exactly three bouncing dots, the strip-only mount answers
the strip alone, and the done turn collapses the task behind the singular
activity title with its rows away. No module is mocked: the strip's
turn-files fallback rides a real query client the way the outputs-rail
suite mounts it.

Closes #1569

Dmitrii Fedorov ([@dmitrii-f-t27](https://github.com/dmitrii-f-t27))
@tri-claw

tri-claw Bot commented Oct 15, 2026

Copy link
Copy Markdown

Summary by t27-bees

This PR adds a contract test for the ConversationMessage component, pinning its current render output across four turn states (live, streaming-empty, strip-only, done) so future changes have a baseline to fail against. The test uses real dependencies (no mocks) and renders to static markup for string assertions.

Worth a look

  • ConversationMessage.test.ts:27 β€” A single QueryClient instance is shared across all tests; React Query's cache persists between test cases, so later tests may see stale data from earlier ones (e.g., the strip's turn-files query could resolve from a prior test's cache).
  • ConversationMessage.test.ts:30–36 β€” renderToStaticMarkup produces SSR HTML only; it does not run client-side effects, layout measurements, or the streamdown renderer's streaming logic, so assertions like "assistant text draws nothing" only verify the initial server render, not the mounted behavior.
  • ConversationMessage.test.ts:13–14 β€” The dynamic import with ?conversation-message-suite-real relies on a bundler-specific query parameter to force a fresh module graph; this ties the test to Vite (or compatible) and may break in other environments or if the bundler configuration changes.
  • ConversationMessage.test.ts:58–95 β€” Assertions check for exact icon class names (lucide-loader-circle, lucide-wrench, animate-bounce) and hardcoded label strings (Thought for a few seconds, Working… (3 actions)); these are implementation details of the UI kit and copy that will churn independently of the component's contract, making the test brittle.
  • ConversationMessage.test.ts:78 β€” The animate-bounce count assertion (split('animate-bounce').length - 1) assumes the class appears exactly once per dot and nowhere else; any wrapper or utility adding the same class will cause a false failure.

Read: 1 files, +193 -0, the whole diff. Head 5c117c3. Model: openai-compatible/nvidia/nemotron-3-ultra-550b-a55b. Commands: @t27-bees review | summary | help | pause | resume. Free for every repository.

@github-actions

Copy link
Copy Markdown

βœ… Tests passed β€” 3880/3950

Suite Passed Failed Skipped
βœ… agent 423/423 0 0
βœ… build 9/9 0 0
βœ… cdp-protocol 5/5 0 0
βœ… eval 93/93 0 0
βœ… server-agent 280/280 0 0
βœ… server-api 2244/2313 0 69
βœ… server-browser 6/6 0 0
βœ… server-integration 10/11 0 1
βœ… server-lib 279/279 0 0
βœ… server-pglive 166/166 0 0
βœ… server-root 68/68 0 0
βœ… server-sim 8/8 0 0
βœ… server-skills 31/31 0 0
βœ… server-tools 244/244 0 0
βœ… shared 14/14 0 0

View workflow run

@dmitrii-f-t27
dmitrii-f-t27 merged commit 04526a6 into queen Oct 15, 2026
19 checks passed
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