mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
dfecd64d79
The Proxy on useAgent()'s return caused double-dispatch through RunHandler when internal code (e.g. use-interrupt) passed the proxied agent back to copilotkit.runAgent(), silently dropping forwardedProps like resume commands. Replace with an AG-UI middleware installed by RunHandler via agent.use(). The middleware injects frontend tools, context, and forwarded properties into RunAgentInput only when they are not already present — acting as a fallback for direct agent.runAgent() calls that bypass RunHandler. When going through copilotkit.runAgent(), RunHandler's explicit injection takes precedence and the middleware is a no-op. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>