pendingOf — read a suspension off a result
Elixir · package toolnexus · SPEC §10
Detect that a RunResult is parked rather than finished, and get the Request that parked it.
What to use instead
Section titled “What to use instead”Two calls cover it. Toolnexus.ToolResult.pending?/1 tells you a result is a suspension;
matching metadata.pending directly gets you the Request:
alias Toolnexus.{ToolResult, Request}
case result do %ToolResult{metadata: %{pending: %Request{} = req}} -> req _ -> nilendAt the RunResult level, Toolnexus.Client.run/4 already surfaces this without a helper:
result.status == "pending" and result.pending is the Request directly (no reader call
needed — see Client.run).
See also
Section titled “See also”Toolnexus.Client.create— The single hook where the host resolves a suspension — in-process prompt or durable queue, same contract.Toolnexus.Agents.Runtime.resume— The answer-carrying entry point: resume a parked run in a different process.