Repository navigation
fix: parallel v1 tool rendering, Vue provider HITL, wildcard HITL names and abort - #6527
BenTaylorDev wants to merge 5 commits into
Conversation
@copilotkit/a2ui-renderer
@copilotkit/agentcore-runner
@copilotkit/angular
@copilotkit/channels
@copilotkit/channels-core
@copilotkit/channels-discord
@copilotkit/channels-intelligence
@copilotkit/channels-slack
@copilotkit/channels-teams
@copilotkit/channels-telegram
@copilotkit/channels-ui
@copilotkit/channels-whatsapp
@copilotkit/core
@copilotkit/react-core
@copilotkit/react-native
@copilotkit/react-textarea
@copilotkit/react-ui
@copilotkit/runtime
@copilotkit/runtime-client-gql
@copilotkit/sdk-js
@copilotkit/shared
@copilotkit/sqlite-runner
@copilotkit/voice
@copilotkit/vue
@copilotkit/web-components
@copilotkit/web-inspector
commit: |
|
Size Change: +380 B (+0.03%) Total Size: 1.32 MB 📦 View Changed
ℹ️ View Unchanged
|
useLazyToolRenderer read message.toolCalls[0] and returned a single render, so an assistant message carrying a parallel batch of tool calls displayed only the first. Tool calls 2..N were dropped with no inProgress state and no result, which is indistinguishable from a result that never arrived. Map over every tool call instead, returning null only when none of them produce output so the caller still falls through to its custom-message renderer. v2's CopilotChatToolCallsView already did this correctly. Fixes OSS-802
useHumanInTheLoop overwrote the render props' name with the registration name in all three status branches. For a named tool the two are equal, so the override was a no-op; for a wildcard registration (name: "*") it clobbered the real name, leaving the renderer unable to tell the user which tool it was asking them to approve. Only override when the registration is not a wildcard. Matches the contract already asserted in defineToolCallRenderer.test.tsx and the behavior of the other wildcard wrappers (useRenderTool, useDefaultRenderTool, WildcardToolCallRender). Fixes OSS-804
The Vue CopilotKitProvider's humanInTheLoop prop registered a handler that warned and resolved undefined immediately, so the HITL UI flashed and disappeared instead of waiting for a response, and the renderer was registered unwrapped so it never received a working respond. Match the useHumanInTheLoop semantics: keep the tool call pending until respond is called, expose respond only while the status is Executing, and reject with 'Human-in-the-loop interaction aborted' when the run is aborted so core records an explicit error tool result (#5554). Pending interactions are keyed by tool call id, so parallel interrupts on one tool stay independent, and a wildcard registration keeps the invoked tool's name. Fixes OSS-803
The unit tests drive the provider's registered renderer directly, which cannot catch a mismatch between the key the handler stores a pending interaction under and the tool call id the real render pipeline supplies. Mount CopilotChat -> CopilotChatToolCallsView -> the provider wrapper instead, for both a named and a wildcard registration. Refs OSS-803
The named-tool path calls handlers with signal: _runAbortController?.signal,
but executeWildcardTool passed only { toolCall, agent }. A wildcard handler
that waits on something therefore could never observe an abort — a
human-in-the-loop tool registered as '*' stayed pending forever when the run
was stopped, in both React's useHumanInTheLoop and the Vue provider path.
Additive: handlers that ignore the signal are unaffected.
6b4aeae to
6a508d6
Compare
The `humanInTheLoop` prop on `CopilotKitProvider` registered a handler that warned and resolved `undefined` the moment the agent invoked it, and it registered the renderer unwrapped, so the render never received a working `respond`. A tool declared that way jumped straight to Complete over dead controls while the agent was told the tool had succeeded. The placeholder is unchanged since the first v2 provider commit (a2ef51a), so this documented prop has never waited on the user. It fails the same way on both transports. Match the `useHumanInTheLoop` semantics: park the tool call until the render calls `respond`, expose `respond` only while the status is Executing, and reject with 'Human-in-the-loop interaction aborted' when the run is aborted so core records an explicit error tool result (#5554). Pending interactions are keyed by tool call id, and a wildcard registration keeps the invoked tool's name rather than "*". Two existing unit tests asserted the placeholder behavior (the console warning and render identity). They now assert the waiting contract and that the wrapper renders the caller's component. Mirrors the Vue fix in #6527. Related: #4953 (the provider-prop half of that report) and #4955. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The `humanInTheLoop` prop on `CopilotKitProvider` registered a handler that warned and resolved `undefined` the moment the agent invoked it, and it registered the renderer unwrapped, so the render never received a working `respond`. A tool declared that way jumped straight to Complete over dead controls while the agent was told the tool had succeeded. The placeholder is unchanged since the first v2 provider commit (a2ef51a), so this documented prop has never waited on the user. It fails the same way on both transports. Match the `useHumanInTheLoop` semantics: park the tool call until the render calls `respond`, expose `respond` only while the status is Executing, and reject with 'Human-in-the-loop interaction aborted' when the run is aborted so core records an explicit error tool result (#5554). Pending interactions are keyed by tool call id, and a wildcard registration keeps the invoked tool's name rather than "*". Two existing unit tests asserted the placeholder behavior (the console warning and render identity). They now assert the waiting contract and that the wrapper renders the caller's component. Mirrors the Vue fix in #6527. Related: #4953 (the provider-prop half of that report) and #4955. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…6851) ## Summary A human-in-the-loop tool declared through the `humanInTheLoop` **prop** on `<CopilotKitProvider>` never waited for the user. The handler resolved `undefined` the moment the agent invoked it, and the renderer was registered unwrapped, so it never received a working `respond`. The card appeared once at `Complete` over dead controls while the agent was told the tool had succeeded. This is not a regression. The placeholder handler is unchanged since the first v2 provider commit (`a2ef51aaf3`, #2794), so this documented prop has never waited. The reference page describes it as self-sufficient: "Declarative human-in-the-loop tool definitions. Each becomes both a tool handler and a tool call renderer." The `useHumanInTheLoop` hook path is unaffected and has always worked. ## Changes `packages/react-core/src/v2/providers/CopilotKitProvider.tsx`, matching `useHumanInTheLoop`: - park the tool call until the render calls `respond`, keyed by tool call id so one call of a tool cannot resolve another - wrap the registered renderer so it receives the full prop contract, with `respond` live only while the status is `Executing` - reject with `Human-in-the-loop interaction aborted` on abort, so core records an explicit error tool result rather than an empty success (#5554) - keep the invoked tool's name for a wildcard (`"*"`) registration instead of overwriting it with `"*"` Two existing unit tests asserted the placeholder behavior (the `console.warn`, and render identity). They now assert the waiting contract and that the wrapper renders the caller's component. ## Testing **New: `CopilotKitProvider.hitl.e2e.test.tsx` (4 tests).** These mount the real pipeline — `CopilotChat` -> tool calls view -> the provider's registered renderer — rather than calling the renderer directly, so a mismatch between the key the handler parks under and the tool call id the pipeline supplies cannot pass. All four fail on `main` for the right reason (`Unable to find an element by: [data-testid="hitl-respond"]` — the respond button never appears), and pass with the change. Each mechanism was mutation-checked separately: | Mutation | Result | | -- | -- | | handler resolves immediately (the old placeholder) | all 4 fail | | renderer registered unwrapped | all 4 fail | | wildcard branch removed | only the wildcard test fails | | park under the tool name instead of the tool call id | the 2 tests needing a live `respond` fail | **Suite, types, format** ``` $ node ../../node_modules/vitest/vitest.mjs run src/v2/providers/__tests__/ Test Files 17 passed (17) Tests 173 passed (173) $ tsc --noEmit (clean) ``` `oxfmt` applied to every changed file. The full `react-core` run also has 7 failures across `CopilotChatView.pinToSend.test.tsx` and `use-pin-to-send.test.tsx` (`ResizeObserver is not a constructor`). Those are pre-existing: I removed this change from the working tree and ran those two files on clean `main`, and they fail identically. **Live, in `examples/v2/react/demo` against a real agent and a rebuilt dist** | Page | Before | After | | -- | -- | -- | | provider prop, multi-route REST | card at `complete`, `respond` undefined, console warned, agent said "Please pick a time slot in the scheduler UI to confirm" over disabled buttons | parks at `executing` with live buttons for 17s, then "Booked a call with Sam about the Waterfall project meeting for Tue 14:00" | | provider prop, single route | same, and worse: "…has been scheduled" before anyone approved | parks, then reports the slot actually chosen (Wed 09:30) | | `useHumanInTheLoop` hook, multi-route REST | already correct | unchanged: `inProgress` -> `executing` -> `complete` with the chosen slot reaching the agent | ## Credit @Tushar-Khandelwal-2004 diagnosed this path and implemented the parking handler and the abort semantics first, in #4955. That PR predates the wildcard-name work and the current `main`, and its review asks were still open, so this lands the same fix rebased on `main` with the wildcard branch and pipeline-level tests added. #4955 is now closed in favor of this PR, with the credit staying with them. ## Related - #4955 — the earlier implementation of this fix (closed in favor of this PR) - #6527 — the identical Vue defect; the two changes agree on semantics - #4953 — the reporter hit the hook path, which does not reproduce on `main`; this is the confirmed provider-prop half of that report Angular already implements this path (`addHumanInTheLoop` -> `#hitl.onResult`), so React was the last framework missing it. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Human-in-the-loop tool calls now pause until a user responds. * Interactive renderers receive tool metadata and a callback for submitting responses. * Wildcard tools display the specific tool name that was invoked. * Aborted tool calls now return a clear error result. * **Bug Fixes** * Multiple pending tool calls can be resolved independently by their call ID. * Interactive handlers no longer emit an unnecessary warning while awaiting a response. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
…ldcard handlers (#7315) Two frontend human-in-the-loop defects that are still live on `main`. One commit each, so either can be reviewed or reverted alone. This replaces the two still-live halves of #6527, which I am closing. Its other two halves have since landed through other PRs — the parallel v1 tool rendering fix through #6682 (and its file has since moved under `v1-deprecated/`), and the wildcard HITL name fix through `b17c8556be` — so that branch is now two dead commits, one conflicting file path, and these two fixes. Rebasing it was not worth it. ### OSS-803 — Vue `humanInTheLoop` provider prop resolved immediately The Vue provider's `humanInTheLoop` **prop** path registered a handler that warned and resolved `undefined` right away, so the HITL UI flashed and disappeared instead of waiting for the user, and it registered `tool.render` unwrapped so the renderer never received a working `respond`. React's provider fixed exactly this separately (`packages/react-core/src/v2/providers/CopilotKitProvider.tsx`, `pendingHumanInTheLoopRef`). This brings Vue to parity with it and with Vue's own `useHumanInTheLoop` composable: - the tool-call promise stays pending until `respond` is called - `respond` is live only while status is `Executing` - an aborted run **rejects** with `Human-in-the-loop interaction aborted`, so core records an explicit error tool result rather than silently resolving empty (#5554) - pending interactions are keyed by tool call id, so parallel interrupts on the same tool stay independent - a wildcard (`name: "*"`) registration keeps the invoked tool's name - the wrapper passes `agentId`, which `VueHumanInTheLoopRenderProps` declares and the composable already supplies (this one is mine, not in #6527) The abort bullet depends on a `signal` that core does not always supply — hence the second commit. ### `packages/core` — wildcard tool handlers never received the abort signal The named-tool path calls handlers with `signal: this._runAbortController?.signal` (`run-handler.ts:918`), but `executeWildcardTool` passed only `{ toolCall, agent }` (`run-handler.ts:1101`). A wildcard handler that waits on something therefore could never observe an abort, so a HITL tool registered as `"*"` stayed pending forever when the run was stopped — in React's `useHumanInTheLoop` as much as in the Vue provider path above. The fix adds that one argument. It is additive: handlers that ignore the signal are unaffected, and `signal` was previously `undefined` for this path. `FrontendToolHandlerContext.signal` is already optional and already documented (`packages/core/src/types.ts:39`). ## Testing Every fix has a test that fails without it. Each negative control was run by reverting **only** the source file on this branch and re-running the same tests. **OSS-803** — 7 unit tests in `CopilotKitProvider.test.ts` (pending-until-respond, `respond` only while executing, abort rejects, already-aborted rejects, parallel interrupts independent, wildcard name, `agentId` forwarded), plus 2 **mounted** end-to-end tests in `CopilotKitProvider.hitl.e2e.test.ts`. Two existing tests asserted the old placeholder behavior (`resolves undefined` + the warning) or compared `render` by identity, and were updated: the renderer is now a wrapper, so they assert it *delegates* to the user's component. The unit tests drive the registered renderer directly with a synthesized handler context, which cannot catch a mismatch between the key the handler stores under and the tool call id the real pipeline supplies. The e2e file closes that: it mounts `CopilotChat → CopilotChatToolCallsView →` the provider's wrapper, so the wrapper runs as a real Vue functional component and the key comes from core's own tool call id. With the fix: ``` ✓ src/v2/providers/__tests__/CopilotKitProvider.wildcard.test.ts (5 tests) ✓ src/v2/providers/__tests__/CopilotKitProvider.test.ts (33 tests) ✓ src/v2/providers/__tests__/CopilotKitProvider.hitl.e2e.test.ts (2 tests) Test Files 3 passed (3) Tests 40 passed (40) ``` With `CopilotKitProvider.vue` alone reverted to `origin/main`, 11 fail — including both e2e tests, which never reach `Executing` so no approve button is ever rendered: ``` × supports wildcard in humanInTheLoop × processes humanInTheLoop tools and creates handlers × keeps the tool call pending until respond is called × exposes respond only while the tool is executing × rejects the pending tool call when the run is aborted × rejects immediately when the run was already aborted × keeps parallel interrupts on the same tool independent × passes the actual invoked tool name to a wildcard HITL renderer × combines render components from all sources × waits for the user and completes with the response × passes the invoked tool name to a wildcard registration Test Files 3 failed (3) Tests 11 failed | 29 passed (40) ``` The `agentId` line mutation-checks on its own: deleting only `agentId: tool.agentId` from the wrapper fails exactly one test, `passes agentId through to the HITL renderer`, and nothing else. **core wildcard signal** — 2 new tests in `core-abort-during-tool.test.ts`, mirroring the named-tool pair already there: one asserts a wildcard handler receives an `AbortSignal`, the other that `stopAgent()` during wildcard execution aborts it. With the fix, `6 passed (6)`. Reverting only the changed line in `run-handler.ts` fails both while the four existing tests stay green: ``` ✓ should NOT restart the run when stopAgent is called during tool execution ✓ should pass an AbortSignal to the tool handler context ✓ should abort the signal when stopAgent is called during tool execution × should pass an AbortSignal to a wildcard tool handler context → expected undefined to be an instance of AbortSignal × should abort the signal when stopAgent is called during wildcard tool execution → expected undefined to be true ✓ should NOT restart the run when agent.abortRun() is called directly during tool execution Test Files 1 failed (1) Tests 2 failed | 4 passed (6) ``` ### Repo-wide checks | Check | Result | | --- | --- | | `@copilotkit/vue` full suite | `106 passed (106)` files, `1135 passed (1135)` tests | | `@copilotkit/vue` `vue-tsc --noEmit` | clean | | `@copilotkit/core` full suite (uncached) | `76 passed (76)` files, `894 passed (894)` tests | | `@copilotkit/core` `tsc --noEmit` | clean | | `oxfmt --check` on all 6 changed files | `All matched files use the correct format.` | | `eslint` on changed Vue files | 2 errors, byte-identical to `origin/main` on the same file (both unused-import false positives, same two symbols) — no new lint errors | The stale-`@copilotkit/shared` build artifact that forced a `--no-verify` commit and 20 `core-inspector-metadata` timeouts on #6527 is not present here: this worktree was set up with a full `pnpm install`, so the core suite is genuinely green. ## Not in this PR - The Vue `useHumanInTheLoop` **composable** has the same wildcard `name` clobber that React's hook fixed, and no abort handling at all. Separate from the prop path this PR fixes. - OSS-805 (passive client disconnect does not abort an in-flight run). Abort-on-disconnect is not unconditionally correct — disconnect-tolerant runs are deliberate for reconnect-to-in-flight-thread and durable/background runs — so the per-runner semantics need deciding before `request.signal` gets wired up. Fixes OSS-803 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Human-in-the-loop tools remain pending until users respond through the rendered interface. - Wildcard tool handlers and renderers receive the actual invoked tool name. - Multiple simultaneous tool interactions are tracked independently. - **Bug Fixes** - Stopping an agent now properly aborts pending human-in-the-loop interactions. - Pending interactions no longer remain unresolved when an abort occurs. - Response controls are available only while a tool is actively executing. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
|
Superseded by #7315, now merged as All four of this branch's fixes are on #7315 carried the remaining two — the Vue Closing as superseded rather than rebasing: two of the five commits would have to be dropped, and the largest targets a path that no longer exists. |
Three independent tool-rendering / human-in-the-loop bugs, plus a
packages/coregap the third one exposed. One commit each, so any of them can be reviewed or reverted alone.OSS-802 — v1 tool rendering dropped all but the first parallel tool call
useLazyToolRendererreadmessage.toolCalls[0]and returned a single render, so an assistant message carrying a parallel batch displayed only the first tool call. Tool calls 2..N were dropped with noinProgressstate and no result — from the user's seat that is indistinguishable from a result that never arrived, which is how this surfaced while verifying #1982 / #2051 (that reporter's backend doesasyncio.gatherover everytool_call).Now maps over every tool call. It still returns
nullwhen none of them produce output, so a message with no registered renderer keeps falling through to the custom-message renderer as before. v2'sCopilotChatToolCallsViewalready did this correctly.OSS-803 — Vue
humanInTheLoopprovider prop resolved immediatelyThe Vue provider's
humanInTheLoopprop path registered a handler that warned and resolvedundefinedright away, so the HITL UI flashed and disappeared instead of waiting for the user, and it registeredtool.renderunwrapped so the renderer never got a workingrespond.Now matches the
useHumanInTheLoopcomposable:respondis calledrespondis live only while status isExecutingHuman-in-the-loop interaction aborted, so core records an explicit error tool result rather than silently resolving empty (Bug: renderAndWaitForResponse silently completes on user abandonment — no timeout, no error propagation to agent #5554)name: "*") registration keeps the invoked tool's nameThe abort bullet depended on a
signalthat core did not always supply — see the fourth commit below.packages/core— wildcard tool handlers never received the abort signalFound while verifying the abort claim above. The named-tool path calls handlers with
signal: this._runAbortController?.signal(run-handler.ts:821), butexecuteWildcardToolpassed only{ toolCall, agent }(run-handler.ts:1007). A wildcard handler that waits on something therefore could never observe an abort, so a HITL tool registered as"*"stayed pending forever when the run was stopped — in React'suseHumanInTheLoopas much as in the Vue provider path this PR fixes. OSS-804 makes wildcard HITL actually usable, which is what made this reachable.The fix adds that one argument. It is additive: handlers that ignore the signal are unaffected, and
signalwas previouslyundefinedfor this path.React's provider-prop path has the same placeholder; that half is being fixed in #4955 (react-core only, no file overlap with this PR).
OSS-804 — wildcard
useHumanInTheLooprenderer received"*"useHumanInTheLoopoverwrote the render props'namewith the registration name in all three status branches. For a named tool the two are equal so the override was a no-op; forname: "*"it clobbered the real name, leaving a wildcard HITL unable to tell the user which tool it was asking them to approve.Now only overrides when the registration isn't a wildcard. This matches the contract already asserted in
defineToolCallRenderer.test.tsx("wildcard receives actual tool name, not*") and the behavior of the other wildcard wrappers (useRenderTool,useDefaultRenderTool,WildcardToolCallRender).Testing
Every fix has a test that fails without it. Each negative control was run by reverting only the source file on this branch and re-running the same test.
OSS-802 —
packages/react-core/src/hooks/__tests__/repro-1982-2051-v1-path.test.tsx(new, plus the passing v2 counterpartsrc/v2/hooks/__tests__/repro-1982-2051.test.tsx).Before, on a clean
origin/mainworktree:After:
(The other four files are every existing consumer of
useLazyToolRendererplus the v1 action path — the fallthrough-to-custom-renderer behavior is what they cover.)OSS-803 — 6 new unit tests in
packages/vue/src/v2/providers/__tests__/CopilotKitProvider.test.ts(pending-until-respond,respondonly while executing, abort rejects, already-aborted rejects, parallel interrupts independent, wildcard name), plus 2 mounted end-to-end tests inCopilotKitProvider.hitl.e2e.test.ts. Two existing tests asserted the old placeholder behavior (resolves undefined+ the warning) or comparedrenderby identity, and were updated: the renderer is now a wrapper, so they assert it delegates to the user's component.The unit tests drive the registered renderer directly with a synthesized handler context, which cannot catch a mismatch between the key the handler stores under and the tool call id the real pipeline supplies. The e2e file closes that: it mounts
CopilotChat → CopilotChatToolCallsView →the provider's wrapper, so the wrapper runs as a real Vue functional component and the key comes from core's own tool call id. Reverted, both fail with the exact reported symptom — the card never reachesExecuting, so no approve button is ever rendered:With the provider reverted, 7 unit tests fail:
Full Vue suite with the fix:
OSS-804 — 2 new tests in
packages/react-core/src/v2/hooks/__tests__/use-human-in-the-loop.e2e.test.tsx: a wildcard HITL driven throughInProgress → Executing → CompleteviaMockStepwiseAgent, assertingname === "deleteFile"at every status and that"*"never reached the renderer; plus a named-registration test guarding the no-op half.With the hook reverted:
With the fix:
use-human-in-the-loop.e2e.test.tsx (16 tests)— all pass.core wildcard signal — 2 new tests in
packages/core/src/__tests__/core-abort-during-tool.test.ts, mirroring the named-tool pair already there: one asserts a wildcard handler receives anAbortSignal, the other thatstopAgent()during wildcard execution aborts it. Reverting only the changed line inrun-handler.tsfails both while the four existing tests stay green:Scope note on this one: in a worktree,
@copilotkit/coreresolves to the built package, so the react-core and Vue suites here exercise the published core rather than this source change. The core fix is verified at the source level by the tests above; the composed behavior (wildcard HITL rejecting on abort through the Vue provider) follows from two separately-verified halves — core now supplies the signal, and the Vue path's abort test proves it rejects when given one — but I did not execute that combination end to end. CI builds from source and will.Repo-wide checks
react-corefull suiteuse-interrupt.test.tsx > does not persist a tool-result message for backend-owned interrupts. Not from this branch: it fails identically in a separate pristineorigin/mainworktree. Same local-build caveat as thecorerow below; CI is green.react-coretsc --noEmitvuefull suitevuevue-tsc --noEmitvueeslinton changed filesorigin/mainon the same file (2 unused-import false positives, 1 pre-existinganyat what is now line 543) — no new lint errorscorefull suitecore-inspector-metadata.test.tsTimeout waiting for condition, caused by the stale@copilotkit/sharedbuild described above rather than by anything on this branch.coretsc --noEmit@copilotkit/sharedsymbol resolution described above; none in changed codeCI: the one red check is repo-wide, not from this branch
langgraph-python(dojo e2e) fails on threeagenticChatPage.spec.tsjourneys. Event counts match exactly (33/33 and 129/129); the only difference isevent 2: STATE_SNAPSHOT — expected: <missing>, actual: "local_dev".local_devappears nowhere in the repo, so it is a value the LangGraph dev server supplies at run time against a recorded trace that does not have it.It is not this branch: #6530, a CSS-only change to
header.css, fails the same job identically, and merging currentorigin/mainin did not change the outcome. Nothing in this PR touches state snapshots, the runtime, or the Python SDK.Not in this PR
OSS-805 (passive client disconnect does not abort an in-flight run) is deliberately left out. Abort-on-disconnect is not unconditionally correct — disconnect-tolerant runs are a deliberate feature for reconnect-to-in-flight-thread and durable/background runs — so the per-runner semantics need deciding before
request.signalgets wired up. It also touches runtime behavior rather than frontend rendering, and belongs in a PR that can be reviewed on that basis.Two adjacent gaps found while doing this, not filed as part of it:
useHumanInTheLoopcomposable has the same wildcardnameclobber this PR fixes for React (OSS-804), and no abort handling at allFixes OSS-802
Fixes OSS-803
Fixes OSS-804