feat(agent-eval):添加可选轨迹摘要#803
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a lightweight tool-call trajectory summary feature for agent evaluation runs, including schema updates, helper functions to parse stream events, and comprehensive unit tests. The review feedback highlights a logical bug in generating fallback keys for tool calls without IDs, a potential string conversion issue where missing sequence IDs could output "None" instead of null, and a fault tolerance concern where a failure in loading the optional trajectory summary could crash the entire evaluation API.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
3fb06e5 to
78454bb
Compare
|
这个计数重复的问题,你看一下是否存在:
Every real interrupt (
The parser increments once on the first event (the by claude code 然后是函数出现的顺序,修改为符合从上到下的顺序,而不是先声明后使用的倒序,方便阅读。代码可以做进一步的简化,并添加 docstring(中文) |
|
测试一下 @codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
已修改,请查看 |
变更描述
Problem
Agent eval run 当前会返回最终结果和
langfuse_trace_id,但调用方无法在 API 响应中快速看到本次评估的工具调用概况,例如调用了多少工具、哪些工具出错、是否发生人工中断。维护者建议先通过 Langfuse 查看详细链路,因此本 PR 不替代 Langfuse,只补充一个轻量摘要入口。Solution
在 agent eval 创建接口中新增可选参数
include_trajectory_summary,默认保持false。当调用方显式开启时,服务从现有 run stream events 中读取最多 500 条事件,生成轻量trajectory_summary,并在可用时关联已有langfuse_trace_id,方便 API 调用方快速定位工具调用概况,详细轨迹仍可继续在 Langfuse 中查看。变更类型
Changes
AgentEvalRunCreate新增include_trajectory_summary可选字段,默认不改变现有返回。run_agent_eval支持按需附加trajectory_summary。langfuse_trace_id测试
相关日志或者截图
Notes for Reviewer
include_trajectory_summary默认为false,用于避免改变现有 agent eval API 的默认响应结构。TRAJECTORY_SUMMARY_EVENT_LIMIT当前设为 500,用于控制响应构建成本;详细 trace 仍建议通过 Langfuse 查看。说明
Related discussion: #796