{"record":{"id":"1754361c0be5d51e","repo":"ComposioHQ/composio","slug":"proxy-requires-a-consumer-project-context-so-it","errorCode":null,"errorMessage":"proxy() requires a consumer project context so it can use the consumer project credentials.","messagePattern":"proxy\\(\\) requires a consumer project context so it can use the consumer project credentials\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"ts/packages/cli/src/services/run-helpers-runtime.ts","lineNumber":898,"sourceCode":"\n  Object.defineProperty(experimentalSubAgentImpl, 'schema', { value: experimentalSubAgentSchema });\n  return experimentalSubAgentImpl;\n};\n\nconst createProxyHelper = (params: {\n  readonly helperContext: RunHelperContext;\n  readonly composioBaseURL: string;\n  readonly helperDebugLog: HelperDebugLog;\n}) => {\n  const { helperContext, composioBaseURL, helperDebugLog } = params;\n  const proxySessionCache = new Map<string, string>();\n\n  const requireConsumerProxyContext = () => {\n    if (!helperContext.apiKey) {\n      throw new Error('proxy() requires an authenticated Composio user session.');\n    }\n    if (!helperContext.orgId || !helperContext.consumerProjectId || !helperContext.consumerUserId) {\n      throw new Error(\n        'proxy() requires a consumer project context so it can use the consumer project credentials.'\n      );\n    }\n    return {\n      apiKey: helperContext.apiKey,\n      orgId: helperContext.orgId,\n      projectId: helperContext.consumerProjectId,\n      userId: helperContext.consumerUserId,\n    };\n  };\n\n  const fetchComposioJson = async (pathname: string, body: Record<string, unknown>) => {\n    const auth = requireConsumerProxyContext();\n    const response = await fetch(`${composioBaseURL}${pathname}`, {\n      method: 'POST',\n      headers: {\n        'content-type': 'application/json',\n        'x-user-api-key': auth.apiKey,","sourceCodeStart":880,"sourceCodeEnd":916,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/ts/packages/cli/src/services/run-helpers-runtime.ts#L880-L916","documentation":"Beyond an API key, proxy() needs a consumer project context: orgId, consumerProjectId, and consumerUserId. If any of these is missing from helperContext, the request cannot be attributed to consumer project credentials and this error is thrown.","triggerScenarios":"Invoking proxy() with an authenticated session but outside a consumer project scope — one of helperContext.orgId, consumerProjectId, or consumerUserId is undefined/empty.","commonSituations":"Using proxy() from a top-level user session without an active consumer project, partial environment/config that sets the API key but not org/project/user IDs, or running helper code in a context that never established project scope.","solutions":["Run the helper inside a consumer project context so org/project/user IDs are populated in helperContext","Re-create/select the consumer project in the CLI and retry","Inspect the helper context/config to confirm orgId, consumerProjectId, consumerUserId are all set before calling proxy()"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (!ctx.orgId || !ctx.consumerProjectId || !ctx.consumerUserId) throw new Error('proxy() needs an active consumer project context');","typeGuard":"const hasConsumerContext = (c: {orgId?: string; consumerProjectId?: string; consumerUserId?: string}): boolean => !!(c.orgId && c.consumerProjectId && c.consumerUserId);","tryCatchPattern":null,"preventionTips":["Establish/select the consumer project before running helpers that call proxy()","Assert helper context fields in debug logs when proxy issues arise"],"tags":["proxy","consumer-project","context","configuration"],"backgroundTag":"missing-required-context","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}