fold sub-agent prompt into the Agent card; relabel you → agent prompt (T-263)

A sidechain sub-agent prompt was rendered with the blue "you" label,
falsely implying the user typed it. Now:

- transcript_reader parses parentUuid (was dropped) onto every
  ConversationItem.
- conversation_view resolves each sidechain prompt to its spawning
  Agent/Task card via parentUuid (nearest-preceding Agent as fallback),
  folds the prompt into that card as a collapsed "prompt" segment, and
  suppresses the standalone block. Layered order when expanded:
  call → prompt → result (note E).
- A sidechain UserMessage never gets the "you" treatment: folded into its
  card, or — when orphaned — rendered as a muted standalone "agent prompt".

Tests: parentUuid parse, fold + suppression, parallel-agent attachment
(would fail under a nearest-preceding heuristic), orphan relabel, and a
golden for the Agent card's call → prompt → result layering.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-08 10:45:48 +02:00
co-authored by Claude Opus 4.8
parent c6bebcb1cb
commit a7a7b04a05
9 changed files with 227 additions and 32 deletions
@@ -51,6 +51,25 @@ void main() {
),
),
),
GoldenTestScenario(
name: 'agent / expanded (call → prompt → result layering, T-263)',
child: _wrap(
f,
const ConversationCard(
variant: ConversationCardVariant.bordered,
accent: Color(0xFF4C9AFF),
label: 'Task',
status: ConversationCardStatus.success,
collapsible: true,
collapsedByDefault: false,
body: Text('{ "description": "explore the codebase" }', textDirection: TextDirection.ltr),
extraSegments: [
CardSegment(label: 'prompt', child: Text('find all the widgets and summarise', textDirection: TextDirection.ltr)),
CardSegment(label: 'result', child: Text('found 42 widgets', textDirection: TextDirection.ltr)),
],
),
),
),
GoldenTestScenario(
name: 'error / header mark (call card stays separate from the red result card)',
child: _wrap(
Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 43 KiB