🚀 Feature Request: useCopilotAction: renderAndwaitForResponse need to be available for catch All Actions ,
🎤 Tell us your idea
Greetings CopilotKit, I have a use case where i have some some n number of tools to undergo HITL , so instead of using multiple useCopilotAction , i want to use single hook when i checked with catchALLRenders -useCopilotAction with wildcard * at name , it doesnt work for renderandwaitForResponse Please enhance useCopilotAction feature(CATCH ALL ACTIONS) to work for renderandwaitForResponse
Hi @SindhuZelar, this is a great suggestion. We'll be adding this on our side soon or following up with a response if there is something blocking it.
Thanks again!
Currently, useCopilotAction does not support using renderAndWaitForResponse with catch-all actions (wildcard * for the action name). While you can use a wildcard to catch all actions, this combination is explicitly blocked in the codebase.
Details from the Codebase
- Wildcard actions exist but with limitations: You can use
name: "*"to create catch-all actions, but they cannot userenderAndWaitForResponse. - Technical limitation: The source code explicitly prevents this combination with a check that returns
falseforisFrontendAction()whenaction.name === "*".
What works with wildcard actions
useCopilotAction({
name: "*",
render: ({ name, args, status, result, handler, respond }) => {
return <div>Rendering action: {name}</div>;
}
});
What doesn't work
// This will NOT work - renderAndWaitForResponse is blocked for catch-all actions
useCopilotAction({
name: "*",
handler: async () => {
const response = await renderAndWaitForResponse(/* ... */); // ❌ Not available
}
});
Alternative Approaches
- Use specific action names: Instead of wildcards, define individual actions that can use
renderAndWaitForResponse. - Use
renderproperty only: Catch-all actions can still provide UI rendering through therenderproperty and receive the actual action name in props.
Future Enhancement Plans
- No roadmap found: There's no evidence in the changelog or documentation of plans to enhance this feature to support
renderAndWaitForResponsewith wildcard actions.
Source Code Reference:
- useCopilotAction Implementation - Lines 173-175 and 340 show the explicit limitation
Was this helpful?
If this solution worked for you, please click on the appropriate option below to help us improve: