# QA: Frontend Tools (Async) — LangGraph (Python) ## Prerequisites - Demo is deployed and accessible at `/demos/frontend-tools-async` on the dashboard host - Agent backend is healthy (`/api/copilotkit` GET returns `langgraph_status: "reachable"`); `OPENAI_API_KEY` is set; `LANGGRAPH_DEPLOYMENT_URL` points at a deployment exposing the `frontend_tools_async` graph (registered under agent name `frontend-tools-async`) - Backend `frontend_tools_async.py` registers NO server-side tools; the frontend registers exactly ONE tool via `useFrontendTool`: **`query_notes`** (parameter: `keyword: string`) - The async handler sleeps 500ms (simulated client-side DB latency) then filters an in-memory `NOTES_DB` of 7 hard-coded notes, returning up to 5 matches against `title`, `excerpt`, or `tags` (case-insensitive). The tool has a custom `render` that mounts `NotesCard` ## Test Steps ### 1. Basic Functionality - [ ] Navigate to `/demos/frontend-tools-async`; verify the `CopilotChat` panel renders centered (max width 4xl, rounded-2xl corners) within 3s - [ ] Verify the input placeholder "Type a message" is visible - [ ] Send "Hello"; verify the agent responds with plain text within 10s and does NOT invoke `query_notes` ### 2. Feature-Specific Checks #### Suggestion Pills - [ ] Verify all three suggestion pills are visible with verbatim titles: - "Find project-planning notes" - "Search for 'auth'" - "What do I have about reading?" - [ ] Click "Find project-planning notes"; verify the prompt "Find my notes about project planning." is sent #### `query_notes` — Async Handler Loading State - [ ] After triggering the `query_notes` flow (via pill or typing "Find my notes about planning"), verify within 10s a `data-testid="notes-card"` element renders in the transcript - [ ] While the handler's 500ms sleep is in flight (tool status ≠ `complete`), verify the card's header shows: - [ ] An uppercase "Notes DB" label - [ ] A heading `data-testid="notes-keyword"` reading `Matching ""` where `` is the agent's chosen search term (e.g. `planning`, `project planning`) - [ ] The subtext "Querying local notes DB..." - [ ] A "..." placeholder glyph (not the 📓 book emoji) #### `query_notes` — Resolved State (Simulated DB Query) - [ ] After the 500ms sleep resolves, verify the card's loading state ends within 2s: - [ ] The placeholder glyph flips from "..." to "📓" - [ ] The subtext shows "`N` match" or "`N` matches" (singular when N=1) - [ ] A `data-testid="notes-list"` `