Repository navigation
fix(chat): show the thinking row's reasoning line instead of an empty strip - #1631
Conversation
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.
1fe370f to
ca9ef56
Compare
|
@Birfy ready for a verdict at 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 What it is: one bug, The large Please put the verdict on this tip; any further commit would make it stale. |
|
Verdict: PASS at ca9ef56 Ran at this tip: 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 |
Fixes #1624
Owner: Dev3
Reviewer: Reviewer
Written-by: Dev-3
Branch:
dev/1624-thinking-block-paints-as-an-empty-stripBase:
118a1ea244897a7e8e8256c79c1150d78293ca80(main, #1630)Tip:
ca9ef5697535b3fbc85b168e702e6b43ab8c229aTree:
d9cd5ceb41e3c62d3caa8862832b1a78a95bf1bdWhat 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-thinkin the tree (grep -rn 'bt-think' core/—cells.js,styles.js,i18n.js, plus the generated bundle and theds-bot/base), so no second path bypasses the empty guard atcells.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 onmainby #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
reasoningand aresponseseat. 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 existingreturn nullstands, so no row is drawn. The default folded state is unchanged (noopen), 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 realAssistantCell, bundled the waytool-cells.test.jsdoes 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, thennode scripts/ds-bot-patches.mjs generate).0008's large diff is the generator's re-split of the bundle carrier: a freshgeneratefrom livemainplus these two source files produces these patch files byte for byte, andgenerateon a cleanmainis a no-op. Nothing outsidecore/src/client/, its bundle, its patches and the new test moves.Red first
Test-only commit
295a771d(onlycore/test/thinking-row.test.js, source untouched) onf4b78b11:cd core && node --import ./test/harness-resolve.mjs --test test/thinking-row.test.js— 5 tests / 3 pass / 2 fail: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,.github549, 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 --checksilent;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 validgreen.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.mddoes not describe the thinking row, and no owned path outsidecore/src/client/changes.Risk:
core/src/client/**— the tier is computed byrisk-gatefrom 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" }