Skip to content

Add ReasoningSummary property to SessionConfig for BYOK reasoning text streaming #1135

Description

@vavjeeva

Problem

When using BYOK with Azure OpenAI (provider "openai", wireApi "responses"), reasoning models (e.g., gpt-5.4, o3, o4-mini) consume reasoning tokens but the thinking/reasoning text is never exposed to the SDK consumer. The AssistantReasoningDeltaEvent events are never emitted.

Root Cause

The Azure OpenAI Responses API requires the reasoning.summary parameter in the request body to expose reasoning text. Without it, the provider performs reasoning internally but returns an empty summary array.

Without reasoning.summary:

// Request
{"model":"gpt-5.4","reasoning":{"effort":"high"},"input":"Why is 2+2=4?","stream":false}

// Response — reasoning tokens consumed, but summary is empty
"output": [{ "type": "reasoning", "summary": [] }]
"usage": { "output_tokens_details": { "reasoning_tokens": 173 } }

With reasoning.summary: "auto":

// Request
{"model":"gpt-5.4","reasoning":{"effort":"high","summary":"auto"},"input":"Why is 2+2=4?","stream":false}

// Response — reasoning text is exposed
"output": [{
  "type": "reasoning",
  "summary": [{ "type": "summary_text", "text": "Explaining why 2+2=4... I need to answer the user's question..." }]
}]
"usage": { "output_tokens_details": { "reasoning_tokens": 231 } }

Tested directly against Azure OpenAI endpoint https://{resource}.openai.azure.com/openai/v1/responses — both calls succeed, the only difference is the summary field in the reasoning object.

What's Already Wired (SDK side)

The SDK receive pipeline is fully implemented:

  • AssistantReasoningDeltaEvent / AssistantReasoningDeltaData.DeltaContent — exists in event types
  • SessionConfig.Streaming = true — enables delta events
  • SessionConfig.ReasoningEffort — maps to reasoning.effort
  • ModelCapabilitiesOverride.Supports.ReasoningEffort — capability flag ✅

The only missing piece is sending reasoning.summary in the request body.

Proposed Solution

Add a ReasoningSummary property to SessionConfig (and ResumeSessionConfig):

/// <summary>
/// Reasoning summary mode for models that support it.
/// Valid values: "auto", "concise", "detailed".
/// When set, the provider includes reasoning summary text in the response,
/// which is emitted as AssistantReasoningDeltaEvent when streaming is enabled.
/// </summary>
public string? ReasoningSummary { get; set; }

The CLI would then include it in the reasoning object of the Responses API request:

{
  "reasoning": {
    "effort": "high",
    "summary": "auto"
  }
}

Environment

  • SDK version: v0.3.0 (also verified against main branch source)
  • CLI version: 1.0.36
  • Provider: Azure OpenAI ("openai" provider type, "responses" wireApi)
  • Models tested: gpt-5.4 (Azure deployment)
  • OS: Windows 11

Related Issues

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions