Files
copilotkit__copilotkit/examples/showcases/banking/next.config.mjs
GeneralJerel 1dc6eee3fc feat(saas-demo): teach-mode "wow" UX + CK v2 provider fix + gpt-5.4-mini
Teach-mode UX (staged on the no-op recorder shim, ready for the live hook):
- Suggested-prompt pill leads the welcome screen — "Approve the $5,000
  Marketing transaction" — a one-click path straight into the
  over-policy-limit gate (seed t-1: Google Ads -$5,000, Marketing limit
  $5,000 / spent $500). The same pill drives both halves of the arc:
  fails pre-learning, succeeds post-learning.
- Pulsating violet recording vignette frames the canvas while the officer
  is teaching. Ref-counted around every `recordUserAction` call so it
  stays continuous across opened+finalized; minimum 1.2s visible duration;
  non-blocking; static fallback under prefers-reduced-motion. Mounted at
  z-1300 to read clearly even over the docked chat panel.
- Inline policy-exception card replaces the popup modal: the officer's
  whole demonstration (see symptom → file exception → record) now
  happens in the chat as a single HITL card, with identical REST
  callers and identical `policy_exception.opened`→`finalized` recording
  payloads to the old modal.

CK v2 provider fix:
- Swap the v1 `CopilotKit` compatibility bridge for the v2-native
  `CopilotKitProvider`. The bridge wraps the chat in a heavier stack
  (ThreadsProvider + a second CopilotChatConfigurationProvider + listeners);
  that churn re-fires CopilotChat's /connect effect cleanup mid-run, and
  the cleanup calls AG-UI `detachActiveRun()` — which silently tears down
  the in-flight run the instant the agent emits a frontend HITL tool call.
  Symptom was a clean run with no error but no HITL render. With
  CopilotKitProvider the `/connect` storm and ERR_ABORTED are gone and
  runs complete cleanly. The inbox keeps working because v2 `useThreads`
  reads CopilotKitProvider's own context.
- `reactStrictMode: false` in next.config to remove the dev double-mount
  that aggravates the same teardown class. Production unaffected.

Other:
- Switch model to `openai/gpt-5.4-mini-2026-03-17` (verified reachable;
  same tool-calling surface).
- Add `selectCard` HITL tool + visual `CardPicker` (in-chat brand+last4
  picker) so card-targeted flows (PIN, policy assign) get a visual
  picker instead of a text list.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 08:28:38 -07:00

16 lines
831 B
JavaScript

/** @type {import('next').NextConfig} */
const nextConfig = {
// React StrictMode intentionally double-invokes mount effects in DEV ONLY.
// For CopilotKit's AG-UI human-in-the-loop flow that double-mount tears the
// in-flight run down the instant the agent emits a HITL tool call — before
// the approval card can render and return its result — which orphans the tool
// call ("Tool result is missing for tool call …") and then poisons the thread
// so every later message fails. Production builds never double-invoke, so the
// bug is purely a `next dev` artifact; disabling StrictMode makes the live
// HITL chat (and the teach-mode demonstration arc) work when the demo is run
// via `next dev`. No effect on production behavior or correctness.
reactStrictMode: false,
};
export default nextConfig;