feat(agents): add client-side tool execution support#126
feat(agents): add client-side tool execution support#126netanelgilad wants to merge 1 commit intomainfrom
Conversation
Enable agent tools to run in the browser (e.g., geolocation, clipboard, DOM access) rather than on the server. Adds registerClientToolHandlers(), submitToolResults(), and handlePendingClientTools() methods. The WebSocket subscription auto-detects pending_client_execution tool calls, runs registered handlers, and POSTs results back to the server. https://claude.ai/code/session_01LZMZNv1qXXeibBhqYRuR54
|
Claude finished @netanelgilad's task —— View job PR Review: Client-Side Tool Execution SupportI've reviewed the changes to add client-side tool execution support for agents. Here's my comprehensive feedback: Review Checklist
🟢 Code Quality and Best PracticesThe implementation follows good patterns overall:
🟡 Potential Bugs or Issues
🟡 Performance Considerations
🔴 Security Concerns
🔴 Test CoverageNo tests were added for the new functionality. Consider adding tests for:
💡 Suggestions
getRegisteredHandlers(conversationId: string): string[] {
return Object.keys(clientToolHandlers[conversationId] || {});
}
const result = await Promise.race([
handler(args, context),
new Promise((_, reject) =>
setTimeout(() => reject(new Error('Tool timeout')), 30000)
)
]);
Overall, this is a solid implementation that adds valuable functionality. The main concerns are around security validation, error handling edge cases, and the lack of test coverage. Addressing these would make this feature production-ready. |
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/sdk@0.8.19-pr.126.c537ed8Prefer not to change any import paths? Install using npm alias so your code still imports npm i "@base44/sdk@npm:@base44-preview/sdk@0.8.19-pr.126.c537ed8"Or add it to your {
"dependencies": {
"@base44/sdk": "npm:@base44-preview/sdk@0.8.19-pr.126.c537ed8"
}
}
Preview published to npm registry — try new features instantly! |
Enable agent tools to run in the browser (e.g., geolocation, clipboard,
DOM access) rather than on the server. Adds registerClientToolHandlers(),
submitToolResults(), and handlePendingClientTools() methods. The WebSocket
subscription auto-detects pending_client_execution tool calls, runs
registered handlers, and POSTs results back to the server.
https://claude.ai/code/session_01LZMZNv1qXXeibBhqYRuR54