{"record":{"id":"43f0ea3578d16f10","repo":"ComposioHQ/composio","slug":"s-is-required","errorCode":null,"errorMessage":"%s is required","messagePattern":"(.+?) is required","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"ts/packages/experimental/src/workbench/python-helpers/composio_helper.py","lineNumber":37,"sourceCode":"\nDEFAULT_INVOKE_LLM_MODEL = _INTERNAL.get(\"invoke_llm_model\", \"openai/gpt-oss-120b\")\nRATE_LIMIT_PATTERNS = (\n    \"rate limit\",\n    \"ratelimit\",\n    \"too many requests\",\n    \"quota exceeded\",\n    \"resource exhausted\",\n)\n\n\ndef _read_env(name, default=None):\n    value = os.environ.get(name)\n    return default if value is None or value == \"\" else value\n\n\ndef _require_value(value, label):\n    if value is None or value == \"\":\n        raise RuntimeError(\"%s is required\" % label)\n    return value\n\n\ndef _request_id():\n    return str(uuid.uuid4())\n\n\ndef _session_execute_url():\n    backend_url = _read_env(\"BACKEND_URL\", \"https://backend.composio.dev\").rstrip(\"/\")\n    session_id = _require_value(\n        _read_env(\"COMPOSIO_TOOLROUTER_SESSION_ID\"),\n        \"COMPOSIO_TOOLROUTER_SESSION_ID\",\n    )\n    encoded_session_id = urllib.parse.quote(session_id, safe=\"\")\n    return \"%s/api/v3/tool_router/session/%s/execute\" % (backend_url, encoded_session_id)\n\n\ndef _session_proxy_execute_url():","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/ts/packages/experimental/src/workbench/python-helpers/composio_helper.py#L19-L55","documentation":"_require_value in composio_helper.py raises RuntimeError when a required value (typically an env var already fetched, like a session execute URL or proxy URL) is None or empty string. It guards the local-workbench Python helper before it can issue requests without an endpoint.","triggerScenarios":"The helper runs _session_execute_url / _session_proxy_execute_url / run_composio_tool with the corresponding env var (set by the TS layer) unset or empty — e.g. COMPOSIO_SESSION_EXECUTE_URL not injected into the sandbox process.","commonSituations":"Env vars not propagated to the spawned Python process; misconfigured local workbench sandbox; stripping of env in Docker/container exec; manual invocation of the helper without the TS launcher.","solutions":["Run the helper through experimental_createLocalWorkbenchSession so the launcher injects the required env vars","Check the error's label (%s is required names the missing value) to identify the exact env var","Ensure the container/sandbox environment passes through COMPOSIO_* variables (no env allowlist stripping)","Update @composio/experimental — env var naming has changed across versions"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import os\nfor var in ('COMPOSIO_SESSION_EXECUTE_URL', 'COMPOSIO_SESSION_PROXY_EXECUTE_URL'):\n    if not os.environ.get(var):\n        raise RuntimeError(f'{var} is required; launch via experimental_createLocalWorkbenchSession')","typeGuard":"def _has_env(name: str) -> bool:\n    v = os.environ.get(name)\n    return v is not None and v != ''","tryCatchPattern":"try:\n    run_composio_tool(...)\nexcept RuntimeError as e:\n    if 'is required' in str(e):\n        # re-inject env or relaunch via the TS workbench launcher\n    raise","preventionTips":["Always launch the helper via the TS local workbench session, not manually","Ensure sandbox containers pass COMPOSIO_* env vars through","Keep @composio/experimental updated — env var names evolve"],"tags":["python","environment-variables","workbench","local-sandbox"],"backgroundTag":"missing-env-var","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}