fix(plugin): preserve tool attachments (#27157)

This commit is contained in:
Aiden Cline
2026-05-12 16:23:15 -05:00
committed by GitHub
parent 159964b172
commit cb511f78ff
3 changed files with 68 additions and 2 deletions

View File

@@ -160,11 +160,13 @@ export const layer: Layer.Layer<
const result = yield* Effect.promise(() => def.execute(args as any, pluginCtx))
const output = typeof result === "string" ? result : result.output
const metadata = typeof result === "string" ? {} : (result.metadata ?? {})
const attachments = typeof result === "string" ? undefined : result.attachments
const info = yield* agent.get(toolCtx.agent)
const out = yield* truncate.output(output, {}, info)
return {
title: "",
title: typeof result === "string" ? "" : (result.title ?? ""),
output: out.truncated ? out.content : output,
attachments,
metadata: {
...metadata,
truncated: out.truncated,