docs(code-mode): clarify result content ownership

This commit is contained in:
Tianyi Cui
2026-07-21 22:03:46 +08:00
parent 089894fbce
commit 71f5015c61
3 changed files with 4 additions and 4 deletions

View File

@@ -2,5 +2,5 @@
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write
2026-07-20-code-mode-result-card-completeness.md: 1fbdbdd311f359cbe2ab505210768b2136d56067
2026-07-20-code-mode-result-card-completeness.zh.md: 619c742e6adb2dc846a9c278e78938dd8e0559b1
2026-07-20-code-mode-result-card-completeness.md: 5fce1c51dbe029f7c109dfdac55444a51f0dd886
2026-07-20-code-mode-result-card-completeness.zh.md: 624d541cea2e5b4402c880bfe00c586bda7df0ee

View File

@@ -12,7 +12,7 @@ Nested Code calls never owned cards, so producing metadata for the outer call so
## Decision
The `run_code` output renderer remains the single owner of model-facing outer content. It renders captured logs followed by the return value, the explicit no-output marker, or the failure content produced by the canonical tool pipeline. Post-execute policy and spill may replace that content before it is persisted.
The canonical tool registry pipeline owns the final model-facing outer content. On success, the `run_code` output renderer renders captured logs followed by the return value or the explicit no-output marker. Runtime failures and policy denials are normalized into error content by `ToolRegistry` without invoking that renderer. Post-execute policy and spill may replace content before persistence.
`run_code.presentResult` now forwards the final `result.content` into one generic result card. It deliberately omits the title so the pending card retains the program text. The redundant logs-only `presentationMeta` projection is removed: `tool/result.content` is the durable, replayable, post-policy projection and the card's only result-content source.

View File

@@ -12,7 +12,7 @@ Status: implemented
## 决策
`run_code` 输出渲染器继续作为面向模型的外层内容的唯一所有者。它先渲染已捕获的日志,然后渲染返回值显式的无输出标记,或规范工具流水线生成的失败内容。Post-execute 策略与输出落盘机制可以在内容持久化之前替换
规范的工具注册表流水线负责最终面向模型的外层内容。成功时,`run_code` 输出渲染器先渲染已捕获的日志,然后渲染返回值显式的无输出标记。运行时失败和策略拒绝由 `ToolRegistry` 归一化为错误内容,过程中不会调用该渲染器。Post-execute 策略与输出落盘机制可以在持久化之前替换这些内容
`run_code.presentResult` 会把最终的 `result.content` 转交给一张通用结果卡片。它有意省略标题,使待完成卡片保留程序文本。多余的仅含日志的 `presentationMeta` 投影被移除:`tool/result.content` 是持久、可回放且经过 post-policy 处理的投影,也是卡片中结果内容的唯一来源。