# resolve > Finalizes a pending 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, standing resolve handler, and invoker access ## Inputs | Field | Type | Required | Description | | --- | --- | --- | --- | | `action` | `"apply" | "discard"` | Yes | Whether to commit or reject the pending action. | | `reason` | `string` | Yes | Required explanation passed through to the handler. | | `extra` | `Record` | No | Free-form metadata passed through to the handler. Plan approval uses this for data such as a title slug; preview-style actions usually ignore it. | ## Outputs - Single-shot result. - `execute()` returns whatever the queued or standing invoker returns, with `details` wrapped/augmented to include: - `action` - `reason` - `extra?` - `sourceToolName?` - `label?` - `sourceResultDetails?` — original `result.details` from the apply/reject callback when present - If `discard` has no custom reject callback, or the reject callback returns `undefined`, the default success payload is `Discarded: