You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Python: [Bug]: The current implementation of AG-UI fails to pass the state to AgentSession. #5197
The current implementation of AG-UI fails to pass the state to AgentSession.
Since MAF's ContextProvider relies on state to transmit valid information, this prevents additional information from being passed to the ContextProvider.
For example: I want to pass information such as agent_id, user_id, and tenant_id to the HistoryProvider (which inherits from ContextProvider).
However, these values cannot be effectively passed to the HistoryProvider when the frontend uses the AG-UI protocol.
Alternatively, you may have a robust mechanism for passing information to the ContextProvider but lack corresponding examples.
Based on my review of the source code, it seems that this requirement cannot be fulfilled at present.
🤖 Automated triage reproduction notes(agent-authored — trust but verify)
Agent analysis
Repro: run_agent_stream() in packages/ag-ui/agent_framework_ag_ui/_agent_run.py creates AgentSession (lines 954-959) without populating session.state from the resolved flow.current_state (line 890-896). ContextProvider.before_run(state=...) receives session.state which is always empty {}. Minimal repro: call AgentFrameworkAgent.run(input_data) where input_data includes a "state" dict and assert the StubAgent's last_session.state contains those keys — it will be empty.
Activity
github-actions commentedon Jul 7, 2026
🤖 Automated triage reproduction notes (agent-authored — trust but verify)
Agent analysis
Repro: run_agent_stream() in packages/ag-ui/agent_framework_ag_ui/_agent_run.py creates AgentSession (lines 954-959) without populating session.state from the resolved flow.current_state (line 890-896). ContextProvider.before_run(state=...) receives session.state which is always empty {}. Minimal repro: call AgentFrameworkAgent.run(input_data) where input_data includes a "state" dict and assert the StubAgent's last_session.state contains those keys — it will be empty.
python/packages/ag-ui/tests/ag_ui/test_state_not_passed_to_session.py1.0.0b2604021.0.0rc7