Reasoning steps read as separate blocks again instead of one glued paragraph - #80736
Merged
Conversation
…chat wire Reasoning-summary models emit one reasoning_content delta per completed summary part, each a self-contained bold heading. The Responses API delimits those parts with summary_index; the OpenAI chat wire carries no such field — verified live against Nous Portal, whose reasoning chunks contain nothing but delta.reasoning_content — so concatenating them glued every part into one unspaced, half-bold paragraph. Re-derive the boundary from the signal the wire does carry: a delta opening a closed bold heading against a mid-line tail. This matches Hermes own Responses adapter, which already joins its summary parts with a blank line.
The native Responses stream does carry summary_index, so the part boundary is structured data here rather than something to infer. Break on a change of index, and leave streams that send no index (plain reasoning_text) untouched.
Repairs what is already in the transcript: reasoning persisted before the backend fix, and any provider still gluing its parts. Handles both shapes — heading-onto-heading (the **** run) and prose-onto-heading (vercel/ai#6742). Verified against 46 real glued messages from a gpt-5.6-sol session; all repair cleanly and idempotently.
Contributor
૮ >ﻌ< ა ci reviewran on a5cddcd
|
randlee
pushed a commit
to randlee/hermes-agent
that referenced
this pull request
Aug 11, 2026
…summary-blocks Reasoning steps read as separate blocks again instead of one glued paragraph
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GPT-5.x reasoning rendered as one unbroken, unspaced, half-bold paragraph in the transcript — every "step" of the model's thinking run together with no separator.
Reasoning-summary models don't stream a chain of thought token by token. They emit one
reasoning_contentdelta per completed summary part, each a self-contained bold heading. On the Responses API those parts are delimited bysummary_index; the OpenAI chat wire carries no such field, so concatenating the deltas produces**Investigating culprit PRs****Inspecting message schema**— a****run that markdown reads as neither a bold close nor a bold open.The AI SDK hit exactly this and fixed it by starting a new reasoning part per
summary_index(vercel/ai#6742). That route needs the index, so this takes it where it exists and re-derives it where it doesn't:codex_runtime) —summary_indexis right there in the event. Break on a change of index; streams that send no index are untouched.chat_completion_helpers) — verified live against Nous Portal'sopenai/gpt-5.6-solthat its reasoning chunks contain nothing butdelta.reasoning_content, so the boundary can't be recovered from metadata. Re-derive it from the one signal that is there: a delta opening a closed bold heading against a mid-line tail.This also brings the chat-completions path in line with Hermes' own Responses adapter, which already joins summary parts with a blank line.
Both glue shapes are covered: heading-onto-heading (the
****run) and prose-onto-heading (interaction!**Next**), the latter being the shape the upstream issue reports and a****-only rule would miss.Verification
openai/gpt-5.6-solconfirming the wire carries nosummary_index, and reproducing the glued output.