{"record":{"id":"e0c2f8262f223a30","repo":"ComposioHQ/composio","slug":"proxy-execute-toolkit-is-required","errorCode":null,"errorMessage":"proxy_execute: toolkit is required","messagePattern":"proxy_execute: toolkit is required","errorType":"validation","errorClass":"ValidationError","httpStatus":null,"severity":"error","filePath":"python/composio/core/models/session_context.py","lineNumber":54,"sourceCode":"\ndef proxy_execute_impl(\n    client: HttpClient,\n    session_id: str,\n    *,\n    toolkit: str,\n    endpoint: str,\n    method: t.Literal[\"GET\", \"POST\", \"PUT\", \"DELETE\", \"PATCH\"],\n    body: t.Any = None,\n    parameters: t.Optional[t.List[t.Dict[str, t.Any]]] = None,\n) -> ToolRouterSessionProxyExecuteResponse:\n    \"\"\"Shared proxy execute implementation used by SessionContextImpl and ToolRouterSession.\n\n    Projects the generated client's response model onto the SDK's own shape so\n    the public return type does not move when the client is regenerated.\n    \"\"\"\n    # Client-side validation (matches TS SessionProxyExecuteParamsSchema)\n    if not toolkit:\n        raise ValidationError(\"proxy_execute: toolkit is required\")\n    if not endpoint:\n        raise ValidationError(\"proxy_execute: endpoint is required\")\n    if method not in _VALID_METHODS:\n        raise ValidationError(\n            f\"proxy_execute: method must be one of {sorted(_VALID_METHODS)}, got {method!r}\"\n        )\n\n    # Transform and validate parameters\n    api_params: t.List[Parameter] = []\n    if parameters:\n        for i, p in enumerate(parameters):\n            if not isinstance(p, dict) or \"name\" not in p or \"value\" not in p:\n                raise ValidationError(\n                    f\"proxy_execute: parameters[{i}] must be a dict with 'name' and 'value' keys\"\n                )\n            param_type = p.get(\"in\", p.get(\"type\", \"header\"))\n            if param_type not in _VALID_PARAM_TYPES:\n                raise ValidationError(","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/python/composio/core/models/session_context.py#L36-L72","documentation":"Client-side guard in proxy_execute that rejects the call before any network traffic when the toolkit argument is falsy. It mirrors the TS SessionProxyExecuteParamsSchema so both SDKs fail identically on missing required params.","triggerScenarios":"Calling session.proxy_execute(toolkit=None/'', endpoint=...) or omitting the toolkit positional/keyword — e.g. building params dynamically and passing an empty string.","commonSituations":"Programmatically constructed proxy calls where a variable holding the toolkit slug is None because a preceding lookup failed.","solutions":["Pass a non-empty toolkit slug, e.g. 'github'","Log/validate dynamic param dicts before calling proxy_execute"],"exampleFix":"# before\nsession.proxy_execute(toolkit=tk, endpoint=\"/repos\")  # tk is None\n\n# after\ntk = tk or \"github\"\nsession.proxy_execute(toolkit=tk, endpoint=\"/repos\")","handlingStrategy":"validation","validationCode":"if not toolkit:\n    raise ValueError('toolkit is required')","typeGuard":"def has_toolkit(p: dict) -> bool:\n    return bool(p.get('toolkit'))","tryCatchPattern":null,"preventionTips":["Validate dynamic param dicts before proxy_execute"],"tags":["python","session","validation","proxy"],"backgroundTag":"missing-required-parameter","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}