attribute sidechain prose/thinking to the agent, not claude (T-265); close T-267

A sub-agent's prose rendered as "claude" and its thinking as "thinking",
identical to the main assistant, because the label logic ignored
isSidechain — presenting sub-agent output as if the main Claude said it.
Now a sidechain AssistantTextMessage is labelled "agent" with a muted
stripe (never the coral claudeAccent brand), and sidechain thinking is
"agent thinking". Main-thread items are unchanged.

Tests: sidechain prose/thinking relabel, main-thread unchanged; golden
contrasting the muted agent stripe with the coral claude stripe.

This completes epic T-267 (conversation rendering streamlining): fold
success result (T-262), fold agent prompt (T-263), nest the agent run
(T-264), the shared holder primitive (T-266), and this attribution fix.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-08 12:09:47 +02:00
co-authored by Claude Opus 4.8
parent db6ecbd5df
commit 069879620f
7 changed files with 109 additions and 3 deletions
@@ -393,6 +393,32 @@ void main() {
expect(find.bySemanticsLabel('agent run, 2 steps, collapsed'), findsNothing);
});
testWidgets('sidechain assistant prose is attributed to "agent", not "claude" (T-265)', (tester) async {
// An orphan sidechain prose (no resolvable Agent) renders inline, still
// attributed to the agent — never the main-thread coral "claude".
await pumpWith(tester, [
AssistantTextMessage(uuid: 's', timestamp: _t, isSidechain: true, text: 'sub-agent says hi'),
]);
expect(find.text('agent'), findsOneWidget);
expect(find.text('claude'), findsNothing);
});
testWidgets('sidechain thinking is attributed to "agent thinking" (T-265)', (tester) async {
await pumpWith(tester, [
AssistantThinkingMessage(uuid: 's', timestamp: _t, isSidechain: true, thinking: 'hmm let me think'),
]);
expect(find.text('agent thinking'), findsOneWidget);
expect(find.text('thinking'), findsNothing);
});
testWidgets('main-thread prose + thinking keep "claude"/"thinking" (T-265 unchanged)', (tester) async {
await pumpWith(tester, [_asst('main says hi'), _think('main thought')]);
expect(find.text('claude'), findsOneWidget);
expect(find.text('thinking'), findsOneWidget);
expect(find.text('agent'), findsNothing);
expect(find.text('agent thinking'), findsNothing);
});
testWidgets('a permission-prompted tool-use is hidden but its result is kept', (tester) async {
await pumpWith(
tester,
@@ -1,5 +1,6 @@
import 'package:alchemist/alchemist.dart';
import 'package:clide/builtin/claude/src/conversation_card.dart';
import 'package:clide/builtin/claude/src/conversation_view.dart' show claudeAccent;
import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';
@@ -12,6 +13,38 @@ void main() {
setUp(() async => f = await KernelFixture.create());
tearDown(() async => f.dispose());
goldenTest(
'ConversationCard attribution (T-265): agent prose is muted, claude prose is coral',
fileName: 'conversation_card_attribution',
builder: () => GoldenTestGroup(
columns: 1,
children: [
GoldenTestScenario(
name: 'claude (main thread) — coral brand stripe',
child: _wrap(
f,
const ConversationCard(
accent: claudeAccent,
label: 'claude',
body: Text('Here is the main-thread answer.', textDirection: TextDirection.ltr),
),
),
),
GoldenTestScenario(
name: 'agent (sidechain) — muted stripe, not coral',
child: _wrap(
f,
ConversationCard(
accent: const Color(0xFF8B8B8B),
label: 'agent',
body: const Text('Here is the sub-agent answer.', textDirection: TextDirection.ltr),
),
),
),
],
),
);
goldenTest(
'ConversationCard merged tool card (T-262): status mark + folded result segment',
fileName: 'conversation_card_merged',
Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB