Skip to contents

When a run pauses at an approval-gated tool, it surfaces a checkpoint (the checkpoint field of the llmragent_pending_approval condition, or the object returned by human_gate() in batch mode). Inspect checkpoint$pending (the tool name, the parsed arguments, the argument text as the model sent it, and an argument hash), or print the checkpoint, then record a decision with this function and continue with resume_run().

Usage

approve_tool_call(
  checkpoint,
  decision = c("approve", "reject", "edit"),
  edit = NULL
)

Arguments

checkpoint

A llmragent_checkpoint.

decision

"approve" (run the tool as requested), "reject" (skip it; the model is told the call was denied), or "edit" (run it with edit-modified arguments).

edit

For decision = "edit", the replacement argument list.

Value

The checkpoint with the decision recorded.

Details

The loop never pauses for a call whose arguments are not a JSON object; it returns an error result to the model instead, as LLMR::call_llm_tools() does. A checkpoint saved by an earlier version can still hold such a call. Approving it is an error, since the tool would run without the arguments the model meant to send; reject it, or supply the arguments with decision = "edit".