Skip to content

Skills API: Multiple skills with streaming doesn't return message_delta/message_stop events #888

@basewakamaru

Description

@basewakamaru

When using multiple Skills with streaming enabled in the Foundry API, the stream ends prematurely without returning
message_delta and message_stop events. This prevents retrieval of the container ID and causes incomplete stream
handling.

Environment

  • SDK: @anthropic-ai/foundry-sdk
  • Platform: Microsoft Foundry
  • Model: claude-haiku-4-5
  • Stream: true
  • Betas: code-execution-2025-08-25, skills-2025-10-02

Steps to Reproduce

  1. Initialize Foundry client with 2 or more Skills in the container parameter
  2. Send a message request with stream: true
  3. Observe the stream event sequence

Expected Behavior

  • Stream should include: message_start → content_block_* events → message_delta → message_stop
  • Container ID should be available in message_delta.delta.container.id
  • All events should complete before stream ends

Actual Behavior

  • Stream ends after content_block_stop events
  • message_delta event is never received
  • message_stop event is never received
  • Stream completes without final events, leaving stream in incomplete state

Logs

Request Configuration:

{
  "model": "claude-haiku-4-5",
  "stream": true,
  "betas": ["code-execution-2025-08-25", "skills-2025-10-02"],
  "container": {
    "skills": [
      {
        "type": "anthropic",
        "skill_id": "xlsx",
        "version": "latest"
      },
      {
        "type": "anthropic",
        "skill_id": "pptx",
        "version": "latest"
      }
    ]
  }
}
Stream Event Sequence (Actual):
1. ✅ message_start (no container field)
2. ✅ content_block_start: text
3. ✅ content_block_delta: text_delta (multiple events)
4. ✅ content_block_stop
5. ✅ content_block_start: server_tool_use (first skill)
6. ✅ content_block_delta: input_json_delta (multiple events)
7. ✅ content_block_stop
8. ✅ content_block_start: server_tool_use (second skill)
9. ✅ content_block_delta: input_json_delta (multiple events)
10. ✅ content_block_stop
11. ❌ Stream ends here - message_delta and message_stop never arrive
Workaround (Non-streaming mode works):
// stream: false で実行するとコンテナIDが正常に返却される
{
  "stream": false,
  "container": {
    "id": "container_011CXbQCtRNCswtwatctJJwk",
    ...
  }
}
Additional Notes
- Single skill with streaming: ✅ Works correctly
- Multiple skills added sequentially (1st skill, then add 2nd): ✅ Works correctly (message_delta received)
- Multiple skills on initial request: ❌ message_delta never received
- Non-streaming mode with multiple skills: ✅ Container ID returned correctly
This appears to be specific to initial requests with multiple Skills using streaming mode.
Related Issues
- #842 - Streaming responses consistently interrupted mid-transmission
- liteLLM #8066 - Tool calls not working with streaming
---

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions