Skip to content

fix(tools): preserve invocation ID for merged parallel responses - #342

Merged
weimch merged 1 commit into
mainfrom
fix/event_invocation_id
Sep 22, 2026
Merged

weimch merged 1 commit into
mainfrom
fix/event_invocation_id

Conversation

@raychen911

Copy link
Copy Markdown
Contributor
  • inherit invocation_id from the base function response event
  • prevent merged responses from being filtered in INVOCATION mode
  • add regression coverage for parallel response merging

- inherit invocation_id from the base function response event
- prevent merged responses from being filtered in INVOCATION mode
- add regression coverage for parallel response merging
@helloopenworld

Copy link
Copy Markdown
Contributor

AI Code Review

审查结论

通过

审查范围:b6fc4f3..7012913,共 2 个文件(_tools_processor.py 1 行行为变更 + 测试文件新增 53 行)。变更将并行工具响应合并事件的 invocation_id 从随机 UUID 改为继承 base event,目标是在 TimelineFilterMode.INVOCATION 下保留合并事件、修复随机 id 导致的事件被过滤问题。经追踪完整调用链验证:该 id 始终等于 ctx.invocation_id(__invoke_tools 的成功/失败路径均以 ctx.invocation_id 构造事件;runner/llm_agent/session 持久化、cancel 清理、memory/compact 服务等消费方均从 ctx 取 id,不依赖事件自身 id),author/branch 与 id 同源无错配;EventActions 为合并中新构造对象,state_delta 逐项复制;行为收敛正确且无跨调用方破坏。测试充分:新增 merged id 断言与 INVOCATION 过滤回归测试,均命中修复根因。未发现由该变更引入的可操作缺陷,门禁结论为通过。

发现的问题

未发现需要反馈的代码问题。

@weimch weimch left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve

@weimch
weimch merged commit c83765b into main Sep 22, 2026
5 checks passed
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.

3 participants