Skip to content

feat(schema): wire OpenAI ReasoningExtension into Reasoning block#1063

Merged
mrh997 merged 1 commit into
mainfrom
feat/mrh/openai
Jun 10, 2026
Merged

feat(schema): wire OpenAI ReasoningExtension into Reasoning block#1063
mrh997 merged 1 commit into
mainfrom
feat/mrh/openai

Conversation

@mrh997

@mrh997 mrh997 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds an OpenAI-specific reasoning extension to the schema and carries it through reasoning concatenation, so OpenAI reasoning content (and its per-content index) survives stream aggregation alongside the existing Text and Signature fields.

API Changes

  1. Added: openai.ReasoningExtension and openai.ReasoningContent types. ReasoningContent holds the reasoning text and an optional Index *int marking its position in the final response.
  2. Added: openai.ConcatReasoningExtensions, which merges streamed chunks by index — same-index chunks are concatenated, results are ordered by index, and a missing index returns an error.
  3. Added: Reasoning.OpenAIExtension *openai.ReasoningExtension field on the schema Reasoning block.

Key Changes

  1. concatReasoning now collects each chunk's OpenAIExtension and folds them via ConcatReasoningExtensions, propagating any concat error. It also skips nil reasoning entries during aggregation.

@codecov

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.60870% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.09%. Comparing base (30f5961) to head (38eae2f).

Files with missing lines Patch % Lines
schema/agentic_message.go 27.27% 5 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1063      +/-   ##
==========================================
- Coverage   83.14%   83.09%   -0.05%     
==========================================
  Files         162      162              
  Lines       23060    23104      +44     
==========================================
+ Hits        19173    19199      +26     
- Misses       2632     2641       +9     
- Partials     1255     1264       +9     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mrh997 mrh997 force-pushed the feat/mrh/openai branch 4 times, most recently from 8debd91 to 8267766 Compare June 8, 2026 15:43
Comment thread schema/openai/extension.go
Comment thread schema/agentic_message.go
@mrh997 mrh997 force-pushed the feat/mrh/openai branch 3 times, most recently from 9c836b5 to ae3acb8 Compare June 9, 2026 03:25
@mrh997 mrh997 force-pushed the feat/mrh/openai branch from ae3acb8 to 38eae2f Compare June 9, 2026 03:30

@shentongmartin shentongmartin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. The previous concern around ReasoningContent.Index has been clarified as internal streaming merge behavior, and the runtime blocker has been addressed.

@mrh997 mrh997 merged commit a9030b6 into main Jun 10, 2026
17 of 19 checks passed
@mrh997 mrh997 deleted the feat/mrh/openai branch June 10, 2026 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants