-
Notifications
You must be signed in to change notification settings - Fork 56
summary: fix session events not in user->assistant order after summary #759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (70.00000%) is below the target coverage (85.00000%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #759 +/- ##
===================================================
- Coverage 87.63538% 87.62475% -0.01063%
===================================================
Files 281 281
Lines 36564 36573 +9
===================================================
+ Hits 32043 32047 +4
- Misses 2937 2940 +3
- Partials 1584 1586 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
|
||
| // Trigger summarization immediately after appending a qualifying event. | ||
| // Trigger summarization only after final assistant responses. | ||
| // Skip user messages, tool calls, and tool results to ensure summary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里应该还有遗漏, !event.IsValidContent() 的也需要排除掉。有一种情况是event中仅带deltaState
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
诶,这里前面的shouldPersistEvent 判定应该能挡住
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
诶,这里前面的shouldPersistEvent 判定应该能挡住
仅带deltaState时 !event.IsValidContent() == true, 拦不住
| messages = p.getIncrementMessages(invocation, summaryUpdatedAt) | ||
| // When summary is present, ensure messages start with user role to comply with API requirements. | ||
| if !summaryUpdatedAt.IsZero() { | ||
| messages = p.trimLeadingNonUserMessages(messages) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里可能会有问题。假如第一个agent 执行完后 触发了summary,第二个agent 执行时是不是大概率就都拿不到增量消息了,包括第二个agent在本轮迭代中自己生成的tool相关的消息
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
感觉这里不应该是截断,而是在没有userMessage时 强制将 invocation.Message插入进来
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
欸,没太理解,现在summary应该是绑定的runner,runner执行执行结束的时候触发吧,应该不会在第一个agent执行之后触发?你说的是graph的场景吗
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
欸,没太理解,现在summary应该是绑定的runner,runner执行执行结束的时候触发吧,应该不会在第一个agent执行之后触发?你说的是graph的场景吗
并不是runner结束时触发哦, 执行过程中也可以触发的。 只是你这一版改成了单个agent执行结束后才触发。 multiagent模式下,就会出现上面提到的这个问题。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"假如第一个agent 执行完后 触发了summary,第二个agent 执行时拿不到增量消息",我理解还是能拿到的吧,如果是顺序执行的话,updatetime绑定的是用于summary的最后一个event,增量event理论上没啥影响
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
第一个agent触发summary后, 第二个agent拿到的增量里是不是就不会包含userMessage了,在经过trimLeadingNonUserMessages处理,返回的就是nil了。
No description provided.