{"record":{"id":"dc36deb27bc5ed66","repo":"ComposioHQ/composio","slug":"invalid-proxy-execute-parameters","errorCode":null,"errorMessage":"Invalid proxy execute parameters","messagePattern":"Invalid proxy execute parameters","errorType":"validation","errorClass":"ValidationError","httpStatus":null,"severity":"error","filePath":"ts/packages/core/src/models/SessionContext.ts","lineNumber":118,"sourceCode":"    }\n\n    const response = await withCancellation(\n      () => this.client.toolRouter.session.execute(this.sessionId, executeParams, requestOptions),\n      requestOptions?.signal\n    );\n    return ToolRouterSessionExecuteResponseSchema.parse(transformExecuteResponse(response));\n  }\n\n  /**\n   * Proxy API calls through Composio's auth layer.\n   * The backend resolves the connected account from the toolkit within the session.\n   */\n  async proxyExecute(\n    params: SessionProxyExecuteParams\n  ): Promise<ToolRouterSessionProxyExecuteResponse> {\n    const validated = SessionProxyExecuteParamsSchema.safeParse(params);\n    if (!validated.success) {\n      throw new ValidationError('Invalid proxy execute parameters', { cause: validated.error });\n    }\n\n    const signal = this.signal;\n    const requestOptions = signal ? { signal } : undefined;\n\n    const clientParams = transformProxyParams(validated.data);\n    const response = await withCancellation(\n      () =>\n        this.client.toolRouter.session.proxyExecute(this.sessionId, clientParams, requestOptions),\n      requestOptions?.signal\n    );\n\n    return {\n      status: response.status,\n      data: response.data,\n      headers: response.headers,\n      ...(response.binary_data\n        ? {","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/ts/packages/core/src/models/SessionContext.ts#L100-L136","documentation":"SessionContext.proxyExecute() validates its params against SessionProxyExecuteParamsSchema and throws ValidationError (with the Zod error as cause) before forwarding the (transformed) request to the tool router session proxy endpoint.","triggerScenarios":"Calling session.context.proxyExecute(...) (or response/result helpers) with malformed params — wrong field names, missing required tool or args fields, or invalid types per SessionProxyExecuteParamsSchema.","commonSituations":"Forwarding raw JSON from an LLM tool call without normalizing; schema drift between SDK versions renaming proxy params; constructing params manually instead of from the SDK type.","solutions":["Inspect error.cause.issues for failing fields","Type params as SessionProxyExecuteParams to catch mistakes at compile time","Normalize LLM-emitted arguments (strings vs objects) before calling proxyExecute"],"exampleFix":"// before\nawait ctx.proxyExecute({ tool: 123, arguments: 'none' });\n// after\nawait ctx.proxyExecute({ tool: 'github_create_issue', arguments: { title: 'x' } });","handlingStrategy":"type-guard","validationCode":"import { SessionProxyExecuteParamsSchema } from '@composio/core';\nconst r = SessionProxyExecuteParamsSchema.safeParse(params);\nif (!r.success) throw new Error(JSON.stringify(r.error.issues));\nawait ctx.proxyExecute(params);","typeGuard":"const isProxyParams = (p: unknown): p is SessionProxyExecuteParams =>\n  SessionProxyExecuteParamsSchema.safeParse(p).success;","tryCatchPattern":"try { await ctx.proxyExecute(params); } catch (e) { if (e instanceof ValidationError && /proxy execute/.test(e.message)) { params = normalizeLlmArgs(params); return ctx.proxyExecute(params); } throw e; }","preventionTips":["Type proxy params with the exported type","Normalize LLM tool-call arguments before forwarding","safeParse untrusted payloads first"],"tags":["session","proxy","zod","validation","typescript"],"backgroundTag":"schema-validation-failed","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}