fix(tools): preserve complete bounded presentations

This commit is contained in:
Tianyi Cui
2026-07-22 00:55:59 +08:00
parent 0dfd9545a6
commit 63d48593cc
9 changed files with 52 additions and 23 deletions

View File

@@ -26,10 +26,11 @@
* failure ⇒ log and return the original result. A spill failure must NEVER
* turn a successful tool call into an `isError` or hide the inline result.
*
* It COMPOSES with other post-execute listeners: it delegates via `next()` and
* bounds the resulting content projection, so a hook that replaced content
* still has its replacement bounded, while value replacements and `block`
* decisions pass through unchanged.
* It COMPOSES with other post-execute listeners: its prepended listener
* delegates via `next()` and bounds the resulting content projection, so
* tool-owned asynchronous projection runs before generic bounding, a hook that
* replaced content still has its replacement bounded, and value replacements
* and `block` decisions pass through unchanged.
*
* @module @deepseek-ai/dsh-spill-policy
*/
@@ -176,5 +177,5 @@ export function apply(ctx: Context, config: Config): void {
}
const replaced: ContentBlock[] = [{ type: 'text', text: replacedText }]
return { kind: 'accept', content: replaced, ...decision.additionalContexts ? { additionalContexts: decision.additionalContexts } : {} }
})
}, { prepend: true })
}