# resolve > Finalizes a queued preview action by applying or discarding it. ## Source - Entry: `packages/coding-agent/src/tools/resolve.ts` - Model-facing prompt: `packages/coding-agent/src/prompts/tools/resolve.md` - Key collaborators: - `docs/resolve-tool-runtime.md` — preview/apply runtime reference - `packages/coding-agent/src/extensibility/custom-tools/loader.ts` — forwards custom pending actions into the queue - `packages/coding-agent/src/tools/ast-edit.ts` — built-in preview producer example - `packages/coding-agent/src/session/agent-session.ts` — tool-choice queue and invoker access ## Inputs | Field | Type | Required | Description | | --- | --- | --- | --- | | `action` | `"apply" | "discard"` | Yes | Whether to commit or reject the queued preview. | | `reason` | `string` | Yes | Required explanation passed through to the queued callback. | ## Outputs - Single-shot result. - `execute()` returns whatever the queued invoker returns, with `details` wrapped/augmented to include: - `action` - `reason` - `sourceToolName?` - `label?` - `sourceResultDetails?` — original `result.details` from the apply/reject callback when present - If `discard` has no custom reject callback, the default success payload is `Discarded: