Skip to content

Result Persistence and Rendering

Tool output 会被模型、用户、transcripts、evidence systems、artifact stores 与 telemetry 消费。这些消费方需要不同表示。

Representations

表示要求
native_output保留原生协议输出,或引用它。
model_facing_content模型收到的内容。可以 compact、redact、preview 或 reference 化。
structured_content可用时符合 output_schema 的机器可读结果。
ui_facing_renderingUI projection hints;不是 canonical output。
transcript_search_text有意进入 transcript search 索引的文本。
persisted_payload_ref大输出的 durable 或 session-scoped bytes。
artifact_refs由 Agent Artifact 拥有的 durable deliverables。
resource_refs原生协议或 resource systems 拥有的可获取资源。

Persistence decision

tool_result_persistence SHOULD 包含 decision_idinvocation_idresult_idstrategythresholdoriginal_size_bytespreview_size_bytespersisted_refredaction_statereasoncreated_at

初始 strategies:

  • inline
  • preview_and_persist
  • ref_only
  • redact
  • drop_with_reason
  • never_persist

Empty output

工具可以合法地完成但没有 native output。兼容 runtime SHOULD 发出明确的 empty-result marker 或结构化 status,避免模型和 UI 把空输出误解为缺失输出。

Circular result guard

有些工具应该 opt out of persistence。例如 read-file 工具可以通过 ranges 或 token limits 自我约束。如果把读取结果持久化成另一个文件,可能产生 read-persist-read 循环。

Draft standard for portable agent tool declarations, runtime interfaces, invocations, progress, results, permissions, scheduling, and audit refs.