{"record":{"id":"c3f97d11065b760d","repo":"vercel/ai","slug":"harness-input-harness-harnessid-emitted-a-bu","errorCode":null,"errorMessage":"`Harness '${input.harness.harnessId}' emitted a built-in tool approval request but does not support approval responses.`","messagePattern":"`Harness '(.+?)' emitted a built-in tool approval request but does not support approval responses\\.`","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/harness/src/agent/internal/run-prompt.ts","lineNumber":510,"sourceCode":"        toolCallId: options.toolCall.toolCallId,\n        toolName: options.toolCall.toolName,\n        input: options.toolCall.input,\n        error: options.outcome.error,\n      } as TextStreamPart<TOOLS>);\n    };\n    const processPendingApprovalContinuation = async (\n      approval: HarnessV1PendingToolApproval,\n      continuation: HarnessAgentToolApprovalContinuation,\n    ): Promise<'continued' | 'awaiting-tool-result'> => {\n      enqueueApprovalResponse(approval, continuation);\n      onToolApprovalSettled(approval.approvalId);\n      pendingApprovalsByApprovalId.delete(approval.approvalId);\n      pendingApprovalsByToolCallId.delete(approval.toolCallId);\n\n      if (approval.kind === 'builtin') {\n        settledBuiltinApprovalToolCallIds.add(approval.toolCallId);\n        if (control.submitToolApproval == null) {\n          throw new Error(\n            `Harness '${input.harness.harnessId}' emitted a built-in tool approval request but does not support approval responses.`,\n          );\n        }\n        await control.submitToolApproval({\n          approvalId: approval.approvalId,\n          approved: continuation.approvalResponse.approved,\n          reason: continuation.approvalResponse.reason,\n        });\n        return 'continued';\n      }\n\n      settledHostToolCallIds.add(approval.toolCallId);\n      if (!continuation.approvalResponse.approved) {\n        await control.submitToolResult({\n          toolCallId: approval.toolCallId,\n          output: {\n            type: 'execution-denied',\n            reason: continuation.approvalResponse.reason,","sourceCodeStart":492,"sourceCodeEnd":528,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/harness/src/agent/internal/run-prompt.ts#L492-L528","documentation":"The harness adapter emitted a built-in tool approval request during approval continuation processing, but the harness control object does not implement `submitToolApproval`. The AI SDK requires that a harness that can request approvals for its built-in tools also provide a callback to receive the user's approval decision back. Without it, the approval round-trip cannot complete, so the SDK throws instead of silently dropping the response.","triggerScenarios":"A continuation with `approvalResponse` is being processed (processPendingApprovalContinuation) and an approval with kind 'builtin' is pending, while `control.submitToolApproval` is null/undefined on the harness control object.","commonSituations":"Custom or third-party harness adapters that emit 'tool-approval-request' events for built-in tools but never wired up the `submitToolApproval` callback; partially migrated harness implementations after an SDK version that introduced approval responses; building a harness against an older HarnessV1 control surface.","solutions":["Implement `submitToolApproval` on your harness control object so approval decisions are forwarded to the harness runtime.","If the harness genuinely cannot handle approvals, disable built-in tools that require approval (e.g. via `builtinToolFiltering`) so no approval request is emitted.","Upgrade/fix the harness adapter to the current HarnessV1 interface that includes approval response support."],"exampleFix":"// before\nconst control = {\n  // no submitToolApproval\n};\n\n// after\nconst control = {\n  submitToolApproval: async ({ approvalId, approved }) => {\n    await harness.respondToApproval(approvalId, approved);\n  },\n};","handlingStrategy":"validation","validationCode":"if (typeof control.submitToolApproval !== 'function') {\n  throw new Error('Harness control must implement submitToolApproval to use built-in tool approvals.');\n}","typeGuard":"function supportsApprovalResponses(control: unknown): control is { submitToolApproval: (r: { approvalId: string; approved: boolean }) => Promise<void> } {\n  return typeof control === 'object' && control !== null && 'submitToolApproval' in control && typeof (control as any).submitToolApproval === 'function';\n}","tryCatchPattern":"try {\n  await runPrompt(input);\n} catch (e) {\n  if (e instanceof Error && e.message.includes('does not support approval responses')) {\n    // fall back: disable built-in approvals or upgrade harness control\n  }\n  throw e;\n}","preventionTips":["Always implement the full HarnessV1 control surface, including submitToolApproval, when enabling approvals.","Write an adapter conformance test that emits a built-in approval request and asserts the response round-trips.","Disable approval-requiring built-in tools via builtinToolFiltering if your harness cannot respond to approvals."],"tags":["harness","tool-approval","builtin-tool","api-contract"],"backgroundTag":"unsupported-approval-response","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}