Immutable solution version
[Bug]: WorkflowRuntimeError: Error in step 'run_agent_step': cannot access local variable 'r' where it is not associated
Complete solution
LlamaIndex: Collaborator logan-markewich reproduced the multi-agent ReAct bug: the workflow crashed when the LLM streamed zero data in run_agent_step. Confirmed as a real framework bug, fixed via PR and released in llama-index-core==0.12.14 - fix is pip install -U llama-index-core.
When it applies
Not specified by the original author.
Instructions
The problem
Issue run-llama/llamaindex#17629 (closed, 17 comments): ### Bug Description I am trying to use a Multi-Agent workflow using AgentWorkflow, and I get this error as soon the second agent is called. I get the same error by running the code example from: https://github.com/run-llama/llamaindex/blob/main/docs/docs/examples/agent/agentworkflowmulti.ipynb `async def test(): handler = agentworkflow.run( usermsg="Write me a report on the history of the internet. Briefly describe the history of the internet, including the development of the internet, the development of the web, and the development of the internet in the 21st century." ) await handler im
The verified fix
Collaborator logan-markewich reproduced the multi-agent ReAct bug: the workflow crashed when the LLM streamed zero data in runagentstep. Confirmed as a real framework bug, fixed via PR and released in llama-index-core==0.12.14 - fix is pip install -U llama-index-core. Workarounds if pinned: use FunctionAgent instead of ReAct agents, and for Anthropic set max_tokens high (their API behaves oddly when responses hit the limit). Reporter rasphlat confirmed: 'my Multi-Agent Workflow is finally working.'
Evidence
In gh:run-llama/llamaindex#17629 (https://github.com/run-llama/llamaindex/issues/17629), someone reported: Issue run-llama/llamaindex#17629 (closed, 17 comments): ### Bug Description I am trying to use a Multi-Agent workflow using AgentWorkflow, and I get this error as soon the second agent is called. I get the same error by running the code example from: https://github.com/run-llama/llamaindex/blob/main/docs/docs/examples/agent/agentworkflowmulti.ipynb `async def test(): handler = agentworkflow.run( usermsg="Write me a report on the history of the internet. Briefly describe the history of the internet, including the development of the internet, the development of the web, and the development of the internet in the 21st century." ) await handler im The verified resolution from the thread: Collaborator logan-markewich reproduced the multi-agent ReAct bug: the workflow crashed when the LLM streamed zero data in runagentstep. Confirmed as a real framework bug, fixed via PR and released in llama-index-core==0.12.14 - fix is pip install -U llama-index-core. Workarounds if pinned: use FunctionAgent instead of ReAct agents, and for Anthropic set max_tokens high (their API behaves oddly when responses hit the limit). Reporter rasphlat confirmed: 'my Multi-Agent Workflow is finally working.'
By @issueatlas · Version 1 · Exact version
Maintainer review
Checking maintainer review for this exact version…
A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_TSxYdyKP8mCrX2ctFNrk1w" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">[Bug]: WorkflowRuntimeError: Error in step 'run_agent_step': cannot access local variable 'r' where it is not associated <span>— Vectle</span></a>