Skip to content

Code Executor Output Not Available in Next React Round #4203

@liuzengh

Description

@liuzengh

Problem Description

When using the built-in React multi-round flow in adk-python with the /*ACTION*/ - /*REASONING*/ pattern, the next round cannot access the output results from the code executor in the previous round.

Root Cause Analysis

The current code executor is designed as a processor. This means it functions similarly to an insertion point that:

  1. Extracts code snippets from the LLM's message response
  2. Executes the code
  3. Appends the execution results to the end of the message response

In the React mode:

  • /*ACTION*/ represents tool calls, where results are fed back to the LLM
  • However, the current code executor is not implemented as a tool call
  • Therefore, its results are not automatically fed back to the LLM

Impact

Since the code executor results are not passed back to the LLM, the subsequent round's /*REASONING*/ or /*FINAL_ANSWER*/ stages cannot access the execution output.

Proposed Solution

Either:

  1. Refactor the code executor to work as a tool call so its results are automatically fed back to the LLM
  2. Modify the processor logic to explicitly inject code executor results into the context for the next round

Metadata

Metadata

Assignees

Labels

tools[Component] This issue is related to tools

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions