mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
6047acf12e
Replaces the agent.isRunning-driven phase entry (and its 200 ms polling fallback) with a 100 ms grace timer on unresolved matching tool calls. Replay flashes (tool call + result in the same tick during connectAgent history hydration) no longer cross the threshold, so the pill stops appearing on completed historical runs. Spinner exits as soon as either agent.isRunning falls or a "real follow-up" message arrives — assistant prose, a fresh user turn, or anything that isn't a tool result / empty-content tool-call wrapper. Multi-step tool chains stay on a single continuous pill (the latest-matching-assistant slot still moves between messages without a fade animation when the next bash assistant lands). Polling and the snapshot-subscriber comment were a misdiagnosis of a test artifact: useAgent's OnRunStatusChanged subscription is what the rest of CopilotKit (CopilotChat stop button, MCPAppsActivityRenderer, chat suggestions) relies on for isRunning falling-edge re-renders. Tests cover three new cases: replay-flash suppression, multi-step continuity across tool-result interleaving, and exit-on-prose-followup.