ComposioHQ/composio · error · Error
proxy() requires an authenticated Composio user session.
Error message
proxy() requires an authenticated Composio user session.
What it means
The proxy() helper forwards requests using the authenticated Composio user session's API key. requireConsumerProxyContext throws this error when helperContext.apiKey is falsy, meaning no authenticated session is available to the helper runtime.
Source
Thrown at ts/packages/cli/src/services/run-helpers-runtime.ts:895
});
return logFilePath ? { ...response, logFilePath } : response;
};
Object.defineProperty(experimentalSubAgentImpl, 'schema', { value: experimentalSubAgentSchema });
return experimentalSubAgentImpl;
};
const createProxyHelper = (params: {
readonly helperContext: RunHelperContext;
readonly composioBaseURL: string;
readonly helperDebugLog: HelperDebugLog;
}) => {
const { helperContext, composioBaseURL, helperDebugLog } = params;
const proxySessionCache = new Map<string, string>();
const requireConsumerProxyContext = () => {
if (!helperContext.apiKey) {
throw new Error('proxy() requires an authenticated Composio user session.');
}
if (!helperContext.orgId || !helperContext.consumerProjectId || !helperContext.consumerUserId) {
throw new Error(
'proxy() requires a consumer project context so it can use the consumer project credentials.'
);
}
return {
apiKey: helperContext.apiKey,
orgId: helperContext.orgId,
projectId: helperContext.consumerProjectId,
userId: helperContext.consumerUserId,
};
};
const fetchComposioJson = async (pathname: string, body: Record<string, unknown>) => {
const auth = requireConsumerProxyContext();
const response = await fetch(`${composioBaseURL}${pathname}`, {
method: 'POST',View on GitHub (pinned to 64b1b85502)
Solutions
- Run composio login (or otherwise authenticate) and retry
- Verify the session/API key is present in the config the CLI loads (helperContext.cliConfigPath)
- For CI, provide the API key via the supported env/config mechanism so helperContext.apiKey is populated
Example fix
# before composio run ... # not logged in; proxy() throws # after composio login composio run ...
Defensive patterns
Strategy: validation
Validate before calling
if (!sessionApiKey) throw new Error('Run composio login before using proxy()'); Try / catch
catch (e) { if (e instanceof Error && e.message.includes('authenticated Composio user session')) { await loginFlow(); retry(); } } Prevention
- Run composio login as a setup step in scripts
- Fail fast on missing session before starting work
When it happens
Trigger: Invoking proxy() in a CLI run where the user has not logged in / no API key was resolved into the helper context (helperContext.apiKey undefined or empty).
Common situations: Fresh machine without composio login, expired/missing session file, running inside a sandbox/CI without credentials, or a misconfigured CLI config path so the session is never loaded.
Understand the failure class
- Authentication and authorization failures — expired tokens, bad credentials, and missing scopes.
Related errors
- proxy_execute: toolkit is required
- proxy_execute: endpoint is required
- Invalid proxy execute parameters
- proxy_execute: method must be one of {sorted(_VALID_METHODS)
- proxy_execute: parameters[{i}] must be a dict with 'name' an
AI-assisted analysis of ComposioHQ/composio@64b1b85502 (2026-08-28).
Data as JSON: /api/errors/3d75a5bf89717aeb.
Report an issue: GitHub.