Skip to content

fix(openai): include summary field in reasoning block encoding#612

Merged
mikehostetler merged 3 commits intoagentjido:mainfrom
mhsdef:fix/openai-reasoning-summary
Apr 14, 2026
Merged

fix(openai): include summary field in reasoning block encoding#612
mikehostetler merged 3 commits intoagentjido:mainfrom
mhsdef:fix/openai-reasoning-summary

Conversation

@mhsdef
Copy link
Copy Markdown
Contributor

@mhsdef mhsdef commented Apr 14, 2026

Description

Adds the summary field when encoding OpenAI Responses API reasoning blocks for multi-turn context. When ReasoningDetails.text is present, encodes "summary": [{"type": "summary_text", "text": ...}]; otherwise encodes "summary": []. The OpenAI Responses API requires this field alongside encrypted content/signature in reasoning items sent back in conversation history.

Type of Change

  • Bug fix (non-breaking change fixing an issue)
  • New feature (non-breaking change adding functionality)
  • Breaking change (fix or feature causing existing functionality to change)
  • Documentation update

Breaking Changes

N/A

Testing

  • Tests pass (mix test)
  • Quality checks pass (mix quality)

Checklist

  • My code follows the project's style guidelines
  • I have updated the documentation accordingly
  • I have added tests that prove my fix/feature works
  • All new and existing tests pass
  • My commits follow conventional commit format
  • I have NOT edited CHANGELOG.md (it is auto-generated by git_ops)

Related Issues

N/A

mhsdef and others added 3 commits April 14, 2026 01:25
The OpenAI Responses API requires a `summary` field on reasoning items
in the input. `encode_single_reasoning_detail` was omitting it, causing
400 errors on multi-turn conversations with reasoning models.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Previously, reasoning blocks from every assistant message accumulated in
the input, bloating the context and slowing requests. Now only the most
recent assistant's reasoning details are preserved.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mikehostetler mikehostetler merged commit d77a3d2 into agentjido:main Apr 14, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants