pub struct PreparedApproval {
pub awaiting: Vec<ToolCallPayload>,
pub rejected: Vec<ToolResultPayload>,
pub unknown_decisions: Vec<UnknownDecision>,
}Expand description
The hook-prepared work an approval pause checkpoints: the hook has already filtered / rejected / rewritten the model-emitted batch, and those decisions cannot be re-derived on resume — they are saved, not re-run. The original payloads remain derivable from the committed tool-call blocks (fact identity); the independent rewrite and rejections live here as serializable data.
The checkpoint stores recorded results plus the unknown-outcome actions
fixed at pause time, not result envelopes: a tool’s recorded result is
a fact, and what an UnknownOutcome result does next is harness
configuration. unknown_decisions
must exactly cover the saved results whose status is UnknownOutcome
— no extra, missing, or duplicate entries — and a resume may never
recompute them through new configuration.
§Wire compatibility
rejected is written as [{result, policy}] through a private runtime
DTO — the policy is the fixed decision for UnknownOutcome entries and
the canonical Stop for every other status (whose policy never
participated in execution). Deserialization reads the same shape (both
fields required), drops the policy of non-unknown entries, and rejects
any decision set that does not exactly cover the saved UnknownOutcome
results; earlier formats without prepared work still fail loudly.
Fields§
§awaiting: Vec<ToolCallPayload>Calls the hook admitted — arguments possibly rewritten — in model draft order. These are what still await the host’s decision at resume; the resume decision must cover them exactly once.
rejected: Vec<ToolResultPayload>Calls the hook rejected. The stored results commit verbatim at resume (with their original call ids) and can never be re-decided — a resume decision touching them is rejected before anything executes.
unknown_decisions: Vec<UnknownDecision>The unknown-outcome actions fixed when the turn paused: exactly one
entry per saved UnknownOutcome result, no more, no fewer. New
configuration never overrides these on resume.