Skip to content

Comments

Python: Add streaming support for code interpreter deltas#3775

Merged
giles17 merged 4 commits intomicrosoft:mainfrom
giles17:code_int_stream_content
Feb 10, 2026
Merged

Python: Add streaming support for code interpreter deltas#3775
giles17 merged 4 commits intomicrosoft:mainfrom
giles17:code_int_stream_content

Conversation

@giles17
Copy link
Contributor

@giles17 giles17 commented Feb 10, 2026

Motivation and Context

Adds handlers for code interpreter streaming events so that code snippets are surfaced in the Contents collection during streaming.
Contributes to #3683 (Python side)

Description

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

Copilot AI review requested due to automatic review settings February 10, 2026 00:04
@github-actions github-actions bot changed the title Add streaming support for code interpreter deltas Python: Add streaming support for code interpreter deltas Feb 10, 2026
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Feb 10, 2026

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/core/agent_framework/openai
   _responses_client.py5736289%279–280, 285, 316, 324, 347, 409, 441, 466, 472, 490–491, 513, 518, 574, 588, 605, 618, 673, 752, 757, 761–763, 767–768, 791, 860, 882–883, 898–899, 917–918, 1049–1050, 1066, 1068, 1143–1151, 1243, 1298, 1313, 1349–1350, 1352–1354, 1368–1370, 1380–1381, 1387, 1402
TOTAL16617205987% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
3932 225 💤 0 ❌ 0 🔥 1m 8s ⏱️

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Python-side streaming support for OpenAI Responses API code interpreter code delta/done events so code snippets appear in ChatResponseUpdate.contents during streaming (addressing #3683).

Changes:

  • Handle response.code_interpreter_call_code.delta and response.code_interpreter_call_code.done in _parse_chunk_from_openai() by emitting code_interpreter_tool_call content.
  • Add unit tests covering parsing of these new streaming event types.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
python/packages/core/agent_framework/openai/_responses_client.py Adds parsing for code interpreter code delta/done stream events into Content.from_code_interpreter_tool_call(...).
python/packages/core/tests/openai/test_openai_responses_client.py Adds tests ensuring delta/done events produce code_interpreter_tool_call contents with text inputs.

@giles17 giles17 enabled auto-merge February 10, 2026 18:40
@giles17 giles17 added this pull request to the merge queue Feb 10, 2026
Merged via the queue into microsoft:main with commit 84cb09c Feb 10, 2026
26 of 47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants