mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
0a9b99aae3
Ports the banking demo's #6401 fix, which was never carried over to this app. ApprovalButtons collapsed only on local `responded` state, which dies with the component. These cards do get remounted when the run syncs, which resurrected live Approve/Deny buttons on an action the user had already taken; clicking them again fires a duplicate write against an already-settled call. Adds a durable `resolved` prop, OR-ed with the local state so a click still collapses without waiting for the round trip. It is passed from the tool call itself at the three HITL renders that do not already early-return on status "complete". The other three (offerWorkflowRecording, awaitDashboardDemonstration, saveLearnedWorkflow) render their own terminal card when complete, so they never reach the buttons and need nothing — which is why banking also has exactly three call sites. Verified against the banking skin in the browser: before, approving a policy exception left a second card carrying live Approve/Deny; after, that card reads "Response submitted." `pnpm lint` and `pnpm build` both exit 0. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>