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
@@ -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.