发布

  • feat(agent): expose run metadata + structured guardrail reasons to tool wrappers (#2981)

    frostbyte_neo 发布于 2026-06-19 07:09:22 +00:00 | 816 次提交 在此版本后已推送到 master

    Closes the remaining ask in #2980 without adding a parallel callback API.
    ToolResult.Refused tags a guardrail block with a reason (ai.RefusedLoop /
    RefusedMaxSteps / RefusedApproval) so a wrapper can switch on it instead of
    parsing the message. ai.RunInfo (RunID, ParentID, Agent) rides on the
    context passed to the tool handler, giving wrappers run correlation and
    delegation lineage. Before/after/retry/failure were already covered by
    AgentWrapTool; this adds the metadata. Docs + tests included.

    Co-authored-by: Claude noreply@anthropic.com

    下载附件