Description
AgentExecutor keeps session.service_session_id when a downstream executor is invoked with a replayed full conversation (including prior function-call/tool-result items).
This can cause provider calls to include both:
- a server-side continuation pointer (
previous_response_id via service_session_id), and
- the same historical items explicitly in input.
Expected behavior: when full conversation is explicitly replayed to an agent executor, service_session_id should be cleared/reset before agent.run(...).
Steps To Reproduce
- Run:
pytest packages/core/tests/workflow/test_full_conversation.py::test_run_request_with_full_history_clears_service_session_id --runxfail -q
- Observe assertion failure that the downstream spy agent still sees
resp_PREVIOUS_RUN.
Code Sample
# Existing repro in repo:
# packages/core/tests/workflow/test_full_conversation.py
# test_run_request_with_full_history_clears_service_session_id
Error Messages / Stack Traces
E AssertionError: assert 'resp_PREVIOUS_RUN' is None
E + where 'resp_PREVIOUS_RUN' = <...>._captured_service_session_id
Package Versions
- agent-framework-core:
1.0.0rc2
- agent-framework-orchestrations:
1.0.0b260225
- Source commit tested:
02ba27493 (main)
Python Version
Python 3.13.5
Additional Context
Likely area:
packages/core/agent_framework/_workflows/_agent_executor.py (from_response, _run_agent*)
Related xfail note in test references issue #4047.
Description
AgentExecutorkeepssession.service_session_idwhen a downstream executor is invoked with a replayed full conversation (including prior function-call/tool-result items).This can cause provider calls to include both:
previous_response_idviaservice_session_id), andExpected behavior: when full conversation is explicitly replayed to an agent executor,
service_session_idshould be cleared/reset beforeagent.run(...).Steps To Reproduce
resp_PREVIOUS_RUN.Code Sample
Error Messages / Stack Traces
Package Versions
1.0.0rc21.0.0b26022502ba27493(main)Python Version
Python 3.13.5Additional Context
Likely area:
packages/core/agent_framework/_workflows/_agent_executor.py(from_response,_run_agent*)Related xfail note in test references issue
#4047.