{"record":{"id":"76cb6bc840023813","repo":"can1357/oh-my-pi","slug":"tool-this-tool-name-has-pending-provider-safe","errorCode":null,"errorMessage":"Tool \"${this.tool.name}\" has pending provider safety checks but no interactive UI is available.","messagePattern":"Tool \"(.+?)\" has pending provider safety checks but no interactive UI is available\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/extensibility/extensions/wrapper.ts","lineNumber":311,"sourceCode":"\t\t\tconst emitApprovalResolved = async (approved: boolean, reason?: string) => {\n\t\t\t\tif (!hasApprovalHandlers) return;\n\t\t\t\tawait this.runner.emit({\n\t\t\t\t\ttype: \"tool_approval_resolved\",\n\t\t\t\t\tsessionId,\n\t\t\t\t\ttoolName: this.tool.name,\n\t\t\t\t\ttoolCallId,\n\t\t\t\t\tapproved,\n\t\t\t\t\t...(reason ? { reason } : {}),\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t// Provider safety checks fail closed without an interactive prompt. Unlike\n\t\t\t// ordinary tier approval, no setting or yolo mode may bypass this gate.\n\t\t\tif (!this.runner.hasUI()) {\n\t\t\t\tconst reason = \"no interactive UI available\";\n\t\t\t\tawait emitApprovalResolved(false, reason);\n\t\t\t\tif (pendingSafetyChecks.length > 0) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Tool \"${this.tool.name}\" has pending provider safety checks but no interactive UI is available.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Tool \"${this.tool.name}\" requires approval but no interactive UI available.\\n` +\n\t\t\t\t\t\t`Options:\\n` +\n\t\t\t\t\t\t`  1. Set tools.approvalMode: yolo in /settings\\n` +\n\t\t\t\t\t\t`  2. Add tools.approval.${this.tool.name}: allow to config\\n` +\n\t\t\t\t\t\t`  3. Use an interactive UI to approve the tool call`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst uiContext = this.runner.getUIContext();\n\t\t\tconst basePrompt = formatApprovalPrompt(this.tool, resolvedArgs, approvalCheck.reason);\n\t\t\tconst safetyPrompt =\n\t\t\t\tpendingSafetyChecks.length > 0\n\t\t\t\t\t? `${basePrompt}\\nProvider safety checks:\\n${safetyCheckLines(pendingSafetyChecks).join(\"\\n\")}`\n\t\t\t\t\t: basePrompt;","sourceCodeStart":293,"sourceCodeEnd":329,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/extensibility/extensions/wrapper.ts#L293-L329","documentation":"The tool call requires provider-side safety checks (e.g. server-enforced confirmation) but the current runner has no interactive UI, and provider safety checks cannot be bypassed by any setting or yolo mode — they fail closed. The wrapper throws this error instead of executing the tool.","triggerScenarios":"Running tool execution headlessly (SDK, RPC, non-TUI embedding) with a tool whose provider returned pending safety checks; this.runner.hasUI() returns false while pendingSafetyChecks.length > 0.","commonSituations":"Headless scripts or CI invoking the agent SDK; RPC mode without an attached UI; running in a piped/non-TTY environment where the interactive prompt cannot render.","solutions":["Run the tool call inside an interactive UI (TUI) so the safety-check prompt can be shown","Route execution through an embedding that provides a UI to the runner (hasUI() true)","If safety checks are already approved upstream, set context.providerSafetyApproved so the gate is skipped","Restructure the workflow so the flagged tool call is not issued headlessly"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (!runner.hasUI()) throw new Error('provider safety checks require an interactive UI; re-run in TUI');","typeGuard":null,"tryCatchPattern":"try { await tool.execute(params); } catch (err) {\n  if (err instanceof Error && err.message.includes('pending provider safety checks')) {\n    // surface guidance: run interactively or pre-approve\n  } else throw err;\n}","preventionTips":["Never run safety-check-gated tools headlessly without a UI-backed runner","Check runner.hasUI() before dispatching gated tool calls","Keep provider-safety approval state (context.providerSafetyApproved) in sync in SDK embeddings","Document to users that safety checks cannot be bypassed by yolo mode"],"tags":["safety-check","headless","approval-gate","ui"],"backgroundTag":"approval-required-no-ui","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}