fix composio API integration: URL construction, schema validation, and executeAction calls

- Fix URL construction in composioApiCall to preserve base path (/api/v3)
- Make ZToolkit and ZTool schema fields optional to match actual API responses
- Fix error detection to not trigger on successful responses with null error
- Fix executeAction calls in sync_gmail to use correct request object shape
- Use .successful instead of .success to match ZExecuteActionResponse schema

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Arjun 2026-03-16 09:57:55 +05:30
parent 17bb625ab9
commit dd361cb6bf
4 changed files with 21 additions and 13 deletions

View file

@ -70,7 +70,7 @@ export async function initiateConnection(toolkitSlug: string): Promise<{
const toolkit = await composioClient.getToolkit(toolkitSlug);
// Check for managed OAuth2
if (!toolkit.composio_managed_auth_schemes.includes('OAUTH2')) {
if (!toolkit.composio_managed_auth_schemes?.includes('OAUTH2')) {
return {
success: false,
error: `Toolkit ${toolkitSlug} does not support managed OAuth2`,