Failures and effect recovery
Distinguish safe input repair from uncertain execution so retries cannot silently duplicate effects.
Classify the failure before retrying
Invalid input can fail before a binding runs. An explicitly enabled modelRepair policy can turn supported validation failures into bounded model-visible feedback. Ordinary provider or binding errors must not leak secrets into that feedback.
import {
ToolModelVisibleError,
ToolExecutionUncertainError,
createRunToolExecutionIntentStore,
} from "@smoothie-framework/runtime/tools";ToolModelVisibleError is for safe application-authored messages, not arbitrary exception text. Policy denial, missing approval and cancellation are not instructions for the model to work around controls.
Persist intent for external effects
A write can succeed remotely even when its response is lost or invalid. TOOL_EXECUTION_UNCERTAIN stops model-driven recovery; do not automatically redispatch it.
Use a durable execution-intent store with replay-safe binding semantics where required. Keep stable logical action identity across resume. Reconcile the external system under host authority before deciding whether an action can run again.
An approval authorizes the intended operation, not every future retry. See Approval requests and decisions and Agent recovery.