{"record":{"id":"518d7b3e5455856a","repo":"ComposioHQ/composio","slug":"interactive-permission-prompts-are-disabled-in-thi","errorCode":null,"errorMessage":"Interactive permission prompts are disabled in this environment (CI/VITEST, or COMPOSIO_DISABLE_PERMISSION_UI); cannot collect an approval for ${params.toolSlug}.","messagePattern":"Interactive permission prompts are disabled in this environment \\(CI/VITEST, or COMPOSIO_DISABLE_PERMISSION_UI\\); cannot collect an approval for (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"ts/packages/cli/src/services/tool-permissions.ts","lineNumber":1047,"sourceCode":"        reject(new Error('Unable to allocate permission callback port.'));\n        return;\n      }\n\n      void open(`http://127.0.0.1:${port}/?token=${encodeURIComponent(token)}`, {\n        wait: false,\n      }).catch(error => {\n        server.close();\n        reject(error);\n      });\n    });\n  });\n\nconst requestPermissionDecision = async (params: {\n  readonly toolSlug: string;\n  readonly accountLabel?: string;\n}): Promise<PermissionDecision> => {\n  if (await Effect.runPromise(isInteractivePermissionUiDisabled)) {\n    throw new Error(\n      `Interactive permission prompts are disabled in this environment (CI/VITEST, or COMPOSIO_DISABLE_PERMISSION_UI); cannot collect an approval for ${params.toolSlug}.`\n    );\n  }\n\n  // Prefer the bundled macOS native sidecar when it is available. The browser\n  // prompt remains the cross-platform fallback and is only opened when the\n  // native sidecar is missing or fails before returning a decision.\n  const nativeDecision = await requestNativeUiPermissionDecision(params).catch(() => undefined);\n  if (nativeDecision === 'allow_once' || nativeDecision === 'allow_session') return nativeDecision;\n  if (nativeDecision === 'deny' || nativeDecision === 'dismissed') return 'deny';\n  return requestPermissionInBrowser({ ...params, agent: await detectNativeUiCallerAgent() });\n};\n\nexport const gateToolExecution = (params: GateParams) =>\n  Effect.gen(function* () {\n    const state = resolveGateState(params);\n    if (state === 'skip') return;\n","sourceCodeStart":1029,"sourceCodeEnd":1065,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/ts/packages/cli/src/services/tool-permissions.ts#L1029-L1065","documentation":"The CLI's interactive permission prompt cannot be shown because the environment is detected as non-interactive (CI, Vitest) or COMPOSIO_DISABLE_PERMISSION_UI is set. The tool-approval flow needs a human decision for the given toolSlug, so it throws rather than silently approving or hanging.","triggerScenarios":"Calling an API that ends in requestPermissionDecision for a tool while running under CI/VITEST env detection or with COMPOSIO_DISABLE_PERMISSION_UI set, without a non-interactive approval policy in place.","commonSituations":"Running the Composio CLI or its tests in CI pipelines, Docker containers without a TTY, or headless environments where the permission UI was explicitly disabled.","solutions":["Set an explicit non-interactive permission policy (e.g. allowlist/deny rules or a pre-configured approval mode) so no interactive prompt is needed","Unset COMPOSIO_DISABLE_PERMISSION_UI and ensure a TTY is available if interactive approval is intended","In tests, mock/stub the permission decision layer rather than relying on prompts"],"exampleFix":"// before\nawait cli.run(commandRequiringApproval);\n// after\nprocess.env.COMPOSIO_TOOL_PERMISSIONS = 'allow'; // or configure allowlist\nawait cli.run(commandRequiringApproval);","handlingStrategy":"validation","validationCode":"import { Effect } from 'effect';\nconst disabled = await Effect.runPromise(isInteractivePermissionUiDisabled);\nif (disabled) { /* set non-interactive policy or skip */ }","typeGuard":null,"tryCatchPattern":"catch (e) { if (/Interactive permission prompts are disabled/.test(String(e.message))) { /* apply fallback policy */ } else throw e; }","preventionTips":["Configure explicit allow/deny permission rules in CI","Never rely on interactive prompts in headless environments"],"tags":["permissions","cli","environment","typescript"],"backgroundTag":"interactive-prompt-unavailable","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}