From 9ba61b3d3e994b7fccbaad76a01c9911b054f517 Mon Sep 17 00:00:00 2001 From: yiling Date: Wed, 29 Jul 2026 17:15:12 +0800 Subject: [PATCH] refactor(agent): simplify download_asset prompt instruction in prompt builder --- packages/agent/src/workflows/agent-chat-prompt-builder.test.ts | 3 +-- packages/agent/src/workflows/agent-chat-prompt-builder.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/agent/src/workflows/agent-chat-prompt-builder.test.ts b/packages/agent/src/workflows/agent-chat-prompt-builder.test.ts index 452ddc73..ff0a2b14 100644 --- a/packages/agent/src/workflows/agent-chat-prompt-builder.test.ts +++ b/packages/agent/src/workflows/agent-chat-prompt-builder.test.ts @@ -166,7 +166,6 @@ describe('AgentChatPromptBuilder', () => { const builder = new AgentChatPromptBuilder('a1') const result = builder.build() - expect(result).toContain("call the 'download_asset' tool with assetId") - expect(result).toContain('remember to delete the temporary downloaded file.') + expect(result).toContain("call the 'download_asset' tool with assetId.") }) }) diff --git a/packages/agent/src/workflows/agent-chat-prompt-builder.ts b/packages/agent/src/workflows/agent-chat-prompt-builder.ts index f37b77e8..e7b44dab 100644 --- a/packages/agent/src/workflows/agent-chat-prompt-builder.ts +++ b/packages/agent/src/workflows/agent-chat-prompt-builder.ts @@ -174,7 +174,7 @@ export class AgentChatPromptBuilder { } } - instruction += `\n\nIf you need a local file on disk to run bash commands or scripts (e.g. processing or combining assets), call the 'download_asset' tool with assetId. After finishing the job, remember to delete the temporary downloaded file.` + instruction += `\n\nIf you need a local file on disk to run bash commands or scripts (e.g. processing or combining assets), call the 'download_asset' tool with assetId.` if (this.userInfo) { instruction += `\n\nUser Info:\nName: ${this.userInfo.name}\nRole: ${this.userInfo.role}`