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
I’ll trace the async continuation and requirement-routing paths, compare them with the sync implementation, then patch the context restoration and add a focused regression test.
- Assistant
rgisn’t installed in this workspace, so I’m using targetedgrep/file inspection instead. The worktree appears clean; I’m also checking for a relevant design note before editing, per the repository instructions. - Assistant
The failure is confirmed: member continuations receive only the session ID. The original delegated run receives a copied team session state plus dependencies, but the continuation drops both. I’m implementing a member-specific continuation context (to avoid corrupting the team run ID), forwarding the user ID, and merging any member state changes back into the team context.
- Assistant
The regression coverage is in place for both async continuation modes. The documented
.venvis absent, so I’m checking the available local Python environment and will run the narrowest viable test/validation commands without installing anything externally. - Assistant
Both new async regression tests pass, and the full continuation-requirements unit file is green (51 tests). I’m now running the repository’s required formatter and validator, then I’ll inspect the final diff for unintended changes.
- Assistant
Formatting touched several pre-existing style outliers outside this fix; I restored those files so the final change remains scoped. Validation is still running.
- Assistant
The focused suite remains green after formatting, and targeted mypy now passes for the changed implementation. Full validation’s Ruff checks passed; repository-wide mypy still reports six unrelated pre-existing HTTP typing errors in other modules, while the changed file has no type errors.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.