🐛 Bug: a2ui-renderer: createCatalog renderer props are typed as the raw schema (Action props aren't callable, bound values unresolved, set<Prop> setters missing) · Issue #7814 · CopilotKit/CopilotKit · GitHub
Skip to content

🐛 Bug: a2ui-renderer: createCatalog renderer props are typed as the raw schema (Action props aren't callable, bound values unresolved, set<Prop> setters missing) #7814

Open

Description

@Laptopmini

♻️ Reproduction Steps

  1. npm install @copilotkit/a2ui-renderer@1.79.0 @a2ui/web_core@0.10.4 zod@3.25.76 react@19 typescript@5 @types/react@19
  2. Type-check this (strict):
import { createCatalog } from "@copilotkit/a2ui-renderer";
import { CommonSchemas } from "@a2ui/web_core/v0_9";
import { z } from "zod";

const definitions = {
  Dimmer: { props: z.object({ level: CommonSchemas.DynamicNumber, changeLevel: CommonSchemas.Action }) },
};

export const catalog = createCatalog(definitions, {
  Dimmer: ({ props }) => (
    <input
      type="range"
      value={Number(props.level ?? 0)}
      onChange={(e) => {
        props.setLevel(Number(e.target.value)); // writes the bound data-model path
        props.changeLevel();                    // dispatches the action, context resolved
      }}
    />
  ),
});
  1. npx tsc --noEmit

✅ Expected Behavior

It type-checks, because that is what the renderer receives at runtime: the GenericBinder passes resolved props. Action props are functions that dispatch the action with its context resolved, a bound DynamicNumber arrives as a number, and every bindable prop gets a set<Prop> setter. The basic catalog's own components rely on this: Slider calls props.setValue(...) and Button passes props.action to onClick.

❌ Actual Behavior

Two errors, and level is typed as the binding rather than the value:

u5.tsx: error TS2339: Property 'setLevel' does not exist on type '{ level: number | { path: string; } | { call: string; ... }; changeLevel: { ...; } | { ...; }; }'.
u5.tsx: error TS2349: This expression is not callable. No constituent of type '{ event: { name: string; context?: ... }; } | { ...; }' is callable.

CatalogRenderers (create-catalog.tsx) types each renderer as ComponentRenderer<z.infer<D[K]["props"]>>, the schema's input shape. The built-in components avoid this because they're typed through createReactComponent, which uses ResolveA2uiProps from @a2ui/web_core.

Fix: ComponentRenderer<ResolveA2uiProps<z.infer<D[K]["props"]>>> (and the same in createA2UICatalog). I checked it by patching the published 1.79.0 create-catalog.d.mts: the example above then type-checks, and props.setLevel("x") is still rejected. I can open a PR.

Screenshots

No response

𝌚 CopilotKit Version

@copilotkit/a2ui-renderer@1.79.0

📄 Logs (Optional)

Activity

  1. copilotkit-outpost-bot commented on Oct 14, 2026

    @copilotkit-outpost-bot

    ⚠️ This is an AI-generated response. We've escalated this to our engineering team — someone will follow up in this thread shortly.

    The type mismatch you've identified is real and the analysis is accurate — CatalogRenderers maps to z.infer<D[K]["props"]> (the raw schema input shape) rather than the runtime-resolved shape, while the built-in components go through createReactComponent which applies ResolveA2uiProps from @a2ui/web_core. The discrepancy is visible in create-catalog.tsx line 65.

    A PR would be welcome — engineering will need to verify the fix and confirm there are no downstream type impacts before merging, but the direction you've described (ResolveA2uiProps<z.infer<D[K]["props"]>> in CatalogRenderers and createA2UICatalog) matches what the runtime actually delivers to renderers.


    🤖 Generated by CopilotKit AI Support · Documentation


    Was this helpful? React with 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions