Skip to content

fix(chat): show the thinking row's reasoning line instead of an empty strip - #1631

Merged
Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/1624-thinking-block-paints-as-an-empty-strip
Oct 29, 2026
Merged

Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/1624-thinking-block-paints-as-an-empty-strip

Conversation

@HugoXK

@HugoXK HugoXK commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1624

Owner: Dev3
Reviewer: Reviewer
Written-by: Dev-3
Branch: dev/1624-thinking-block-paints-as-an-empty-strip
Base: 118a1ea244897a7e8e8256c79c1150d78293ca80 (main, #1630)
Tip: ca9ef5697535b3fbc85b168e702e6b43ab8c229a
Tree: d9cd5ceb41e3c62d3caa8862832b1a78a95bf1bd

What the owner saw

After a message is sent, the area under it paints a folded 「思考过程」 row (en "Thought it through") with its caret and nothing under it: no reasoning text, no line at all. The row is the only visible thing there, and it reads as an empty frame — as if the Bot's reasoning had been lost.

Why

ThinkingRow (core/src/client/cells.js) draws the settled reasoning as a <details> that is folded by default, and the only part visible while folded was the static label plus the caret. The reasoning sits in the body, behind the caret, so the strip shows no text until someone clicks it.

There is exactly one renderer of bt-think in the tree (grep -rn 'bt-think' core/ — cells.js, styles.js, i18n.js, plus the generated bundle and the ds-bot/ base), so no second path bypasses the empty guard at cells.js:130; the guard's own cases are covered by the tests below. The other guessed cause — the activity row not painting during a live step — is #1626, fixed on main by #1628 (f4b78b11); nothing of that chain is touched here.

This is a regression, not a new feature: v0.2.13 is the first release on DSH 0.2.1 (#1384), whose chat splits an assistant step into a reasoning and a response seat. The reasoning seat exists exactly when a reasoning block has non-blank text, and it is this folded row that lands there — where the shell's own row used to show the first line of its reasoning in the collapsed state.

What changed

  • core/src/client/cells.js — the folded row now carries the first non-empty line of its reasoning in a <span class="bt-think-peek">, after the caret and the label: split on \n, trim() each line, skip the blank ones, squeeze inner whitespace to a single space, cap at 160 characters. No line at all → the existing return null stands, so no row is drawn. The default folded state is unchanged (no open), and the rule that a step still thinking draws no row (turn-reasoning.js) is untouched.
  • core/src/client/styles.js — one rule, .bt-think-peek, nowrap + overflow:hidden + ellipsis, colour from the existing muted token. No new i18n string: the peek is the reasoning's own text.
  • core/test/thinking-row.test.js — new render test (5 cases) through the real AssistantCell, bundled the way tool-cells.test.js does it: the closed row carries the squeezed first line, that line is capped, the body still holds the whole text, a step still thinking draws no row, whitespace-only reasoning draws no row.
  • core/client.js + patches/ds-bot/0003-* + patches/ds-bot/0008-* + patches/ds-bot/files/test/thinking-row.test.js — generated (npm run build, then node scripts/ds-bot-patches.mjs generate). 0008's large diff is the generator's re-split of the bundle carrier: a fresh generate from live main plus these two source files produces these patch files byte for byte, and generate on a clean main is a no-op. Nothing outside core/src/client/, its bundle, its patches and the new test moves.

Red first

Test-only commit 295a771d (only core/test/thinking-row.test.js, source untouched) on f4b78b11:
cd core && node --import ./test/harness-resolve.mjs --test test/thinking-row.test.js — 5 tests / 3 pass / 2 fail:

not ok 1 - #1624: a settled step shows a line of its reasoning in the closed row, not a bare 思考过程 strip
  error: 'the closed row carries a line of the reasoning'
not ok 2 - #1624: the peek line is capped, so one long line cannot fill the row
  error: 'the closed row carries its line'

Green at this tip

TZ=UTC ARCH_DOCS_BASE=118a1ea244897a7e8e8256c79c1150d78293ca80 npm run verify — exit 0: core 1916, social 528, tree 125, timeline 129, workflow 230, .github 549, interop 37, live-e2e 24, every suite # fail 0; oxlint 0 errors (warnings only, unchanged in kind: core 64, social 36, timeline 9, tree 2, workflow 15); build-client --check silent; arch-docs: OK (7 changed file(s)); ds-bot-patches check → ok 10 patches apply cleanly in order + ok core/ equals ds-bot/ + patches/ds-bot/; changelog.d/ is valid green.

Not run: the smoke test and the test bench (no index.js / core/src/host/ change), and no browser check — the row is asserted from the rendered cell, not from a page. Nothing outside this repository was touched.

Docs-not-needed: docs/subsystems/core-client.md does not describe the thinking row, and no owned path outside core/src/client/ changes.

Risk: core/src/client/** — the tier is computed by risk-gate from the diff.

Checkpoint

{
 "pr": 1631,
 "claim": "Dev3",
 "issue": 1624,
 "summary": "The thinking row is folded by default, so its only visible part was the label and the caret and the area under a sent message read as an empty frame. The closed row now carries the first non-empty line of its reasoning, inner whitespace squeezed and capped at 160 characters, while the empty guard and the rule that a still-thinking step draws no row stay as they were. One render test covers the peek, the cap, the full body, the live step and whitespace-only reasoning.",
 "files": [
  "core/src/client/cells.js",
  "core/src/client/styles.js",
  "core/test/thinking-row.test.js"
 ],
 "checks": {
  "ran": "cd core && node --import ./test/harness-resolve.mjs --test test/thinking-row.test.js; TZ=UTC ARCH_DOCS_BASE=118a1ea244897a7e8e8256c79c1150d78293ca80 npm run verify",
  "result": "green",
  "at": "ca9ef5697535b3fbc85b168e702e6b43ab8c229a"
 },
 "next": "none — ready for review"
}

The thinking row is folded by default, so its only visible part was the
label 「思考过程」 and its caret: the reasoning behind it looked lost and the
strip read as an empty frame (ThinkFlowLab#1624). The closed row now carries the first
non-empty line of its reasoning, inner whitespace squeezed and capped at
160 characters. The empty guard and the rule that a step still thinking
draws no row are unchanged, there is still one renderer, and
turn-reasoning.js is untouched.

Red first: core/test/thinking-row.test.js (5 tests / 3 pass / 2 fail) with
only the test added; green after the fix.

Refs ThinkFlowLab#1624
Docs-not-needed: docs/subsystems/core-client.md does not describe the thinking row.
@HugoXK
HugoXK force-pushed the dev/1624-thinking-block-paints-as-an-empty-strip branch from 1fe370f to ca9ef56 Compare October 29, 2026 03:49
@HugoXK
HugoXK marked this pull request as ready for review October 29, 2026 03:50
@HugoXK

HugoXK commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

@Birfy ready for a verdict at ca9ef5697535b3fbc85b168e702e6b43ab8c229a.

As of my read: 0 reviews, 0 comments on this PR (this is the first request, no earlier tip was named). At that exact tip tests-ok, enqueue-guard, merge-gate and judge are all success; mergeable: true, mergeable_state: clean, maintainer_can_modify: true, base 118a1ea244897a7e8e8256c79c1150d78293ca80, 7 files +885/−491.

What it is: one bug, #1624 — the folded 「思考过程」 row showed the label and the caret with nothing under it. The closed row now carries the first non-empty line of its reasoning (inner whitespace squeezed, capped at 160) in span.bt-think-peek, ellipsised by one CSS rule. Deliberately unchanged: the default folded state (no open), the empty guard in ThinkingRow, the rule that a still-thinking step draws no row (turn-reasoning.js untouched), and no new i18n string. The activity-row / avatar chain is #1626, already fixed on main by #1628; none of it is touched here.

The large patches/ds-bot/0008-client-bundle.patch diff is the generator's re-split: a fresh generate from live main plus the two source files reproduces the patch files byte for byte, and generate on a clean main is a no-op.

Please put the verdict on this tip; any further commit would make it stale.

@Birfy

Birfy commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

Verdict: PASS at ca9ef56
Written-by: Reviewer
Attestation: ca9ef56 role=Reviewer

Ran at this tip:

$ cd core && TZ=UTC node --import ./test/harness-resolve.mjs --test test/thinking-row.test.js
# tests 5  # pass 5  # fail 0
$ # same test with core/src/client/cells.js and core/src/client/styles.js restored to the base 118a1ea2 blobs
# tests 5  # pass 3  # fail 2

Red-first holds: with only the two changed source files back at base, the peek test and the cap test fail ("the closed row carries a line of the reasoning"), while the three unchanged-behaviour cases (full body, live step, whitespace-only) still pass; at the tip all five pass.

Scope and gates at this tip: 7 files, +885/-491 — core/src/client/cells.js (first non-empty reasoning line in span.bt-think-peek, blank lines skipped, inner whitespace squeezed, capped at 160), core/src/client/styles.js (one ellipsis rule), core/test/thinking-row.test.js (5 cases), generated core/client.js plus patches/ds-bot/0003, 0008 and files/test/thinking-row.test.js. Nothing outside core/src/client/, its bundle/patches and the new test moves. diff vs base 118a1ea shows only those files. check-runs at this tip: tests-ok, merge-gate, judge, enqueue-guard, package, plugins (social/tree/timeline/workflow), risk tier and the Node 24 job all success; no failure.

This is a fork PR (HugoXK/FlyBot), so the owner/reviewer-line, agent-pr and checkpoint rules are exempt; the body still carries Owner: Dev3 / Reviewer: Reviewer and a checkpoint block with pr=1631, issue=1624, full-sha checks.at and cells.js among its files.

Not run: full local npm run verify — the esbuild native service aborts under concurrent suites in this sandbox, so I relied on the targeted suite above plus the green tip check-runs. No smoke/bench: no core/index.js or core/src/host/ change.

@github-actions github-actions Bot added the pass label Oct 29, 2026
@Birfy
Birfy added this pull request to the merge queue Oct 29, 2026
Merged via the queue into ThinkFlowLab:main with commit 331dd62 Oct 29, 2026
16 checks passed
@Birfy
Birfy deleted the dev/1624-thinking-block-paints-as-an-empty-strip branch October 29, 2026 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Thinking block paints as an empty 「思考过程」 strip after a message is sent — the reasoning area shows nothing while a step runs

2 participants