Skip to content

Stream terminates after tool execution with explanatory text #61

@meganetaaan

Description

@meganetaaan

Describe the bug

When an agent is instructed to provide explanatory text before tool execution (e.g., "I'll check the weather for you..."), the stream terminates immediately after tool execution instead of continuing to allow post-tool responses, even with toolUseBehavior: 'run_llm_again'.

Debug information

  • Agents SDK version: 0.0.1
  • Runtime environment (e.g. Node.js 22.16.0)

Repro steps

const agent = new Agent({
  name: 'Weather Agent',
  instructions: 'When asked about weather, first explain what you will check, then use the tool, and finally summarize the results.',
  tools: [weatherTool],
  toolUseBehavior: 'run_llm_again',
});

const stream = await runner.run(agent, 'What is the weather in Tokyo?', { stream: true });
// Stream terminates after tool execution - never reaches summary phase

Expected behavior

AI provides explanation → 2. Tool execution → 3. AI provides summary

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions