Skip to content

fix: show each OpenAI reasoning summary title on its own line - #31349

Merged
mafredri merged 2 commits into
mainfrom
mafredri/fantasy-reasoning-summary-paragraphs
Oct 27, 2026
Merged

mafredri merged 2 commits into
mainfrom
mafredri/fantasy-reasoning-summary-paragraphs

Conversation

@mafredri

@mafredri mafredri commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

OpenAI reasoning summaries stream as parts that each open with a bold title. Fantasy sent a single "\n" before each part, which Markdown renders as a space, so the chat UI showed every title after the first at the end of the previous paragraph. #30551 stopped the UI from dropping that "\n", but one newline is still not a paragraph break.

This moves the fantasy pin to coder/fantasy#67, which sends "\n\n" before every summary part. The first part gets one too: the UI joins adjacent reasoning items into one thinking block, including across web_search calls, and without it the next item's title would follow the previous sentence with no space. Messages saved before this change keep the single newline. The go.mod fork notes gain item 16, which points at the upstream PR, charmbracelet/fantasy#436.

Dogfood data behind the leading blank line

7 days of dogfood chat_messages for OpenAI Responses models (openai, and Bedrock openai.*):

  • In every completed reasoning part, the stored text is exactly "\n" + summary[0] + "\n" + summary[1] ..., so fantasy's separator is the only one.
  • All 4,044 summary parts start with **Title**\n\n. No part starts or ends with whitespace.
  • 884 summary parts follow another part of the same item. A blank line between parts fixes these.
  • 355 boundaries in 262 of 2,802 messages are between reasoning items that the UI joins into one block. A blank line only between parts of one item would have shown these as sentence.**Title**.
  • Interrupted turns store each delta as its own part (2 OpenAI messages in 45 days), so they show whatever fantasy streams.
Verification
  • go build ./... and make pre-commit pass.
  • go test passes on every package that imports fantasy (coderd/x/chatd/..., coderd/database/db2sdk, coderd/mcp), and go test ./coderd -run 'TestChat|TestExpChat|TestMCP|TestAIBridge' passes.
  • fix(providers/openai): blank line between reasoning summary parts fantasy#67 has Stream and Generate tests that fail with the old separator. No coder test covers this: chattest's Responses mock streams one summary part per reasoning item.
  • Not checked against live OpenAI or in the UI.

🤖 This PR was created with the help of Coder Agents, and will be reviewed by a human. 🏂🏻

@mafredri
mafredri marked this pull request as ready for review October 27, 2026 15:01
OpenAI reasoning summaries stream as parts that each open with a bold
title. Fantasy sent a single newline before each part, which Markdown
renders as a space, so the chat UI showed every title after the first
at the end of the previous paragraph. #30551 stopped the UI from
dropping that newline, but one newline is still not a paragraph break.

The fantasy pin moves to coder/fantasy#67, which sends a blank line
before every summary part. The first part gets one too, because the UI
joins adjacent reasoning items into one thinking block. Messages saved
before this keep the single newline.
@mafredri
mafredri force-pushed the mafredri/fantasy-reasoning-summary-paragraphs branch from 1e8ae7c to bbe0c8c Compare October 27, 2026 15:36
@mafredri
mafredri merged commit 9f7a5d5 into main Oct 27, 2026
31 checks passed
@mafredri
mafredri deleted the mafredri/fantasy-reasoning-summary-paragraphs branch October 27, 2026 16:10
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants