fix(plugin): preserve tool attachments (#27157)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user