-
Notifications
You must be signed in to change notification settings - Fork 502
Labels
Description
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 phaseExpected behavior
AI provides explanation → 2. Tool execution → 3. AI provides summary