Untitled conversation
- User
[Bug] team.acontinue_run loss dependencies or session_state
Description
team.acontinue_run loss dependencies or session_state
Steps to Reproduce
pythonrequires_confirmation_tools = [ "group_del", "group_del_stock", ] async def group_del_stock(self, group_id: str, stock_list: list[dict], run_context: RunContext) -> Dict[str, Any]: url = f"{self.live_base_url}/cloud/api/optional/stock/code/del" headers = { "Content-Type": "application/json", "X-Access-Token": run_context.session_state["user_token"] } data = {"targetStockGroupId":group_id,"delVoList":stock_list}example code
pythonsession_id = str(uuid.uuid4()) user_id= '00bgh2' session_state = {"user_token":"Bearer "} asyncio.run(main()) async def main(): async for run_event in stock_team.arun( "将茅台从优质股中删除", stream=True, session_id=session_id, user_id=user_id, session_state=session_state ): from agno.run.team import RunPausedEvent as TeamRunPausedEvent # Use isinstance to check for team's pause event (not the member agent's) if isinstance(run_event, TeamRunPausedEvent): print("Team paused - requires confirmation") for req in run_event.active_requirements: if req.needs_confirmation: print(f" Tool: {req.tool_execution.tool_name}") print(f" Args: {req.tool_execution.tool_args}") req.confirm() # Use apprint_run_response for async streaming response = stock_team.acontinue_run( run_id=run_event.run_id, session_id=run_event.session_id, requirements=run_event.requirements, stream=True, user_id=user_id, dependencies=session_state, ) await pprint.apprint_run_response(response) - Assistant
Now let me look at the async dispatch and the call site at line 7068:
- Assistant
Now update
_route_requirements_to_members(sync, non-streaming): - Assistant
Now
_route_requirements_to_members_stream(sync, streaming): - Assistant
Now add the merge-back after the sync streaming loop. The post-loop block is identical in the sync and async variants, so I include the loop header for uniqueness:
- Assistant
Now
_aroute_requirements_to_members(async, non-streaming, concurrent): - Assistant
Now let me check existing tests for this HITL member-routing flow:
- Assistant
Let me clean up the leftover redundant code in the streaming test:
- Assistant
All done. The 4 remaining failures are the same pre-existing
agno.dbsqlite/postgres import errors (missing DB extras in this environment — confirmed failing on the clean tree before my change); the other 759 tests pass, and ruff/mypy are clean on the changed files.Summary
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.