Skip to content

feat(examples/ag-ui): itinerary client tools + capability suggestion chips#655

Merged
blove merged 7 commits into
mainfrom
claude/ag-ui-demo-client-tools
Jun 11, 2026
Merged

feat(examples/ag-ui): itinerary client tools + capability suggestion chips#655
blove merged 7 commits into
mainfrom
claude/ag-ui-demo-client-tools

Conversation

@blove

@blove blove commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

The public AG-UI demo gains the client-tools story told the strongest way: a frontend-owned trip itinerary (signals + localStorage) that the user edits in a side panel and the agent edits through client tools — plus seven welcome chips covering the demo's full capability surface (it previously had none).

Spec: docs/superpowers/specs/2026-06-11-ag-ui-demo-itinerary-client-tools-design.md · Plan: docs/superpowers/plans/2026-06-11-ag-ui-demo-itinerary-client-tools.md

What's in

  • ItineraryStore — signals + localStorage (ag-ui-demo:itinerary), seeded 2-day Paris trip; 7 unit tests. Also adds the app's missing tsconfig.spec.json (the vitest target silently ran 0 tests without it).
  • Itinerary panel beside the chat (two-column, stacks <900px): day groups, add/remove stops, "Reset demo data".
  • Five client tools (client-tools.ts): get_itinerary / add_stop / move_stop (actions), clear_day (ask — Clear/Cancel confirm card; Cancel leaves state untouched), day_card (view). No system-prompt coaching — the catalog descriptions carry the behavior.
  • Seven chips via chat-welcome-suggestion: docs+citations, gen-UI, HITL refund, read/add/clear itinerary, research subagent.
  • Backend: State.tools channel + bind_client_tools(...) (published threadplane-client-tools==0.0.1); should_continue ends the turn on pure client-tool calls (server calls route to ToolNode as before).
  • e2e: 3 new specs (seed panel, read round-trip, ask-chain clears state) — full demo suite 13/13. Includes a harness fix: blank AG_UI_INTERNAL_TOKEN in the e2e backend spawn (a populated root .env token 401'd every backend-hitting spec).

Live-LLM smoke (real OpenAI, all new surface)

  • add_stop → panel visibly updated (model even added a sensible note) + continuation
  • get_itinerary → exact seeded state echoed back
  • move_stop → moved + model self-verified by chaining get_itinerary
  • clear_day Cancel → state untouched, model reacted conversationally
  • clear_day Confirm → day cleared, removed: 2 round-tripped into the reply — and the model chained the backend request_approval interrupt before the client ask unprompted (interrupt panel → Accept → confirm card → Clear), a great capability-composition moment
  • Zero console errors throughout

Known polish items (follow-ups, not blockers)

  • Resolved ask confirm cards in the transcript stay interactive and re-compute their live count ("Clear all 0 stops…"); should freeze/disable once resolved.
  • day_card (view) is model-discretionary and wasn't reached for during the smoke; schema/render covered by tests.

🤖 Generated with Claude Code

blove and others added 7 commits June 11, 2026 11:41
Frontend-owned trip-itinerary state (signals + localStorage) that the user
edits in a panel and the agent edits via client tools (get/add/move actions,
ask-gated clear_day, day_card view), plus seven welcome chips covering the
demo's full capability surface. Backend binds the client catalog via the
published threadplane-client-tools middleware.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signals + localStorage (ag-ui-demo:itinerary), seeded with a 2-day Paris trip.
Adds the app's missing tsconfig.spec.json (the vitest target silently ran 0
tests without it — analog plugin couldn't resolve the spec tsconfig).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…chips

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…t-tools)

- Add threadplane-client-tools>=0.0.1 dep; regenerate uv.lock + requirements.txt
- Add tools: Optional[list] channel to State so ag-ui-langgraph retains the client catalog
- Replace bare ChatOpenAI.bind_tools with bind_client_tools(llm, server_tools, state)
- Update should_continue: pure-client-tool turns route to attach_citations so the
  browser can execute the call and re-run; mixed calls keep the tools route

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds aimock fixtures and a Playwright spec covering the frontend-declared,
frontend-executed itinerary client tools over the AG-UI transport:

- panel renders the seeded itinerary
- read round-trip: get_itinerary executes in the browser, the ToolMessage
  re-runs the graph, and the recap continuation streams back
- ask chain: the clear_day confirm component mutates the shared store (panel
  updates live) and emits the tool result that resumes the run

Also blanks AG_UI_INTERNAL_TOKEN in the e2e backend spawn so the suite is
hermetic: the dev proxy forwards /agent without an x-internal-token header,
so a developer's root .env (which carries the Railway deploy token) leaking
into process.env via nx made the require_internal_token middleware 401 every
backend-hitting test.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
threadplane Ready Ready Preview, Comment Jun 11, 2026 10:31pm

Request Review

@blove blove merged commit 6f0a094 into main Jun 11, 2026
24 checks passed
blove added a commit that referenced this pull request Jun 12, 2026
Semantic merge — #655 landed on the pre-shell app, so its features relocate:
- ItineraryStore provider + router union in app.config.
- Itinerary panel hosted in the shell's new two-column body (toolbar-aware).
- clientTools built once in AgUiShell; all three modes bind <chat [clientTools]>.
- Welcome chips: #655's seven capability prompts presented via the canonical
  two-tier featured + 'More prompts' UI.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant