-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Python: Clear stale service session on full-history replay #7354
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -202,9 +202,14 @@ async def run( | |
| ) -> None: | ||
| """Handle an AgentExecutorRequest (canonical input). | ||
|
|
||
| This is the standard path: extend cache with provided messages; if should_respond | ||
| run the agent and emit an AgentExecutorResponse downstream. | ||
| This is the standard path: extend cache with provided messages; if should_respond, | ||
| run the agent and emit an AgentExecutorResponse downstream. When the request | ||
| replays function-call history, clear the service session because those messages | ||
| provide the continuation context explicitly. | ||
| """ | ||
| if any(content.type == "function_call" for message in request.messages for content in message.contents): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should full-history handling be shared with the other explicit-message handlers? |
||
| self._session.service_session_id = None | ||
|
Comment on lines
+210
to
+211
|
||
|
|
||
| self._cache.extend(request.messages) | ||
|
|
||
| if request.should_respond: | ||
|
|
||
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.
Could we avoid using the mere presence of a
function_callas the full-history signal? Group-chat orchestrators broadcast each participant's response to every other agent asAgentExecutorRequest(..., should_respond=False)at_base_group_chat_orchestrator.py:433-436, and completed tool turns include their function calls. This therefore clears every receiving participant's valid service continuation after any tool-using turn, so its next turn loses server-held history and reasoning-model histories can fail stateless replay.