Skip to content

Output key doesn't work with temp state scope #4564

@maheshwaritanay

Description

@maheshwaritanay

Describe the Bug:
I am running a Sequential Agent. I want to save the output of first agent as output_key with temporary scope (valid for that invocation). However, when I use the following code -
output_key='temp:output_key'
I get no value in state. I checked that that its probably due to _trim_temp_delta_state function in BaseSessionService.

Steps to Reproduce:

  1. Create a sequential agent with subagents having output keys
  2. prefix output key with temp

Expected Behavior:
For a SequentialAgent, the lifecycle of invocation starts from the first agent till the last agent. Therefore the 'temp' prefixed state should be available across the agents. But right now its available only for the start of an (sub)agent till that agent produces response.

Observed Behavior:
temp prefixed state not transferred across agents

Environment Details:

  • ADK Library Version: 1.24.1
  • Desktop OS:** MacOS
  • Python Version (python -V): 3.12

Model Information:

  • Are you using LiteLLM: Yes
  • Which model is being used: Claude 4.5

Minimal Reproduction Code:
Please provide a code snippet or a link to a Gist/repo that isolates the issue.

a1 = Agent(
    model=LiteLlm(),
    name="a2",
    static_instruction=get_instrcutions(),
    output_schema=InputData,
    output_key='temp:output_key',
)

a2 = Agent(
    model=LiteLlm(),
    name="a2",
    instruction= get_instructions,
)

workflow = SequentialAgent(
    name="workflow_agent",
    sub_agents=[a1, a2]
)

How often has this issue occurred?:

  • Always (100%)

Metadata

Metadata

Assignees

Labels

core[Component] This issue is related to the core interface and implementationneeds review[Status] The PR/issue is awaiting review from the maintainer

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions