Skip to content

feat(samples): add decision_playground ADK agent and Lit client on a2ui-agent-experimental - #4496

Merged
gspencergoog merged 1 commit into
mainfrom
feat/modular-decision-playground
Dec 3, 2026
Merged

gspencergoog merged 1 commit into
mainfrom
feat/modular-decision-playground

Conversation

@gspencergoog

@gspencergoog gspencergoog commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Add the interactive decision_playground ADK sample agent (samples/agent/adk/decision_playground/) and standalone Lit client (samples/client/lit/decision_playground/, @a2ui/decision-playground) with a split-screen four-stage pipeline inspector built on a2ui-agent-experimental.

Reviewer Focus

  • samples/agent/adk/decision_playground/renderers.py and agent.py: Mode runners for cascade, binder, gated, prose, rpc, express, and direct. Includes per-session backend isolation, surface lifecycle tracking, and runtime cleanup of retired clients.
  • samples/agent/adk/decision_playground/adapters.py: Sample HTTP and Step-0 decision adapters (GeminiDecisionAdapter, JevDecisionAdapter, StepZeroLogprobAdapter), host-checked vendor API key attachment, URL/error sanitization, and probability validation.
  • samples/client/lit/decision_playground/app.ts and ui/inspector.ts: Standalone Lit client emitting v1.0 {version, action} envelopes, handling outbound RPC cancellation and batch validation errors, and rendering the four-stage <playground-inspector>.
  • uv.lock, yarn.lock, and samples/agent/adk/decision_playground/calibration_profiles.json can be skimmed.

Changes

  • Added samples/agent/adk/decision_playground/ with interactive modes for all five a2ui.experimental.decision tracks (cascade, binder, gated, prose, rpc) plus express and direct baselines. Includes slash commands (/mode, /backend, /compare, /tool, /gated, /prose, /form, /trace, /help), offline PlaygroundMockBackend, and HTTP/Step-0 adapters.
  • Registered samples/agent/adk/decision_playground as a uv workspace member and added samples/agent/adk/decision_playground/tests to [tool.pytest.ini_options].testpaths in root pyproject.toml.
  • Added the standalone @a2ui/decision-playground Lit client under samples/client/lit/decision_playground/ with its configuration, theme, A2A context persistence, and four-stage <playground-inspector> component, leaving samples/client/lit/shell/ untouched.
  • Added Python unit tests in samples/agent/adk/decision_playground/tests/test_decision_playground.py and Vitest suites in samples/client/lit/decision_playground/tests/inspector.spec.ts and smoke-test.spec.ts.

Impact & Risks

Testing

  1. Run the playground Python tests:
    uv run pytest samples/agent/adk/decision_playground/tests -q
  2. Build, test, and lint the Lit client:
    yarn workspace @a2ui/markdown-it build && yarn workspace @a2ui/decision-playground test && yarn workspace @a2ui/decision-playground lint
  3. Check formatting and license headers:
    uv run pyink --check samples/agent/adk/decision_playground/ && yarn workspace @a2ui/decision-playground format:check && python3 scripts/fix_licenses.py --check

gemini-code-assist[bot]

This comment was marked as resolved.

@gspencergoog
gspencergoog force-pushed the feat/modular-decision-playground branch from 59d0885 to b73cc30 Compare December 1, 2026 22:22
@gspencergoog
gspencergoog marked this pull request as ready for review December 1, 2026 22:30
@gspencergoog
gspencergoog force-pushed the feat/modular-decision-playground branch from 405d4f9 to 53125ec Compare December 1, 2026 22:45
@gspencergoog
gspencergoog added this pull request to stack #4501 December 1, 2026 22:46
@gspencergoog
gspencergoog removed this pull request from stack #4501 December 2, 2026 02:44
@gspencergoog
gspencergoog added this pull request to stack #4521 December 2, 2026 02:44
gspencergoog added a commit that referenced this pull request Dec 2, 2026
… and restore synthesizer kernel extensions

Signed-off-by: Greg Spencer <gspencer@google.com>

@nan-yu nan-yu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Greg! The playground is a great way to see all five tracks side by side, and the offline mock backend makes it easy to try. The latest push already sanitizes the endpoint URL in traces, redacts RPC arguments, keeps /backend per session, and handles malformed RPCs. Nice.

What's left, inline:

  • Protocol: Express renders always target main, so /compare emits two createSurface main in one payload, and later turns re-create surfaces that already exist.
  • Secrets: vendor API keys are still forwarded to any configured decision URL, skipping the adapters' host check.
  • Robustness: client-side validation failures are unhandled, the Step-0 floor flattens confident answers, and empty probabilities report success.
  • CI: the sample's tests aren't in the root pytest testpaths, so CI never runs them.
  • The client still sends the v0.8-style userAction envelope.

🤖 Agent-generated

Comment thread pyproject.toml Resolved
@gspencergoog gspencergoog changed the title feat(samples): add decision_playground and Lit shell inspector on a2ui-agent-experimental feat(samples): add decision_playground ADK agent and Lit client on a2ui-agent-experimental Dec 2, 2026
@gspencergoog
gspencergoog force-pushed the feat/modular-decision-playground branch 2 times, most recently from 11c56bb to 619f3a4 Compare December 2, 2026 22:21

@nan-yu nan-yu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Greg! I re-checked the earlier comments against 619f3a4: /compare now uses distinct surfaces and validates, re-created surfaces get a deleteSurface first, vendor keys stay with their hosts, Step-0 and empty-probability handling are fixed, the sample tests run in CI (29 pass locally), and the client sends the v1.0 action envelope. LGTM.

🤖 Agent-generated

@gspencergoog
gspencergoog force-pushed the feat/modular-decision-playground branch from 619f3a4 to 7729a9d Compare December 2, 2026 23:01
@gspencergoog
gspencergoog force-pushed the feat/modular-decision-playground branch from 7729a9d to bb04d77 Compare December 3, 2026 00:00
Base automatically changed from feat/modular-decision-tracks to main December 3, 2026 00:09
…pector

Signed-off-by: Greg Spencer <gspencer@google.com>
@gspencergoog
gspencergoog force-pushed the feat/modular-decision-playground branch from bb04d77 to 5a40c2e Compare December 3, 2026 00:09
@gspencergoog
gspencergoog enabled stacked auto-merge (squash) December 3, 2026 00:12
@gspencergoog
gspencergoog merged commit 5b0a224 into main Dec 3, 2026
57 checks passed
@gspencergoog
gspencergoog deleted the feat/modular-decision-playground branch December 3, 2026 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants