FastGPT icon indicating copy to clipboard operation
FastGPT copied to clipboard

fix: respect json structure while truncating tool call strings

Open zly2006 opened this issue 1 month ago • 10 comments

zly2006 avatar Oct 14 '25 11:10 zly2006

TestGru Assignment

Summary

Link CommitId Status Reason
Detail f79cbd514095af9c7d3deffd0b8fb501130bf799 🚫 Skipped No files need to be tested {"packages/global/common/string/tools.ts":"File path does not match include patterns.","packages/service/core/workflow/dispatch/ai/agent/toolCall.ts":"File path does not match include patterns."}

History Assignment

[!TIP] You can @gru-agent and leave your feedback. TestGru will make adjustments based on your input

gru-agent[bot] avatar Oct 14 '25 11:10 gru-agent[bot]

CLA assistant check
All committers have signed the CLA.

cla-assistant[bot] avatar Oct 14 '25 11:10 cla-assistant[bot]

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

cla-assistant[bot] avatar Oct 14 '25 11:10 cla-assistant[bot]

Preview sandbox Image:

registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-pr:fatsgpt_sandbox_f8379e556f56987720ac90941b4975de78c0f4ce

github-actions[bot] avatar Oct 14 '25 11:10 github-actions[bot]

Preview mcp_server Image:

registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-pr:fatsgpt_mcp_server_f8379e556f56987720ac90941b4975de78c0f4ce

github-actions[bot] avatar Oct 14 '25 11:10 github-actions[bot]

这是啥需求

c121914yu avatar Oct 20 '25 09:10 c121914yu

这是啥需求

在event: toolCallResponse的返回结果中,data: 后面的内容本来应该是一个合法的json,但是由于这个截断的处理逻辑太武断了,破坏了json结构。本PR的目的在于不破坏json结构的情况下裁剪数据至目标大小。

zly2006 avatar Oct 20 '25 09:10 zly2006

Docs Preview:


🚀 FastGPT Document Preview Ready!

🔗 👀 Click here to visit preview

github-actions[bot] avatar Oct 20 '25 09:10 github-actions[bot]

Preview fastgpt Image:

registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-pr:fatsgpt_f8379e556f56987720ac90941b4975de78c0f4ce

github-actions[bot] avatar Oct 20 '25 09:10 github-actions[bot]

这是啥需求

在event: toolCallResponse的返回结果中,data: 后面的内容本来应该是一个合法的json,但是由于这个截断的处理逻辑太武断了,破坏了json结构。本PR的目的在于不破坏json结构的情况下裁剪数据至目标大小。

意义是什么?

c121914yu avatar Oct 21 '25 01:10 c121914yu