Skip to content

Commit ddb2480

Browse files
committed
fix(showcase/langgraph-python): restore useDefaultRenderTool() in default catchall cell
The blitz removed the explicit useDefaultRenderTool() call expecting a framework-level fallback to handle zero-hook registrations, but the integration uses the published @copilotkit/react-core@1.56.5 which does not yet ship that fallback. Without the call, useRenderToolCall has no '*' renderer and tool calls render invisibly — the user only sees the agent's final text summary instead of the OOTB tool card. Restore the explicit useDefaultRenderTool() invocation. The framework fallback (committed in this PR but inert until react-core publishes a release that includes it) becomes a no-op once that ships.
1 parent 6ad6dfb commit ddb2480

1 file changed

Lines changed: 40 additions & 9 deletions

File tree

  • showcase/integrations/langgraph-python/src/app/demos/tool-rendering-default-catchall

showcase/integrations/langgraph-python/src/app/demos/tool-rendering-default-catchall/page.tsx

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,25 @@
44
//
55
// This cell is the simplest point in the three-way progression. The
66
// backend exposes a handful of mock tools (get_weather, search_flights,
7-
// get_stock_price, roll_d20) and the frontend opts into ZERO custom
8-
// renderers — the runtime's built-in `DefaultToolCallRenderer` paints
9-
// every tool call with a stable `[data-testid="copilot-tool-render"]`
10-
// wrapper plus a `data-tool-name="<name>"` attribute.
7+
// get_stock_price, roll_dice) and the frontend ONLY opts into
8+
// CopilotKit's built-in default tool-call card — no per-tool renderers,
9+
// no custom wildcard UI.
10+
//
11+
// `useDefaultRenderTool()` (called with no config) registers the built-
12+
// in `DefaultToolCallRenderer` under the `*` wildcard. That renderer
13+
// shows the tool name, a live status pill (Running → Done), and a
14+
// collapsible "Arguments / Result" section that fills in as the call
15+
// progresses. Without this hook the runtime has NO `*` renderer, so
16+
// `useRenderToolCall` falls through to `null` and tool calls are
17+
// invisible — the user only sees the assistant's final text summary.
1118

1219
import React from "react";
13-
import { CopilotKit, CopilotChat } from "@copilotkit/react-core/v2";
14-
import { useSuggestions } from "./suggestions";
20+
import {
21+
CopilotKit,
22+
CopilotChat,
23+
useConfigureSuggestions,
24+
useDefaultRenderTool,
25+
} from "@copilotkit/react-core/v2";
1526

1627
export default function ToolRenderingDefaultCatchallDemo() {
1728
return (
@@ -30,11 +41,31 @@ export default function ToolRenderingDefaultCatchallDemo() {
3041

3142
function Chat() {
3243
// @region[default-catchall-zero-config]
33-
// The whole point of this cell: ZERO custom render hooks. The
34-
// built-in default tool-call renderer paints every tool call.
35-
useSuggestions();
44+
// Opt in to CopilotKit's built-in default tool-call card. Called with
45+
// no config so the package-provided `DefaultToolCallRenderer` is used
46+
// as the wildcard renderer — this is the "out-of-the-box" UI the cell
47+
// is meant to showcase.
48+
useDefaultRenderTool();
3649
// @endregion[default-catchall-zero-config]
3750

51+
useConfigureSuggestions({
52+
suggestions: [
53+
{
54+
title: "Weather in SF",
55+
message: "What's the weather in San Francisco?",
56+
},
57+
{
58+
title: "Find flights",
59+
message: "Find flights from SFO to JFK.",
60+
},
61+
{
62+
title: "Roll a d20",
63+
message: "Roll a 20-sided die.",
64+
},
65+
],
66+
available: "always",
67+
});
68+
3869
return (
3970
<CopilotChat
4071
agentId="tool-rendering-default-catchall"

0 commit comments

Comments
 (0)