[pull] main from CopilotKit:main#391
Merged
Merged
Conversation
The Angular CopilotChatInput sends the message on Enter without checking for IME composition, so confirming a CJK candidate with Enter submits the half-composed text. The React (react-core v2) and Vue (vue v2) bindings of the same CopilotChatInput already guard this with isComposing/keyCode 229.
…turn scripted replies The 6 OpenAI drop-in integration examples enabled for the CLI's keyless AIMock mock mode shipped fixtures that did not cover the prompts each starter's own UI suggests, so a keyless first-run user clicking the demo suggestions mostly hit the generic catch-all. Re-key/extend each example's fixtures/default.json (substring, most-specific-first, catch-all last) so the surfaced suggestions return scripted replies. ENT-1003.
…ite re-call) The chart-chain fixtures looped under multi-step tool execution: langgraph-python emitted a 2nd tool call (pieChart/barChart/dashboard) with no terminating toolCallId result fixture, so it fell through to the still-matching userMessage fixture and re-called query_data. langgraph-js had its toolCallId result fixtures ordered after the userMessage fixtures (first array match wins -> re-call). Add the missing terminating result fixtures (langgraph-python) and reorder so all toolCallId fixtures precede userMessage fixtures (langgraph-js). Verified termination via the 2-3 step multi-turn repro; mastra fixtures already terminated.
The langgraph-js Toggle Theme chip returned a text response claiming it toggled the theme, but emitted no tool call -- so the theme never changed, while the same chip in langgraph-python emits the toggleTheme frontend tool call and works. Identical chip, different outcome by template. Swap the text response for the toggleTheme tool call, mirroring langgraph-python (frontend tool, no terminating result fixture needed -> no loop). Verified aimock now returns the toggleTheme tool call for the chip.
…nate HITL turn) Same class as the toggle-theme fix: langgraph-js's 'schedule a meeting' chip returned text, so the meeting picker never rendered, while langgraph-python emits the scheduleTime tool call. scheduleTime is a registered langgraph-js frontend tool (reasonForScheduling/meetingDuration) — swap text -> tool call, mirroring langgraph-python. Because scheduleTime is Human-in-the-Loop (the user's pick returns as a tool result and re-invokes the LLM), add a terminating call_schedule_time_001 result fixture in BOTH templates so the turn doesn't re-match the user message and loop (langgraph-python lacked it too — latent). Verified both terminate at 2 steps (tool call -> terminating text).
…turn scripted replies (#5728) ## Why The 6 OpenAI drop-in integration examples enabled for the CLI's **keyless AIMock mock mode** (`langgraph-python`, `langgraph-js`, `mastra`, `llamaindex`, `agno`, `pydantic-ai`) shipped `fixtures/default.json` files that **did not cover the prompts each starter's own UI suggests**. AIMock matches `userMessage` as a **case-sensitive substring, first-match-wins**, so a keyless first-run user who clicked the demo's suggestion chips mostly fell through to the generic catch-all ("I only have scripted replies…") instead of getting a scripted demo reply. Two root issues found (audit at `origin/main`): - **`langgraph-python` was mis-keyed** — fixtures keyed on suggestion *titles* (`"Pie Chart"`, `"Toggle Theme"`, `"Task Manager"`) while the UI sends long *message* strings that don't contain those substrings → all 9 suggestions missed. - The other 5 shipped only a generic `Hello` (+ a `weather` fixture in langgraph-js/mastra) → 0–1 of each starter's chips covered. This PR re-keys/extends each example's fixtures so the surfaced suggestions return scripted replies. Ordering preserved: most-specific-first, `{}` catch-all last (unchanged text). > Tracking: **ENT-1003** (CopilotKit/Intelligence). Sibling to ENT-989 (fixtures for *not-yet-enabled* frameworks). This PR covers the *already-enabled* 6. ## What changed (per template) | Template | Suggestions now covered | Tool-call replies | Text replies | |---|---|---|---| | langgraph-python | 9/9 (3 re-keyed) | pie/bar chart (`query_data`→component), `scheduleTime`, `toggleTheme`, `manage_todos` | Search Flights, Excalidraw, Calculator, Sales-Dashboard A2UI step | | langgraph-js | 9/9 | `query_data`, `search_flights`, `generate_a2ui`, `manage_todos` (schemas verified vs agent) | scheduleTime, Excalidraw, generateSandboxedUi, toggleTheme | | mastra | 6/6 | `get-weather`, `setThemeColor`, `go_to_moon` (HITL) | 3 proverb chips (proverbs are agent shared-state, not a tool) | | llamaindex | 3/3 | — | theme / proverb / weather | | agno | 4/4 | — | weather / theme / stock / proverb | | pydantic-ai | n/a (UI surfaces no chips) | — | best-effort free-typer fixtures: "what can you do" / "proverb" / "weather" | ## Honest caveats (best-effort; draft) - **Tool-call shapes only where evidenced.** Where a suggestion drives A2UI streaming, an MCP app (Excalidraw), or a frontend-only tool (`generateSandboxedUi`, `scheduleTime` in some templates) whose call shape isn't defined in the template, I used an **on-topic text reply** rather than fabricating a tool envelope. Those replies beat the catch-all but won't trigger the live generative UI under mock mode — a follow-up could record the real shapes. - **`pydantic-ai` surfaces no suggestion chips** in its UI, so there's nothing to key on; the real fix is a small UI change (add `suggestions` to `CopilotSidebar`), which is out of scope for a fixtures-only PR. The added fixtures are a fallback for free-typing users. - **Not verified end-to-end here** (authored against `origin/main`, not run live). Each template's `docker-compose.test.yml` AIMock smoke should stay green; note its `@chat` test only sends `"Hello"` and asserts a non-empty reply, so it does **not** validate suggestion-chip coverage — extending it to assert a non-catch-all reply for a real suggestion would close that blind spot (also noted in ENT-1003). ## Test plan - [ ] Per-template `docker-compose.test.yml` AIMock smoke still green. - [ ] Manual: scaffold/run each keyless, click each suggestion chip, confirm a scripted reply (not the catch-all).
### What The Angular `CopilotChatInput.handleKeyDown` submits the message when Enter is pressed without Shift, but it never checks whether an IME composition is in progress. When typing CJK text (Japanese, Chinese, Korean), the Enter that confirms an IME candidate also fires a `keydown`, so the half-composed text gets sent instead of the candidate being committed. The React and Vue bindings of the same v2 `CopilotChatInput` already guard against this; Angular was the one binding still missing it: - `packages/react-core/src/v2/components/chat/CopilotChatInput.tsx` — `handleKeyDown` returns early on `e.nativeEvent.isComposing || e.keyCode === 229` - `packages/vue/src/v2/components/chat/CopilotChatInput.vue` — `handleKeydown` returns early on `isComposing.value || event.isComposing || event.keyCode === 229`, and has a test asserting it does not submit while composing ### Change Add the same early return to the Angular `handleKeyDown`, using the native `KeyboardEvent` (`event.isComposing || event.keyCode === 229`), which matches the Vue binding's idiom. ### Notes When composition is not active `isComposing` is `false`, so Enter submits exactly as before and Shift+Enter still inserts a newline. The most visible case is Safari with a Japanese IME, where the confirming Enter reports `key === "Enter"` with `isComposing === true`; the `keyCode === 229` arm mirrors the sibling guards for browsers that report the composing key that way. I verified the handler logic in isolation (Enter while composing no longer submits; plain Enter and Shift+Enter are unchanged). I did not run the full Angular suite locally.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )