# Resolve tool runtime internals This document explains how preview/apply workflows are modeled in coding-agent and how built-in or custom tools can participate via the pending-invoker registry and `pushPendingAction`. (Pending previews live in a separate non-forcing registry inside `ToolChoiceQueue`; only genuine hard forces use the consuming directive queue.) ## Scope and key files - [`src/tools/resolve.ts`](../packages/coding-agent/src/tools/resolve.ts) - [`src/tools/ast-edit.ts`](../packages/coding-agent/src/tools/ast-edit.ts) - [`src/extensibility/custom-tools/types.ts`](../packages/coding-agent/src/extensibility/custom-tools/types.ts) - [`src/extensibility/custom-tools/loader.ts`](../packages/coding-agent/src/extensibility/custom-tools/loader.ts) - [`src/sdk.ts`](../packages/coding-agent/src/sdk.ts) ## What `resolve` does `resolve` is a hidden tool that finalizes a pending preview action. - `action: "apply"` executes the queued action's `apply(reason, extra)` callback and returns that result with resolve metadata. - `action: "discard"` invokes `reject(reason, extra)` if provided; otherwise returns `Discarded: