Skip to content

fix: skip degraded tool record when a detailed record exists - #7153

Open
iuiu-py wants to merge 1 commit into
1Panel-dev:v2from
iuiu-py:fix/duplicate-tool-record
Open

iuiu-py wants to merge 1 commit into
1Panel-dev:v2from
iuiu-py:fix/duplicate-tool-record

Conversation

@iuiu-py

@iuiu-py iuiu-py commented Sep 22, 2026

Copy link
Copy Markdown

问题

修复

  • save_tool_record 先查询同一 (tool_id, source_id, source_type) 下是否已存在带 details 的完整记录,存在则跳过降级落库,消除重复记录;后置处理器未落库的场景(如调试模式仅写缓存)行为不变。

Fixes #7053

Workflow and function tools already persist a detailed ToolRecord through
their post-handlers when execution finishes; the agent stream then wrote a
second degraded record (JSON-string input, no execution details) for the
same execution from the ToolMessage branch, producing duplicate entries in
the tool execution list (issue 1Panel-dev#7053).

Skip the degraded insert when a detailed record already exists for this
tool/source pair.

Fixes 1Panel-dev#7053

Signed-off-by: wangzifei <wangzifei@cit.group.hk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] 工作流工具的执行记录,重复保存了,且重复保存的那条数据还有问题

1 participant