From bb5588c0044cfe710b7c92754ea632c2ce5eceaa Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 16 Sep 2025 08:08:44 +0000 Subject: [PATCH 1/2] Initial plan From d3f9d61e1ab5eb96574ec08718ee6fcf0d3745e9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 16 Sep 2025 08:18:46 +0000 Subject: [PATCH 2/2] Fix spurious tags caused by empty string reasoning_content Co-authored-by: ekzhu <320302+ekzhu@users.noreply.github.com> --- .../src/autogen_ext/models/openai/_openai_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/packages/autogen-ext/src/autogen_ext/models/openai/_openai_client.py b/python/packages/autogen-ext/src/autogen_ext/models/openai/_openai_client.py index 359ddfe6c8d2..2cbb235cefa3 100644 --- a/python/packages/autogen-ext/src/autogen_ext/models/openai/_openai_client.py +++ b/python/packages/autogen-ext/src/autogen_ext/models/openai/_openai_client.py @@ -947,8 +947,8 @@ async def create_stream( is_reasoning = True thought_deltas.append(reasoning_content) yield reasoning_content - elif is_reasoning: - # Exit reasoning mode. + elif reasoning_content is None and is_reasoning: + # Exit reasoning mode only when reasoning_content is None (not when it's an empty string). reasoning_content = "" thought_deltas.append(reasoning_content) is_reasoning = False