Commit Graph

17 Commits

Author SHA1 Message Date
Mark 84cdb702d2 Merge branch 'main' into tyler/confident-meitner-019a9f 2026-06-04 09:50:18 -07:00
Jordan Ritter 93b5fdd467 test(showcase): align google-adk e2e specs to langgraph-python canonical
Integration specs had drifted/staled vs LGP gold standard; copied LGP's canonical
specs verbatim and removed the orphan shared-state-write spec whose demo exists
in neither LGP nor google-adk.
2026-05-29 23:59:32 -07:00
Jordan Ritter 6e6878349a fix(showcase): use pressSequentially instead of fill for sandboxed iframe input
fill() silently no-ops inside sandbox="allow-scripts" iframes on some
Playwright/Chromium combos because the null origin blocks the
set-value protocol message. The input.value stays empty, so the
host-side evaluateExpression handler rejects it with "Unsupported
characters" and the test never sees a console log.

pressSequentially sends individual key events that always reach the
input regardless of sandbox restrictions.
2026-05-18 21:41:37 -07:00
Alem Tuzlak 4a27087094 test(showcase/google-adk): default fake LlmResponse to finish_reason=STOP
The Python unit tests for stop_on_terminal_text /
simple_after_model_modifier built fake LlmResponse objects without a
finish_reason field. That worked before the thinking-mode fix in #4826,
which added a finish_reason="STOP" gate so the callback no longer
terminates on text-only chunks that arrive non-partial with
finish_reason=None (Gemini thinking-mode emits a text-only chunk first,
then a separate function-call chunk — terminating on the first would
skip the second).

Fix: default the fake response's finish_reason to "STOP" (the real
terminal-response shape) and also stub turn_complete=None so the
matcher path the callback walks lines up with what production sees.
Local pytest on Python 3.10 → 23/23 green.
2026-05-15 14:31:10 +02:00
Alem Tuzlak 02e48162c4 test(showcase/google-adk): sync e2e specs to langgraph-python north-star
Ports 16 diverged Playwright e2e specs verbatim from langgraph-python
and adds 3 previously-missing specs (chat-customization-css,
prebuilt-sidebar, reasoning-custom). All 19 files are byte-identical
to LGP, mirroring the same approach the recent ADK parity push used
for the demo pages.

Why this matters even though D5 is the gold standard: the per-package
Playwright suites (`pnpm test:e2e`) are the local dev validation loop.
Without parity here, a contributor editing google-adk's CopilotChat
surface has no local check that matches what langgraph-python ships,
and tiny divergences between the two surfaces (missing testids, stale
selectors, wrong assertion shapes) silently accumulate until they
surface as D5 regressions in CI.
2026-05-14 20:54:21 +02:00
Tyler Slaton c461ad45a7 chore(showcase/google-adk): bump Gemini default to 3.1 Flash-Lite
Bumps the default Gemini model across the Google ADK showcase from
gemini-2.5-flash to gemini-3.1-flash-lite — the closest GA model in
the Gemini 3.x line (2.5 family is slated for June 2026 deprecation).

Touches agent factories (DEFAULT_MODEL, _DEFAULT_A2UI_MODEL, _SUB_MODEL),
the A2UI default-model test fixture, QA docs, the manifest description
for the reasoning demo, and prose references in shared_chat docstring +
entrypoint comment.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 11:43:49 -07:00
Jordan Ritter 2482317ccc style: apply ruff format to Python codebase
320 files reformatted. One-time alignment to match the ruff format
check added to CI in #4812.
2026-05-13 23:10:35 -07:00
Alem Tuzlak 9fa1e2e0fa test(showcase/google-adk): regression coverage for loop, A2UI v0.9, agent IDs
Pins the three classes of bug from the parent commit at the unit level so
the next refactor fails CI instead of crashing in the browser.

- test_stop_on_terminal_text.py (8 tests): truth table for the universal
  loop terminator — terminate on final text-only model response, never
  terminate on mixed text+function_call or partial streams, log-and-degrade
  when ADK's private _invocation_context is missing.

- test_a2ui_v09_shape.py (17 tests): pins build_a2ui_operations_from_tool_call
  to the v0.9 nested shape (createSurface / updateComponents /
  updateDataModel with version: "v0.9" and path+value, NOT flat type+data),
  the sanitize step that drops empty / missing-id / missing-component
  entries, the has_root_component validator, and the unstringify path that
  parses Gemini's stringified-JSON data fields back to real arrays.

- test_agent_id_alignment.py (4 tests): harvests every demo page.tsx for
  agent / agentId props and asserts each ID is exposed by at least one
  route.ts agents map (the main /api/copilotkit agentNames list or a
  dedicated route's agents: {...} block). Pins the dashed form for
  hitl-in-chat / frontend-tools-async / prebuilt-popup so the next rename
  drift breaks the test, not the chat. Cross-checks that the main route's
  agentNames is a subset of registry.AGENT_REGISTRY.

- test_after_model_modifier.py: removed two tests that asserted the old
  SalesPipelineAgent name-gate. The gate was lifted out when the loop
  terminator became universal; equivalent behavior coverage now lives in
  test_stop_on_terminal_text.py.

29 new tests + 23 retained from the existing suite, all passing.
2026-05-13 17:14:13 +02:00
github-actions[bot] 204f2fc7ec style: auto-fix formatting 2026-05-13 04:43:51 +00:00
Tyler Slaton 8966ef4f91 chore(showcase/google-adk/declarative-{hashbrown,json-render}): sed internal URL refs to declarative-*
QA3's sed pass missed making it into the consolidated commit. Landing
now so the e2e specs target the demo's current URL after the
byoc→declarative rename.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 21:41:06 -07:00
Tyler Slaton ef1ca9808c feat(showcase/google-adk): QA-blitz parity ports — agent prompts, tool surface, e2e specs
Result of 10 parallel QA agents auditing all 30 active demos against
langgraph-python (north-star). Each agent ported drift back to LP-verbatim
across three axes:

1. Agent layer
   - tool_rendering_common.py: rebuilt to LP's surface — get_weather,
     search_flights(origin, destination), get_stock_price, roll_d20,
     roll_dice. Removed the ADK-only query_data.
   - tool_rendering_*_agent.py (4 variants): ported LP's travel/concierge
     prompt; reasoning-chain variant got LP's chain-two-tools prompt.
   - beautiful_chat_agent.py: ported LP's per-tool system prompt; added
     manage_sales_todos / get_sales_todos / generate_a2ui; dropped the
     redundant schedule_meeting (frontend HITL handles it).
   - open_gen_ui_agents.py: ported LP's full SYSTEM_PROMPT for both
     variants, including the Websandbox.connection.remote.* contract
     for the advanced sandbox demo (was `window.sandbox.*`, which the
     LP frontend's Websandbox bridge silently no-ops).
   - byoc_agents.py: fused LP's hashbrown + json-render prompts so the
     single ADK byoc_agent emits both wire shapes. Aliases exported for
     a future per-route split.
   - declarative_gen_ui_agent.py: ported LP's a2ui_dynamic SYSTEM_PROMPT.
   - a2ui_fixed_agent.py: picked up LP's #4734 regression guard
     ("exactly ONCE", "do NOT call again").
   - agent_config_agent.py: rewrote to read useAgentContext (was
     state["config"]); reconciled schema to LP's 3-field camelCase
     {tone, expertise, responseLength} with LP's value enums.
   - subagents_agent.py: dropped the "running" placeholder; returns
     plain str so the LP-verbatim frontend's `result?.trim()` works.
   - hitl_in_app_agent.py / hitl_in_chat_book_call_agent.py: prompts +
     tool-result shape ({approved, reason}) aligned to LP.
   - AGUIToolset() added wherever it was missing on the bespoke agents
     (multimodal, mcp_apps, a2ui_fixed) so frontend-registered tools
     reach the model.

2. Dedicated runtime routes
   - copilotkit-multimodal/route.ts (new) — mirrors LP shape with
     ADK's HttpAgent + AGENT_URL pattern.
   - copilotkit-agent-config/route.ts (new) — same pattern.
   - copilotkit-mcp-apps/route.ts — refreshed.

3. Frontend ports (ADK frontend brought to LP-verbatim where it had
   drifted from the parity blitz state)
   - tool-rendering family (4 demos): full re-port — WeatherCard,
     FlightListCard, StockCard, D20Card, ReasoningBlock, CatchallRenderer,
     suggestions, and the page wiring with all useRenderTool /
     useDefaultRenderTool / reasoningMessage registrations.
   - a2ui-fixed-schema, mcp-apps, multimodal: full frontend re-ports
     with their _components/ Tailwind primitives.
   - frontend-tools, frontend-tools-async, agent-config: ported LP's
     component structure (separate Background, NotesCard with query_notes,
     config-context-relay).
   - shared-state-read, shared-state-read-write, readonly-state-agent-context:
     ported LP's demo-layout + _components + suggestions. recipe-card.tsx
     pulled directly from LP (one QA agent had adapted to Unicode glyphs
     thinking ADK lacked lucide-react — it doesn't, after the parity blitz).
   - shared-state-streaming, subagents, hitl-in-app: ported LP's
     DocumentView / supervisor-activity / TicketsPanel structure.
     hitl-in-app/page.tsx pulled directly from LP to keep the hyphenated
     agent slug aligned with the renamed registry key.
   - auth, hitl-in-chat: ported LP's SignInCard-first auth UX and the
     time-picker Tailwind port.
   - prebuilt-popup: pulled LP's main-content + suggestions split.

4. Test fixtures
   - 30 tests/e2e/<slug>.spec.ts ported from LP, several overwriting
     stale stubs (shared-state-streaming, subagents, auth, hitl-in-chat,
     shared-state-read, agent-config).
   - 30 qa/<slug>.md ported from LP with ADK env-var and registry
     references substituted (GOOGLE_API_KEY, AGENT_URL, registry.py).
   - QA3's byoc-hashbrown / byoc-json-render specs renamed to
     declarative-hashbrown / declarative-json-render with internal
     URL references substituted (the orchestrator pass had already
     renamed the demo dirs + manifest entries).

Frontend changes from QA agents were filtered: kept where they ported
LP-verbatim into ADK, replaced with direct LP pulls where the agent
had made ADK-specific adaptations (one Unicode-glyph case, one
stale-registry-slug case).

Not touched per blitz rules: shared_chat.py, registry.py, manifest.yaml,
src/app/api/copilotkit/route.ts.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 17:58:06 -07:00
Tyler Slaton ac36b01aed feat(showcase/google-adk/open-gen-ui+beautiful-chat): port agent prompts, tool surface, and e2e specs
- open_gen_ui_agents.py: port LP's minimal + advanced system prompts
  verbatim. Advanced prompt now tells Gemini to call
  `Websandbox.connection.remote.<fn>` (matching the LP frontend's
  websandbox bridge — the prior `window.sandbox.*` prompt produced UIs
  that silently no-op'd) and includes the full sandbox-iframe restriction
  set (no `<form>`, no `type="submit"`, addEventListener / keydown only),
  CDN script guidance, and the return-shape contract.
- beautiful_chat_agent.py: add `manage_sales_todos`, `get_sales_todos`,
  and `generate_a2ui` (mirrors `agents/main.py.generate_a2ui` — forced
  Gemini tool call, full `_A2uiError` shape) so the Task Manager and
  Sales Dashboard pills exercise their backend tools end-to-end. Drop
  `schedule_meeting` — the frontend handles meeting scheduling via the
  `scheduleTime` `useFrontendTool` HITL renderer.
- Copy LP's `tests/e2e/{open-gen-ui,open-gen-ui-advanced,beautiful-chat}.spec.ts`
  and `qa/{open-gen-ui,open-gen-ui-advanced,beautiful-chat}.md` fixtures
  into the ADK integration, retitled for Google ADK and adjusted for
  ADK env-var names (`GOOGLE_API_KEY`, `AGENT_URL`).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 17:33:54 -07:00
Alem Tuzlak 4882c61fb6 feat(showcase): align headless demos to north-star parity across all integrations 2026-05-05 15:12:43 +02:00
Alem Tuzlak 9845dadebb fix(aimock): re-key HITL confirmations on toolCallId so back-to-back flows work
Bug: in a single chat session, running both HITL booking flows
back-to-back (Alice 1:1 → then Sales call without refresh) used to
skip the time-picker on the second flow and jump straight to
"Booked ..." text.

Cause: confirmation fixtures were matched on `hasToolResult: true`,
which fires whenever the conversation has ANY tool message in
history. After the first flow finished, the second user message
short-circuited to a confirmation match before the second flow's
toolCall fixture (gated on `hasToolResult: false`) had a chance to
fire. The picker never rendered.

Fix: re-key the two confirmation fixtures on `toolCallId` (the
specific tool_call_id of the matching `book_call` invocation), which
only fires when the LAST conversation message is a tool result with
that id — exactly the moment we want the confirmation. Drop the
`hasToolResult: false` constraint on the toolCall fixtures so they
match a fresh user request regardless of prior tool history.

Add a back-to-back regression test to all 17 hitl-in-chat specs:
walk Alice flow to completion, then sales flow without refresh,
assert two `time-picker-card` elements rendered. If the multi-flow
regression returns, the second card never appears and the test
fails at `toHaveCount(2)`.
2026-05-01 12:42:53 +02:00
Alem Tuzlak 8cb84e88eb test(showcase): replicate hitl-in-chat regression spec across all 17 integrations
The hitl-in-chat demo ships in 17 integrations (langgraph-python plus
16 others — mastra, strands, ag2, agno, crewai-crews,
langgraph-typescript, langgraph-fastapi, pydantic-ai, llamaindex,
langroid, claude-sdk-python, claude-sdk-typescript, ms-agent-python,
ms-agent-dotnet, spring-ai, google-adk). All shipped placeholder e2e
specs that only checked the chat input was visible — none exercised
the actual booking flow.

Replace each with the full booking-flow spec written for
langgraph-python:
1. The "Schedule a 1:1 with Alice" suggestion renders the time-picker
   card AND the Tokyo greeting is absent (regression guard against
   the broad aimock `userMessage: "Alice"` matcher).
2. Picking a slot transitions to the picked-state card and produces
   a "Booked … Alice" assistant follow-up.
3. The "Book a call with sales" suggestion runs the same flow with
   the sales attendee.

Also add the matching aimock fixture pair for the sales suggestion
in feature-parity.json — without it, case 3 would only pass against
real OpenAI, not the aimock-backed CI deployments. The pair mirrors
the Alice fixture pair: `book_call` toolCall on first turn,
confirmation message after the picker resolves.

Per-integration coverage matters because each integration has its
own framework-specific HITL wiring (`useHumanInTheLoop` binding to
the agent, agent-side tool registration, run streaming protocol)
that can regress independently of the shared aimock fixture.
2026-05-01 12:25:36 +02:00
Jordan Ritter e9a2e143de fix(showcase): add shared-tools symlinks and refactor imports
Replace sys.path.insert hacks in Python agent files with direct
imports via symlinks to shared/{python,typescript}/tools.
Update Dockerfiles, entrypoints, and configs to support the new
symlink-based tool resolution. Add PARITY_NOTES for frameworks
that have known gaps.
2026-04-28 07:50:03 -07:00
Jordan Ritter dd06dd89d1 refactor(showcase): rename packages/ to integrations/
The showcase framework directories better reflect their role as
integration examples rather than distributable packages.
Renames showcase/packages/ -> showcase/integrations/ and updates
the test docker-compose file reference accordingly.
2026-04-28 07:47:35 -07:00