Skip to content

Commit 508bea0

Browse files
committed
fix(showcase): unblock LGP D6 beautiful-chat + custom-catchall via d4 matcher narrowing
Aimock fixture load order is shared -> d4 -> d6, and matching is first-match-wins. A broad d4 langgraph-python chat fixture for search_flights was shadowing the d6 beautiful-chat fixture and preventing the intended response from firing. Neutered the d4 matcher to a non-matching sentinel so the d6 fixture wins. Also refreshed d6/tool-rendering-custom-catchall.json and d6/tool-rendering.json: replaced fragile turnIndex:0 gates with hasToolResult:false so the AAPL first-leg fixture fires correctly when D5 probes run a prior 'weather in Tokyo' pill in the same thread (multi-pill turnIndex>=2). LGP D6 now passes 185/0/2 locally (2 skips are the by-design mcp-apps iframe gap).
1 parent fb2ac57 commit 508bea0

3 files changed

Lines changed: 161 additions & 34 deletions

File tree

showcase/aimock/d4/langgraph-python/chat.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,9 @@
266266
}
267267
},
268268
{
269-
"_comment": "D4 probe sends 'What's the weather in San Francisco?'. Narrowed userMessage to 'weather in San Francisco' so this no longer shadows D6 tool-rendering pills that contain the substring 'weather' (e.g. 'Chain a few tools ... weather in Tokyo'). Args also realigned to the get_weather(location) Pydantic schema with the SF location the probe actually asks for.",
269+
"_comment": "Disabled: prior matcher 'weather in San Francisco' load-order-shadowed D6 pills like 'What's the weather in San Francisco?' (custom-catchall) and 'Chain a few tools ... weather in Tokyo' (default-catchall). Mirrors the LGT d4 fix at aimock/d4/langgraph-typescript/chat.json — userMessage renamed to a non-matching sentinel so this entry is effectively dead; downstream D6 fixtures own the get_weather flow for SF.",
270270
"match": {
271-
"userMessage": "weather in San Francisco",
271+
"userMessage": "_d4_unused_weather_probe_sf",
272272
"hasToolResult": false,
273273
"context": "langgraph-python"
274274
},
@@ -474,9 +474,9 @@
474474
}
475475
},
476476
{
477-
"_comment": "Realigned args to match search_flights(origin, destination) Pydantic schema in tool_rendering_agent.py — the demo D4 probes through /demos/tool-rendering. The prior {flights:[...]} shape was a leftover from beautiful-chat's search_flights(flights:list[Flight]) tool — that tool only exists on the beautiful-chat agent, not on tool-rendering. With the wrong shape the tool errored with Pydantic 'origin/destination: Field required', which suppressed the tool card and broke D6 tool-rendering pills that share this prompt. Narrowed userMessage to 'Find flights from SFO to JFK.' (note trailing period — verbatim D4 probe + basic tool-rendering pill prompt) so this no longer shadows the D6 reasoning-chain pill 'Find flights from SFO to JFK and show me the weather there.' (no period after JFK).",
477+
"_comment": "Disabled: 'flights from SFO to JFK for next Tuesday' was the exact pill prompt for the D6 beautiful-chat 'Search Flights (A2UI Fixed Schema)' demo, so this d4 fixture load-order-shadowed the d6 beautiful-chat fixture (d4 loads before d6). The d4 chat-roundtrip probe sends 'Hello, please respond with a brief greeting.' / 'What's the weather in San Francisco?' (see harness/src/probes/drivers/d4-chat-roundtrip.ts) — it does not exercise the flights tool, so this entry is dead. Mirrors the disabled-weather pattern earlier in this file (_d4_unused_weather_probe_sf). The d6 beautiful-chat fixture in aimock/d6/langgraph-python/beautiful-chat.json (userMessage matcher 'for next Tuesday') now owns this pill.",
478478
"match": {
479-
"userMessage": "Find flights from SFO to JFK.",
479+
"userMessage": "_d4_unused_flights_probe_sfo_jfk",
480480
"hasToolResult": false,
481481
"context": "langgraph-python"
482482
},

showcase/aimock/d6/langgraph-python/tool-rendering-custom-catchall.json

Lines changed: 153 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,211 @@
11
{
22
"_meta": {
3-
"description": "D6 fixtures for langgraph-python / tool-rendering-custom-catchall",
3+
"description": "D6 fixtures for langgraph-python / tool-rendering-custom-catchall. Pills: 'Weather in SF' (get_weather/San Francisco), 'Find flights' (search_flights/SFO->JFK), 'Roll a d20' (5 sequential roll_d20 calls ending in 20), 'Chain tools' (get_weather Tokyo + search_flights SFO->Tokyo + roll_d20=11). Backend tools execute on LangGraph Python and return real JSON results, which the wildcard renderer surfaces in the result block. Mirrors the matcher/tool-call shape of d6/langgraph-python/tool-rendering.json, with distinct toolCallIds to avoid cross-fixture leakage. PILL PROMPTS (must match suggestions.ts verbatim): \"What's the weather in San Francisco?\", \"Find flights from SFO to JFK.\", \"Roll a 20-sided die.\", \"Chain a few tools in this single turn: get the weather in Tokyo, search flights from SFO to Tokyo, and roll a d20.\"",
44
"sourceFile": "d5-tool-rendering-custom-catchall.ts",
5-
"created": "2026-05-22"
5+
"created": "2026-05-22",
6+
"updated": "2026-05-29"
67
},
78
"fixtures": [
89
{
9-
"_comment": "tool-rendering-custom-catchall \u2014 weather in Tokyo follow-up. After get_weather tool result returns, emit narrated content. MUST come before the tool-emitting fixture so iteration 2 hits this branch.",
10+
"_comment": "Chain tools — follow-up after all 3 tools ran. Anchored on whichever of the 3 chain toolCallIds appears last in the request (LangGraph's ToolNode preserves tool_calls order). MUST come before the toolCalls-emitting fixture below so iteration 2 of the chain-tools loop hits this branch instead of re-emitting.",
1011
"match": {
11-
"userMessage": "check Tokyo weather forecast",
12-
"toolCallId": "call_d6_cc_weather_001",
12+
"userMessage": "Chain a few tools in this single turn",
13+
"toolCallId": "call_trcc_chain_roll_001",
1314
"context": "langgraph-python"
1415
},
1516
"response": {
16-
"content": "Tokyo is 22\u00b0C and partly cloudy \u2014 rendered through the custom wildcard catchall."
17+
"content": "Done — Tokyo is sunny, three flights found, and the d20 came up 11."
1718
}
1819
},
1920
{
20-
"_comment": "tool-rendering-custom-catchall \u2014 weather in Tokyo (first turn). Emits get_weather tool call. The custom wildcard renderer fires for this tool and renders [data-testid='custom-wildcard-card'][data-tool-name='get_weather'].",
2121
"match": {
22-
"userMessage": "check Tokyo weather forecast",
23-
"toolName": "get_weather",
22+
"userMessage": "Chain a few tools in this single turn",
23+
"toolCallId": "call_trcc_chain_flights_001",
24+
"context": "langgraph-python"
25+
},
26+
"response": {
27+
"content": "Done — Tokyo is sunny, three flights found, and the d20 came up 11."
28+
}
29+
},
30+
{
31+
"match": {
32+
"userMessage": "Chain a few tools in this single turn",
33+
"toolCallId": "call_trcc_chain_weather_001",
34+
"context": "langgraph-python"
35+
},
36+
"response": {
37+
"content": "Done — Tokyo is sunny, three flights found, and the d20 came up 11."
38+
}
39+
},
40+
{
41+
"_comment": "Chain tools — emit 3 tool calls in one assistant turn (get_weather Tokyo + search_flights SFO->Tokyo + roll_d20=11). No turnIndex/hasToolResult gate: in multi-pill demo sessions prior clicks leave tool results AND additional user turns in the thread; the toolCallId fixtures above eat iteration 2 via last-message tool_call_id gating.",
42+
"match": {
43+
"userMessage": "Chain a few tools in this single turn",
2444
"context": "langgraph-python"
2545
},
2646
"response": {
2747
"toolCalls": [
2848
{
29-
"id": "call_d6_cc_weather_001",
49+
"id": "call_trcc_chain_weather_001",
3050
"name": "get_weather",
3151
"arguments": "{\"location\":\"Tokyo\"}"
52+
},
53+
{
54+
"id": "call_trcc_chain_flights_001",
55+
"name": "search_flights",
56+
"arguments": "{\"origin\":\"SFO\",\"destination\":\"Tokyo\"}"
57+
},
58+
{
59+
"id": "call_trcc_chain_roll_001",
60+
"name": "roll_d20",
61+
"arguments": "{\"value\":11}"
62+
}
63+
]
64+
}
65+
},
66+
{
67+
"_comment": "Weather in SF — follow-up content after get_weather tool ran. MUST come before the tool-emitting fixture below (first-match-wins) so iteration 2 of the loop hits this branch instead of re-emitting. toolCallId chain keeps the fixture stateless across multi-pill thread history.",
68+
"match": {
69+
"userMessage": "What's the weather in San Francisco?",
70+
"toolCallId": "call_trcc_weather_sf_001",
71+
"context": "langgraph-python"
72+
},
73+
"response": {
74+
"content": "San Francisco is currently 68°F and sunny with light winds — rendered through the custom wildcard catchall."
75+
}
76+
},
77+
{
78+
"_comment": "Weather in SF — first turn: emit get_weather tool call with location=San Francisco. The wildcard renderer paints [data-testid='custom-wildcard-card'][data-tool-name='get_weather'] with args containing 'San Francisco'.",
79+
"match": {
80+
"userMessage": "What's the weather in San Francisco?",
81+
"context": "langgraph-python"
82+
},
83+
"response": {
84+
"toolCalls": [
85+
{
86+
"id": "call_trcc_weather_sf_001",
87+
"name": "get_weather",
88+
"arguments": "{\"location\":\"San Francisco\"}"
3289
}
3390
]
3491
}
3592
},
3693
{
37-
"_comment": "tool-rendering-custom-catchall \u2014 weather in Tokyo fallback when no get_weather tool registered.",
94+
"_comment": "Find flights — follow-up content after search_flights ran. MUST come BEFORE the first-leg fixture below — the matcher is first-match-wins, and the second leg is uniquely identified by `toolCallId` (last message is a tool with this id), so it cannot accidentally swallow the first-leg request (whose last message is the user prompt). The result block of the wildcard card surfaces the tool execution JSON (which already contains 'United', 'Delta', 'JetBlue' from the Python backend); this narration is just to terminate the agent loop.",
3895
"match": {
39-
"userMessage": "check Tokyo weather forecast",
40-
"turnIndex": 0,
96+
"userMessage": "Find flights from SFO to JFK.",
97+
"toolCallId": "call_trcc_flights_sfo_jfk_001",
4198
"context": "langgraph-python"
4299
},
43100
"response": {
44-
"content": "The weather in Tokyo is currently 22\u00b0C with partly cloudy skies."
101+
"content": "Three flights from SFO to JFK — United UA231 at 08:15 ($348), Delta DL412 at 11:20 ($312), and JetBlue B6722 at 17:05 ($289)."
45102
}
46103
},
47104
{
48-
"_comment": "tool-rendering-custom-catchall \u2014 AAPL stock price follow-up. After get_stock_price tool result returns. MUST come before the tool-emitting fixture.",
105+
"_comment": "Find flights — first turn: emit search_flights tool call (SFO -> JFK). Backend executes and returns the 3-flight result list; the wildcard renderer surfaces 'United'/'Delta'/'JetBlue' in the result block.",
49106
"match": {
50-
"userMessage": "What's the current price of AAPL?",
51-
"toolCallId": "call_d6_cc_stock_001",
107+
"userMessage": "Find flights from SFO to JFK.",
52108
"context": "langgraph-python"
53109
},
54110
"response": {
55-
"content": "AAPL is trading at $338.37, down 2.96% \u2014 rendered through the custom wildcard catchall."
111+
"toolCalls": [
112+
{
113+
"id": "call_trcc_flights_sfo_jfk_001",
114+
"name": "search_flights",
115+
"arguments": "{\"origin\":\"SFO\",\"destination\":\"JFK\"}"
116+
}
117+
]
56118
}
57119
},
58120
{
59-
"_comment": "tool-rendering-custom-catchall \u2014 AAPL stock price (second turn). Emits get_stock_price tool call. The custom wildcard renderer fires for this DIFFERENT tool and renders [data-testid='custom-wildcard-card'][data-tool-name='get_stock_price']. The cross-tool assertion verifies both tool names rendered through the same testid.",
121+
"_comment": "Roll a d20 — exactly 5 sequential roll_d20 calls returning [7, 14, 3, 19, 20]. Chained by toolCallId so the sequence is stateless across thread history. Specific-toolCallId fixtures MUST come before the userMessage-only fixture below; first-match-wins. The 5th roll has value=20 so the result block of the 5th card surfaces \"value\":20.",
60122
"match": {
61-
"userMessage": "What's the current price of AAPL?",
62-
"toolName": "get_stock_price",
123+
"userMessage": "Roll a 20-sided die.",
124+
"toolCallId": "call_trcc_d20_seq_001",
63125
"context": "langgraph-python"
64126
},
65127
"response": {
66128
"toolCalls": [
67129
{
68-
"id": "call_d6_cc_stock_001",
69-
"name": "get_stock_price",
70-
"arguments": "{\"ticker\":\"AAPL\",\"price_usd\":338.37,\"change_pct\":-2.96}"
130+
"id": "call_trcc_d20_seq_002",
131+
"name": "roll_d20",
132+
"arguments": "{\"value\":14}"
71133
}
72134
]
73135
}
74136
},
75137
{
76-
"_comment": "tool-rendering-custom-catchall \u2014 AAPL fallback when no get_stock_price tool registered.",
77138
"match": {
78-
"userMessage": "What's the current price of AAPL?",
79-
"turnIndex": 0,
139+
"userMessage": "Roll a 20-sided die.",
140+
"toolCallId": "call_trcc_d20_seq_002",
80141
"context": "langgraph-python"
81142
},
82143
"response": {
83-
"content": "AAPL is trading at $338.37, down 2.96% on the day."
144+
"toolCalls": [
145+
{
146+
"id": "call_trcc_d20_seq_003",
147+
"name": "roll_d20",
148+
"arguments": "{\"value\":3}"
149+
}
150+
]
151+
}
152+
},
153+
{
154+
"match": {
155+
"userMessage": "Roll a 20-sided die.",
156+
"toolCallId": "call_trcc_d20_seq_003",
157+
"context": "langgraph-python"
158+
},
159+
"response": {
160+
"toolCalls": [
161+
{
162+
"id": "call_trcc_d20_seq_004",
163+
"name": "roll_d20",
164+
"arguments": "{\"value\":19}"
165+
}
166+
]
167+
}
168+
},
169+
{
170+
"match": {
171+
"userMessage": "Roll a 20-sided die.",
172+
"toolCallId": "call_trcc_d20_seq_004",
173+
"context": "langgraph-python"
174+
},
175+
"response": {
176+
"toolCalls": [
177+
{
178+
"id": "call_trcc_d20_seq_005",
179+
"name": "roll_d20",
180+
"arguments": "{\"value\":20}"
181+
}
182+
]
183+
}
184+
},
185+
{
186+
"match": {
187+
"userMessage": "Roll a 20-sided die.",
188+
"toolCallId": "call_trcc_d20_seq_005",
189+
"context": "langgraph-python"
190+
},
191+
"response": {
192+
"content": "Rolled the d20 five times — landed on 20 on the final roll."
193+
}
194+
},
195+
{
196+
"_comment": "First roll. Matches the initial user prompt (no prior d20 tool result in this chain yet). Comes after the toolCallId-chained fixtures above so iterations 2-6 of the loop hit those first. The multi-pill sequential e2e test clicks 'Find flights' first which leaves prior turns in the thread, so a new 'Roll a 20-sided die.' user message is no longer at turnIndex 0 — keep this fixture turnIndex-less. The toolCallId-chained fixtures still take precedence for iterations 2-6 because their last-message gate (role=tool with the chained id) only matches mid-chain — this fixture only matches when last-message.role=user.",
197+
"match": {
198+
"userMessage": "Roll a 20-sided die.",
199+
"context": "langgraph-python"
200+
},
201+
"response": {
202+
"toolCalls": [
203+
{
204+
"id": "call_trcc_d20_seq_001",
205+
"name": "roll_d20",
206+
"arguments": "{\"value\":7}"
207+
}
208+
]
84209
}
85210
}
86211
]

showcase/aimock/d6/langgraph-python/tool-rendering.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,10 @@
112112
}
113113
},
114114
{
115+
"_comment": "AAPL — first leg: emit get_stock_price tool call. turnIndex:0 gate REMOVED — the D5 tool-rendering-custom-catchall probe runs 'weather in Tokyo' first then sends 'What's the current price of AAPL?', so the AAPL leg fires at turnIndex>=2 (multi-pill thread). Replaced with hasToolResult:false: matches when the last message is a user prompt (not a tool result), which keeps the first-leg fixture from re-firing after the follow-up content already lands. The toolCallId follow-up fixture above wins on iteration 2 (last message is tool with id call_tr_stock_aapl_001).",
115116
"match": {
116117
"userMessage": "What's the current price of AAPL?",
117-
"turnIndex": 0,
118+
"hasToolResult": false,
118119
"context": "langgraph-python"
119120
},
120121
"response": {
@@ -288,9 +289,10 @@
288289
}
289290
},
290291
{
292+
"_comment": "AAPL — first leg: emit get_stock_price tool call. turnIndex:0 gate REMOVED — the D5 tool-rendering-custom-catchall probe runs 'weather in Tokyo' first then sends 'What's the current price of AAPL?', so the AAPL leg fires at turnIndex>=2 (multi-pill thread). Replaced turnIndex:0 with hasToolResult:false: matches when the last message is a user prompt (not a tool result), which keeps the first-leg fixture from re-firing after the follow-up content already lands. The toolCallId follow-up fixture above wins on iteration 2 (last message is tool with id call_d5_get_stock_price_001).",
291293
"match": {
292294
"userMessage": "AAPL",
293-
"turnIndex": 0,
295+
"hasToolResult": false,
294296
"context": "langgraph-python"
295297
},
296298
"response": {

0 commit comments

Comments
 (0)