Skip to content

Commit aa0674f

Browse files
committed
fix(showcase): switch built-in-agent interrupt pages to V2 CopilotKitProvider
gen-ui-interrupt and interrupt-headless pages were using V1 CopilotKit with named agents (agent="gen-ui-interrupt", agent="interrupt-headless") but the built-in-agent runtime only registers a single "default" agent via CopilotRuntime V2. This caused 404/agent-not-found errors at D5. Switch both pages to CopilotKitProvider with useSingleEndpoint and remove agentId from CopilotChat, matching the pattern used by all other built-in-agent demo pages.
1 parent fbe882e commit aa0674f

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

  • showcase/integrations/built-in-agent/src/app/demos

showcase/integrations/built-in-agent/src/app/demos/gen-ui-interrupt/page.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
// the user decides.
1414

1515
import React, { useRef } from "react";
16-
import { CopilotKit } from "@copilotkit/react-core";
1716
import {
17+
CopilotKitProvider,
1818
CopilotChat,
1919
useConfigureSuggestions,
2020
useFrontendTool,
@@ -35,13 +35,13 @@ type PickerResult =
3535

3636
export default function GenUiInterruptDemo() {
3737
return (
38-
<CopilotKit runtimeUrl="/api/copilotkit" agent="gen-ui-interrupt">
38+
<CopilotKitProvider runtimeUrl="/api/copilotkit" useSingleEndpoint>
3939
<div className="flex justify-center items-center h-screen w-full">
4040
<div className="h-full w-full max-w-4xl">
4141
<Chat />
4242
</div>
4343
</div>
44-
</CopilotKit>
44+
</CopilotKitProvider>
4545
);
4646
}
4747

@@ -117,6 +117,6 @@ function Chat() {
117117
// @endregion[frontend-promise-handler]
118118

119119
return (
120-
<CopilotChat agentId="gen-ui-interrupt" className="h-full rounded-2xl" />
120+
<CopilotChat className="h-full rounded-2xl" />
121121
);
122122
}

showcase/integrations/built-in-agent/src/app/demos/interrupt-headless/page.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
// — equivalent UX, different mechanism.
2020

2121
import React, { useRef, useState } from "react";
22-
import { CopilotKit } from "@copilotkit/react-core";
2322
import {
23+
CopilotKitProvider,
2424
CopilotChat,
2525
useConfigureSuggestions,
2626
useFrontendTool,
@@ -47,9 +47,9 @@ const DEFAULT_SLOTS: TimeSlot[] = [
4747

4848
export default function InterruptHeadlessDemo() {
4949
return (
50-
<CopilotKit runtimeUrl="/api/copilotkit" agent="interrupt-headless">
50+
<CopilotKitProvider runtimeUrl="/api/copilotkit" useSingleEndpoint>
5151
<Layout />
52-
</CopilotKit>
52+
</CopilotKitProvider>
5353
);
5454
}
5555

@@ -129,7 +129,7 @@ function Layout() {
129129
<div className="grid h-screen grid-cols-[1fr_420px] bg-[#FAFAFC]">
130130
<AppSurface pending={pending} resolve={resolve} />
131131
<div className="border-l border-[#DBDBE5] bg-white">
132-
<CopilotChat agentId="interrupt-headless" className="h-full" />
132+
<CopilotChat className="h-full" />
133133
</div>
134134
</div>
135135
);

0 commit comments

Comments
 (0)