PendingApproval

class PendingApproval(val toolCallId: String, val toolName: String, val input: JsonElement, val approvalId: String? = null, val signature: String? = null)(source)

A pending tool-call approval surfaced from Agent.generate / Agent.stream. Per v6 RPC semantics, generation completes when one or more tools require approval — the host inspects GenerateResult.pendingApprovals, presents UI, and resumes by calling Agent.generate again with messages = result.messages + ToolApprovalResponseMessage(...).

There is no Agent.submitApproval — approval flows entirely through the message log so it is serializable, persistable, and resumable across process restarts.

Constructors

Link copied to clipboard
constructor(toolCallId: String, toolName: String, input: JsonElement, approvalId: String? = null, signature: String? = null)

Properties

Link copied to clipboard

Approval-identity key. Mirrors v6's approvalId (per historical parity gap #7). Distinct from toolCallId because multiple approvals can share a toolCallId (e.g., parallel tool-call batches where the model emits one tool-call with the SAME id twice and each side needs separate approval). When null, the host treats approvalId = toolCallId — adequate for the common single-approval case.

Link copied to clipboard
Link copied to clipboard

HMAC-SHA256 signature binding this approval to its tool call (v6.0.202). Present only when the issuing agent holds an experimental_toolApprovalSecret; the host persists and replays it untouched — only the secret holder can mint or verify it.

Link copied to clipboard
Link copied to clipboard