fix(tools): avoid duplicate run_code result views

This commit is contained in:
Tianyi Cui
2026-07-23 04:08:27 +08:00
parent ff96387924
commit 43a2c0a0af
3 changed files with 56 additions and 31 deletions
+3 -5
View File
@@ -370,10 +370,8 @@ export function createRunCodeTool(registry: ToolRegistry, requireRuntime: () =>
kind: 'execute',
rawInput: args.code,
}),
// Title omitted on the result: an update replaces only the fields it
// carries, so the pending card's program title persists through
// completion. The durable final content already includes logs plus the
// return value, failure, or post-policy spill preview.
presentResult: (_args, result) => ({ card: 'generic', content: result.content }),
// Deliberately no presentResult: the generic surface fallback keeps this
// title and reads durable result content without duplicating a large raw
// result into the host view payload.
})
}