Skip to content

feat(serve): accept reasoning.summary and include:reasoning.encrypted_content - #295

Open
Macasacker wants to merge 1 commit into
Neroued:masterfrom
Macasacker:feat/openai-responses-reasoning-compat
Open

Macasacker wants to merge 1 commit into
Neroued:masterfrom
Macasacker:feat/openai-responses-reasoning-compat

Conversation

@Macasacker

@Macasacker Macasacker commented Sep 20, 2026 •

Copy link
Copy Markdown

A rebase of #148 onto current master.

Problem

NInfer rejects OpenAI Responses API requests that set reasoning.summary
or include: ["reasoning.encrypted_content"], returning
reasoning_option_not_supported or include_not_supported. This breaks
harnesses that send these fields, such as Codex (which sends
include: ["reasoning.encrypted_content"] on every request) and Zed Agent.

Change

  • reasoning.summary is now accepted (any string), echoed back in the
    response, alongside a fixed placeholder summary.
  • include: ["reasoning.encrypted_content"] is now accepted. The raw
    reasoning text is copied into the reasoning item's encrypted_content
    field (display-only, not real encryption).
  • Any other include field is still rejected with include_not_supported.

Notes

…_content

Some OpenAI Responses API harnesses (Codex, Zed Agent) send reasoning.summary
and include: ["reasoning.encrypted_content"], which NInfer rejected. Accept
both: echo the requested summary back and return a fixed placeholder, and
mirror the raw reasoning text into the reasoning item's encrypted_content
field. Any other include field is still rejected with include_not_supported.
Wallawalla47 pushed a commit to Wallawalla47/ninfer-custom that referenced this pull request Sep 20, 2026
Wallawalla47 pushed a commit to Wallawalla47/ninfer-custom that referenced this pull request Sep 20, 2026
The PR Neroued#295 tests assert object equality on RequestJson values, but RequestJson is nlohmann::ordered_json, whose object equality compares key pairs in insertion order. The response encoder serialises with plain nlohmann::json, which dumps object keys sorted, so the wire order (e.g. "text" before "type") never matched the order the tests constructed their expectations in and every object-level comparison failed regardless of platform. Add a recursive json_unordered_eq that treats objects as key sets (arrays still compared in order) and use it for the reasoning summary and Item object comparisons.
Wallawalla47 pushed a commit to Wallawalla47/ninfer-custom that referenced this pull request Sep 20, 2026
… compatibility)

Record the merged PR in the Upstream pull requests list (with the local note that its test assertions were adapted to order-independent JSON comparison) and add Macasacker and Sha1rholder to the Thanks section.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenAI Responses API Compatibility Issue

1 participant