Skip to content

Commit 110ca6f

Browse files
committed
fix(showcase/google-adk): bring final 5 demos to D5 green
Five distinct root causes were keeping google-adk from full D5 parity with langgraph-python. Fixing them takes the integration to 38/38 D5 green under aimock locally (verified end-to-end with --live writing to PocketBase). - readonly-state-context: page.tsx asked for agent slug readonly_state_agent_context (underscore) but the registry mounts it kebab-case as readonly-state-agent-context. useAgent threw, the demo layout never mounted, and the ctx-name input never rendered. Align with the registry (and with langgraph-python). - multimodal: the secondary failure was a backend Pydantic ValidationError on HttpOptions.api_endpoint. google-genai 1.75 renamed the field to base_url; all three direct genai client constructors (main.py, beautiful_chat_agent.py, subagents_agent.py) needed the rename so the secondary A2UI / sub-agent LLM calls stop crashing. (The pre-existing LFS-pointer issue on the bundled sample.png/pdf was a worktree hydration problem, not a tracked code change — git lfs pull handles it.) - gen-ui-declarative (two bugs stacked): 1. The same api_endpoint -> base_url rename above. The secondary generate_a2ui planner LLM was failing every request. 2. The D5 fixture emitted components in {id, type, props: {...}} shape, but sanitize_a2ui_components requires component, so every entry was dropped and the renderer received an empty surface. Rewrite both the per-demo fixture and the d5-all.json aggregate to the flat {id, component, ...props} shape that langgraph-python's _design_a2ui_surface fixture already uses, wrapping multi-child layouts in a basic-catalog Column (the custom Card schema has a single child slot). Add _design_a2ui_surface variants so LGP gets per-pill payloads too. - shared-state-streaming: ADK's write_document took content and the PredictStateMapping read tool_argument="content", but the shared D5 fixture (and the LGP function signature) names the argument document. Rename both sides so the fixture's tool_call args plumb into the function and into PredictStateMapping's state-key emission. STATE_DELTA now propagates and DocumentView streams live. - tool-rendering-reasoning-chain: in thinking mode (include_thoughts=True), Gemini emits a turn as two separate non-partial chunks — a text-only chunk with finish_reason=None and a function-call-only chunk with finish_reason=FUNCTION_CALL. stop_on_terminal_text fired on the first (text-only) chunk and set end_invocation=True before the function-call chunk arrived, which broke AAPL->MSFT chaining. Gate termination on finish_reason=STOP; FUNCTION_CALL and None both mean "more chunks inbound — defer". Applies to every agent that uses the shared callback, so chain-aware behavior is uniform. Local verification: bin/showcase test google-adk --d5 --live finishes green for all 38 cells (~140s), dashboard reflects the results from PocketBase. Manual real-Gemini click-through of the five fixed demos also passes end-to-end via GOOGLE_GEMINI_BASE_URL= (empty) recreate.
1 parent 4d4bd19 commit 110ca6f

8 files changed

Lines changed: 378 additions & 199 deletions

File tree

showcase/aimock/d5-all.json

Lines changed: 72 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -2435,7 +2435,7 @@
24352435
}
24362436
},
24372437
{
2438-
"_comment": "render_a2ui — KPI dashboard pill. Emits Card root with three Metric children (revenue, signups, churn) so the probe sees declarative-card + declarative-metric.",
2438+
"_comment": "render_a2ui — KPI dashboard pill (Google-ADK secondary tool name). Card has a single `child` slot (per myDefinitions.Card.props.child: string), so we wrap the three Metrics in a basic-catalog Column to satisfy the multi-child layout.",
24392439
"match": {
24402440
"userMessage": "KPI dashboard",
24412441
"toolName": "render_a2ui"
@@ -2450,39 +2450,37 @@
24502450
"components": [
24512451
{
24522452
"id": "root",
2453-
"type": "Card",
2454-
"props": {
2455-
"title": "KPI dashboard",
2456-
"subtitle": "Last 30 days",
2457-
"child": "metric-revenue"
2458-
}
2453+
"component": "Card",
2454+
"title": "KPI dashboard",
2455+
"subtitle": "Last 30 days",
2456+
"child": "metrics-col"
2457+
},
2458+
{
2459+
"id": "metrics-col",
2460+
"component": "Column",
2461+
"children": ["metric-revenue", "metric-signups", "metric-churn"],
2462+
"gap": 12
24592463
},
24602464
{
24612465
"id": "metric-revenue",
2462-
"type": "Metric",
2463-
"props": {
2464-
"label": "Revenue",
2465-
"value": "$1.2M",
2466-
"trend": "up"
2467-
}
2466+
"component": "Metric",
2467+
"label": "Revenue",
2468+
"value": "$1.2M",
2469+
"trend": "up"
24682470
},
24692471
{
24702472
"id": "metric-signups",
2471-
"type": "Metric",
2472-
"props": {
2473-
"label": "Signups",
2474-
"value": "4,820",
2475-
"trend": "up"
2476-
}
2473+
"component": "Metric",
2474+
"label": "Signups",
2475+
"value": "4,820",
2476+
"trend": "up"
24772477
},
24782478
{
24792479
"id": "metric-churn",
2480-
"type": "Metric",
2481-
"props": {
2482-
"label": "Churn",
2483-
"value": "2.1%",
2484-
"trend": "down"
2485-
}
2480+
"component": "Metric",
2481+
"label": "Churn",
2482+
"value": "2.1%",
2483+
"trend": "down"
24862484
}
24872485
],
24882486
"data": {}
@@ -2492,7 +2490,7 @@
24922490
}
24932491
},
24942492
{
2495-
"_comment": "render_a2ui — pie-chart pill. Emits a PieChart so the probe sees declarative-pie-chart.",
2493+
"_comment": "render_a2ui — pie-chart pill (Google-ADK). Flat {id, component, ...props} shape.",
24962494
"match": {
24972495
"userMessage": "pie chart of sales by region",
24982496
"toolName": "render_a2ui"
@@ -2507,29 +2505,15 @@
25072505
"components": [
25082506
{
25092507
"id": "root",
2510-
"type": "PieChart",
2511-
"props": {
2512-
"title": "Sales by region",
2513-
"description": "Q4 — share of total revenue",
2514-
"data": [
2515-
{
2516-
"label": "North America",
2517-
"value": 540
2518-
},
2519-
{
2520-
"label": "EMEA",
2521-
"value": 320
2522-
},
2523-
{
2524-
"label": "APAC",
2525-
"value": 210
2526-
},
2527-
{
2528-
"label": "LATAM",
2529-
"value": 90
2530-
}
2531-
]
2532-
}
2508+
"component": "PieChart",
2509+
"title": "Sales by region",
2510+
"description": "Q4 — share of total revenue",
2511+
"data": [
2512+
{ "label": "North America", "value": 540 },
2513+
{ "label": "EMEA", "value": 320 },
2514+
{ "label": "APAC", "value": 210 },
2515+
{ "label": "LATAM", "value": 90 }
2516+
]
25332517
}
25342518
],
25352519
"data": {}
@@ -2539,7 +2523,7 @@
25392523
}
25402524
},
25412525
{
2542-
"_comment": "render_a2ui — bar-chart pill. Emits a BarChart so the probe sees declarative-bar-chart.",
2526+
"_comment": "render_a2ui — bar-chart pill (Google-ADK). Flat {id, component, ...props} shape.",
25432527
"match": {
25442528
"userMessage": "bar chart of quarterly revenue",
25452529
"toolName": "render_a2ui"
@@ -2554,29 +2538,15 @@
25542538
"components": [
25552539
{
25562540
"id": "root",
2557-
"type": "BarChart",
2558-
"props": {
2559-
"title": "Quarterly revenue",
2560-
"description": "FY24 — USD thousands",
2561-
"data": [
2562-
{
2563-
"label": "Q1",
2564-
"value": 820
2565-
},
2566-
{
2567-
"label": "Q2",
2568-
"value": 940
2569-
},
2570-
{
2571-
"label": "Q3",
2572-
"value": 1080
2573-
},
2574-
{
2575-
"label": "Q4",
2576-
"value": 1240
2577-
}
2578-
]
2579-
}
2541+
"component": "BarChart",
2542+
"title": "Quarterly revenue",
2543+
"description": "FY24 — USD thousands",
2544+
"data": [
2545+
{ "label": "Q1", "value": 820 },
2546+
{ "label": "Q2", "value": 940 },
2547+
{ "label": "Q3", "value": 1080 },
2548+
{ "label": "Q4", "value": 1240 }
2549+
]
25802550
}
25812551
],
25822552
"data": {}
@@ -2586,7 +2556,7 @@
25862556
}
25872557
},
25882558
{
2589-
"_comment": "render_a2ui — status-report pill. Emits a Card root containing three StatusBadge children (API/database/workers) so the probe sees declarative-card + declarative-status-badge.",
2559+
"_comment": "render_a2ui — status-report pill (Google-ADK). Card has single `child` slot, so wrap the three StatusBadges in a basic-catalog Column.",
25902560
"match": {
25912561
"userMessage": "status report on system health",
25922562
"toolName": "render_a2ui"
@@ -2601,36 +2571,34 @@
26012571
"components": [
26022572
{
26032573
"id": "root",
2604-
"type": "Card",
2605-
"props": {
2606-
"title": "System health",
2607-
"subtitle": "All services",
2608-
"child": "status-api"
2609-
}
2574+
"component": "Card",
2575+
"title": "System health",
2576+
"subtitle": "All services",
2577+
"child": "status-col"
2578+
},
2579+
{
2580+
"id": "status-col",
2581+
"component": "Column",
2582+
"children": ["status-api", "status-db", "status-workers"],
2583+
"gap": 8
26102584
},
26112585
{
26122586
"id": "status-api",
2613-
"type": "StatusBadge",
2614-
"props": {
2615-
"text": "API: healthy",
2616-
"variant": "success"
2617-
}
2587+
"component": "StatusBadge",
2588+
"text": "API: healthy",
2589+
"variant": "success"
26182590
},
26192591
{
26202592
"id": "status-db",
2621-
"type": "StatusBadge",
2622-
"props": {
2623-
"text": "Database: healthy",
2624-
"variant": "success"
2625-
}
2593+
"component": "StatusBadge",
2594+
"text": "Database: healthy",
2595+
"variant": "success"
26262596
},
26272597
{
26282598
"id": "status-workers",
2629-
"type": "StatusBadge",
2630-
"props": {
2631-
"text": "Workers: degraded",
2632-
"variant": "warning"
2633-
}
2599+
"component": "StatusBadge",
2600+
"text": "Workers: degraded",
2601+
"variant": "warning"
26342602
}
26352603
],
26362604
"data": {}
@@ -2640,7 +2608,7 @@
26402608
}
26412609
},
26422610
{
2643-
"_comment": "render_a2ui — fallback for any unmatched pill. Emits the original Card+Metric so unforeseen pills still render something deterministic instead of erroring.",
2611+
"_comment": "render_a2ui — fallback for any unmatched pill (Google-ADK). Single Metric child satisfies Card's single-slot schema.",
26442612
"match": {
26452613
"toolName": "render_a2ui"
26462614
},
@@ -2654,21 +2622,17 @@
26542622
"components": [
26552623
{
26562624
"id": "root",
2657-
"type": "Card",
2658-
"props": {
2659-
"title": "Declarative Demo",
2660-
"subtitle": "Catalog primitives",
2661-
"child": "metric-1"
2662-
}
2625+
"component": "Card",
2626+
"title": "Declarative Demo",
2627+
"subtitle": "Catalog primitives",
2628+
"child": "metric-1"
26632629
},
26642630
{
26652631
"id": "metric-1",
2666-
"type": "Metric",
2667-
"props": {
2668-
"label": "Revenue",
2669-
"value": "$1.2M",
2670-
"trend": "up"
2671-
}
2632+
"component": "Metric",
2633+
"label": "Revenue",
2634+
"value": "$1.2M",
2635+
"trend": "up"
26722636
}
26732637
],
26742638
"data": {}

0 commit comments

Comments
 (0)