A team of long-lived bots for DeepSeek Harness, with main bots, bot-to-bot messages and group chats.
Keep the activity row steady and hide thinking by default
Fei2411cdc9e4700958
diff --git a/docs/design/ui-standard.md b/docs/design/ui-standard.mdindex 4f8cc95c..ab615757 100644--- a/docs/design/ui-standard.md+++ b/docs/design/ui-standard.md@@ -559,3 +559,4 @@ Bot 名字、提及用同一个颜色写字;纯黑读起来像标题,所以| 2026-10-16 | 强调色上的字色 | 取 `#141414` 和白色里对比度高的一个,不再用亮度 > 0.45 才用黑字。旧规则在 15 个强调色里有 8 个选了对比度低的一边,如 Tangerine 白字 2.89:1、黑字 6.38:1。代价:DeepSeek 深色、Moonlight、Paper 主题的发送键图标变成深色。改动在 #225 || 2026-10-16 | 预设强调色在深色界面(现状偏差 #13) | 预设色深色界面用它的深色值 `INKS[ink][1]`,和 Bot 名字的颜色一致;自定义颜色两种界面同一个值。和预设浅色值完全相等才算预设(和设置页的判断一样)。深色底上对比度:Charcoal 1.00 → 16.45,Graphite 1.34 → 12.71,Cobalt 2.48 → 4.90。代价:同一个预设色在两种界面里颜色不同(Charcoal 浅色近黑、深色近白),和 Mono 主题一样。改动在 #267 || 2026-10-16 | 危险色落地(现状偏差 #1) | 基础样式表设 `--bt-danger:#e02135`,22 处危险色(17 处 `#e02135`、5 处 `#c21d2e`)改读它;确认态底色改 `color-mix`。反馈提示框带后备值 `var(--bt-danger,#e02135)`,因为界面组装失败时它在没有基础样式表的情况下也要显示。录音和提示点的红色不动(待定)。代价:原 `#c21d2e` 的 5 处在浅色界面对比度从 5.98 降到 4.73:1(白底),深色界面从 3.08 升到 3.89:1。#268 |+| 2026-10-23 | 思考过程与上下文行 | 思考过程默认不显示,设置 → 通用 → 外观里可打开;Bot 对话不显示 DSH 的上下文行(如「工具已更新」);活动行是唯一的进行中提示(照 Grok)。#465 |diff --git a/docs/plans/2026-10-22-message-layout.md b/docs/plans/2026-10-22-message-layout.mdindex 12c954e0..c50bf42e 100644--- a/docs/plans/2026-10-22-message-layout.md+++ b/docs/plans/2026-10-22-message-layout.md@@ -20,17 +20,18 @@ Bot 回复的气泡最宽写死在 560px。宽屏下正文列是 960px,Bot 气- 「消息布局」:气泡 / 平铺的分段按钮,默认气泡,点了马上生效。- 「正文宽度」:只在平铺布局下出现,滑块 50%–100%,默认 100%。- 「气泡宽度」:滑块 50%–100%,默认 80%。+ - 「显示思考过程」开关:默认关。关着时对话里不显示思考过程,Bot 在想的时候只有活动行;开着时思考过程照旧显示在回复上方。- 两个滑块每格 5%,旁边显示当前百分比。拖动停下 350ms 后保存(和自定义强调色一样);还没保存就关掉设置,也照样保存。- 宽度都是正文列宽的百分比,私聊、群聊、Bot 之间的对话框都一样:- - 气泡宽度管所有气泡:气泡布局里的 Bot 气泡和思考过程,以及两种布局里的用户气泡。- - 正文宽度管平铺布局里 Bot 的正文和思考过程。+ - 气泡宽度管所有气泡:气泡布局里的 Bot 气泡和思考过程(开着显示思考过程时),以及两种布局里的用户气泡。+ - 正文宽度管平铺布局里 Bot 的正文和思考过程(开着显示思考过程时)。- 气泡布局:Bot 气泡右侧总是留出 82px 给悬停工具栏(6px 间距,加上三个 24px 按钮和它们之间 2px 的间隔),所以宽度调到 100% 时,Bot 气泡是整列宽减 82px。群聊里带头像的消息按(列宽 − 30px)的比例算,再加上 30px 的头像列。- 平铺布局:- Bot 的话上面有一行:头像、名字(正文色,加粗)、时间;群聊里还有管理员标签和用时。正文在下面,从头像的左边开始,没有底色和内边距。- - 私聊里每一轮回复出一次这一行,放在这一轮最先出现的地方:先出思考过程就在它上面,先出正文就在正文上面;更早的分段里的回复也一样。群聊和 Bot 之间的对话里,同一个 Bot 连着的几条消息共用一行,之间隔 10px。+ - 私聊里每一轮回复出一次这一行,放在这一轮最先出现的地方:先出思考过程就在它上面(开着显示思考过程时),先出正文就在正文上面;更早的分段里的回复也一样。群聊和 Bot 之间的对话里,同一个 Bot 连着的几条消息共用一行,之间隔 10px。- 悬停工具栏浮在消息的右上角,不占宽度。- 用户消息仍是靠右的气泡。-- 服务端只收这些值:`layout` 为 `bubble` 或 `flat`;`width` 和 `flatWidth` 为 50–100 的整数。其他值报错;默认值(`bubble`、`80`、`100`)不存。页面认不出的值按默认处理。+- 服务端只收这些值:`layout` 为 `bubble` 或 `flat`;`width` 和 `flatWidth` 为 50–100 的整数;`thinking` 为 `true` 或 `false`。`layout`、宽度的其他值报错,`thinking` 的其他值忽略;默认值(`bubble`、`80`、`100`、`false`)不存。页面认不出的值按默认处理。- 布局写在 `body[data-bt-layout]` 上,两个宽度写成 `body` 上的 `--bt-msg-w` 和 `--bt-flat-w`(0.5–1)。拿到团队状态之前,先用本机缓存的上一次设置,避免先闪一下默认样式。## 不做什么@@ -44,3 +45,7 @@ Bot 回复的气泡最宽写死在 560px。宽屏下正文列是 960px,Bot 气- 平铺布局里,悬停工具栏会盖住第一行最后几个字,鼠标移开就没了。- 气泡布局里,Bot 气泡最宽到整列宽减 82px:960px 的列大约在 91% 封顶,再往右拖只有用户气泡还在变宽。手机这类窄屏上更早封顶。++## 变更++- 2026-10-23:加「显示思考过程」开关,默认关;Bot 对话不再显示上下文行(#465)。diff --git a/ds-bot/client.js b/ds-bot/client.jsindex 7d0ac24b..116f6c74 100644--- a/ds-bot/client.js+++ b/ds-bot/client.js@@ -447,6 +447,7 @@ var ZH = {Flat: "平铺","Bubble width": "气泡宽度","Text width": "正文宽度",+ "Show thinking": "显示思考过程","Bots · {count}": "Bot · {count}","First in the sidebar. Pick another Bot to hand it the role; {name} then stops being a Main Bot.": "排在侧栏最上面。选另一个 Bot 就会把主 Bot 交给它,{name} 随之不再是主 Bot。","Choose a Bot…": "选择一个 Bot…",@@ -1743,6 +1744,7 @@ var allThemes = () => ({ ...THEMES, ...customThemes });var MESSAGE_WIDTH = { min: 50, max: 100, step: 5 };var percent = (value, initial) => Number.isInteger(value) && value >= MESSAGE_WIDTH.min && value <= MESSAGE_WIDTH.max ? value : initial;var layoutOf = (prefs) => prefs?.layout === "flat" ? "flat" : "bubble";+var thinkingShown = (prefs) => prefs?.thinking === true;var widthOf = (prefs) => percent(prefs?.width, 80);var flatWidthOf = (prefs) => percent(prefs?.flatWidth, 100);@@ -5059,9 +5061,9 @@ function turnReasoning(steps, current) {if (members.findLast((step) => stepReasoning(step) !== "")?.step !== current.step) return "";return members.map(stepReasoning).filter(Boolean).join("\n\n");}-function opensReply(steps, current) {+function opensReply(steps, current, withReasoning = true) {const members = steps.length ? steps : [current];- const reasoner = members.findLast((step) => stepReasoning(step) !== "");+ const reasoner = withReasoning ? members.findLast((step) => stepReasoning(step) !== "") : void 0;return members.find((step) => texts(step).length > 0 || step === reasoner)?.step === current.step;}var thinkingStep = (steps) => steps.find(thinkingLive);@@ -5824,17 +5826,17 @@ function AssistantCell({ node, groupPart, sessionId, openFile, fileMentions, useconst texts2 = groupPart === "reasoning" ? [] : data.blocks.filter((block) => block.kind === "text" && block.text.trim() !== "").map((block) => block.text);const running = data.status === "running";const members = steps.length ? steps : [data];- const reasoning = groupPart === "response" ? "" : turnReasoning(steps, data);- const thinking = groupPart === "response" ? void 0 : thinkingStep(members);+ const shown = thinkingShown(roster.prefs);+ const reasoning = groupPart === "response" || !shown ? "" : turnReasoning(steps, data);+ const thinking = groupPart === "response" || !shown ? void 0 : thinkingStep(members);const ms = useThinkingMs({ sessionId, turn: data.turn, settledSteps: members.filter((step) => step.status !== "running").length, skip: hidden || reasoning === "" });useLiveNote(actions, sessionId, `text:${node.key ?? data.seq}`, !hidden && running && texts2.length > 0 ? { text: true } : null);- useLiveNote(actions, sessionId, `think:${node.key ?? data.seq}`, !hidden && thinking !== void 0 && reasoning !== "" ? { text: true } : null);if (hidden) return null;const relays = relayPart(data, groupPart) ? relaysBefore(contexts, steps, data) : [];if (texts2.length === 0 && !reasoning && relays.length === 0) return null;const selfId = roster.byId[sessionId]?.id ?? sessionId;const speaker = layoutOf(roster.prefs) === "flat" ? roster.byId[sessionId] : void 0;- const head = speaker !== void 0 && opensReply(steps, data) && (reasoning !== "" || texts2.length > 0 && !(groupPart === "response" && turnReasoning(steps, data) !== ""));+ const head = speaker !== void 0 && opensReply(steps, data, shown) && (reasoning !== "" || texts2.length > 0 && !(groupPart === "response" && shown && turnReasoning(steps, data) !== ""));return (0, import_react10.createElement)(import_react10.Fragment,null,@@ -13434,7 +13436,8 @@ function GeneralPage({ roster, actions, run }) {(0, import_react34.createElement)(SetRow, { label: t("Message layout") }, (0, import_react34.createElement)(Choice, { label: t("Message layout"), value: layoutOf(prefs), options: LAYOUTS, pick: (id) => run(actions.setPrefs({ layout: id })) })),// The flat layout's text has a width of its own; the bubble width stays for the user's messages.layoutOf(prefs) === "flat" ? (0, import_react34.createElement)(SetRow, { label: t("Text width") }, (0, import_react34.createElement)(WidthSlider, { label: t("Text width"), value: flatWidthOf(prefs), save: (flatWidth) => run(actions.setPrefs({ flatWidth })) })) : null,- (0, import_react34.createElement)(SetRow, { label: t("Bubble width") }, (0, import_react34.createElement)(WidthSlider, { label: t("Bubble width"), value: widthOf(prefs), save: (width) => run(actions.setPrefs({ width })) }))+ (0, import_react34.createElement)(SetRow, { label: t("Bubble width") }, (0, import_react34.createElement)(WidthSlider, { label: t("Bubble width"), value: widthOf(prefs), save: (width) => run(actions.setPrefs({ width })) })),+ (0, import_react34.createElement)(SetRow, { label: t("Show thinking") }, (0, import_react34.createElement)(Switch, { label: t("Show thinking"), on: thinkingShown(prefs), onChange: (thinking) => run(actions.setPrefs({ thinking })) }))),actions.setSurface ? (0, import_react34.createElement)(SetSection,@@ -16644,7 +16647,7 @@ function apply(ctx) {if (typeof release === "function") release();if (snapshot.ready) {try {- localStorage.setItem(PREFS_KEY, JSON.stringify({ theme: prefs.theme, accent: prefs.accent, motion: prefs.motion, layout: prefs.layout, width: prefs.width, flatWidth: prefs.flatWidth }));+ localStorage.setItem(PREFS_KEY, JSON.stringify({ theme: prefs.theme, accent: prefs.accent, motion: prefs.motion, layout: prefs.layout, width: prefs.width, flatWidth: prefs.flatWidth, thinking: prefs.thinking }));} catch {}}@@ -17062,6 +17065,9 @@ function apply(ctx) {// every message.() => shadow("conversation.chat.node", { key: "question-reply", priority: BOT_PRIORITY, locale: "chat" }, AnsweredReply),() => shadow("conversation.chat.node", { key: "compaction", priority: BOT_PRIORITY, locale: "chat" }, Nothing),+ // A Bot chat leaves DSH's context lines (tool updates, injected context) out; a Bot+ // message spliced in mid-turn gets an event line from the step that reads it instead.+ () => shadow("conversation.chat.node", { key: "context", priority: BOT_PRIORITY, locale: "chat" }, Nothing),...canDrawUserMessages() ? ["user", "steering"].map((key) => () => shadow("conversation.chat.node", { key, priority: BOT_PRIORITY, locale: "chat", inject: face }, UserMessageCell)) : [],() => shadow("conversation.input.permission", { priority: BOT_PRIORITY }, Nothing),() => shadow("conversation.input.plan", { priority: BOT_PRIORITY }, Nothing),diff --git a/ds-bot/src/client/cells.js b/ds-bot/src/client/cells.jsindex bbc21113..043857e2 100644--- a/ds-bot/src/client/cells.js+++ b/ds-bot/src/client/cells.js@@ -17,7 +17,7 @@ import { noHover, useViewport, viewBottom } from './motion.js'import { heldCardKey } from './sources.js'import { BtwCardView } from './btw.js'import { partIndexOf, withBtwRows } from './btw-model.js'-import { layoutOf } from './themes.js'+import { layoutOf, thinkingShown } from './themes.js'export { clockLabel }@@ -226,14 +226,14 @@ export function AssistantCell({ node, groupPart, sessionId, openFile, fileMentioconst texts = groupPart === 'reasoning' ? [] : data.blocks.filter(block => block.kind === 'text' && block.text.trim() !== '').map(block => block.text)const running = data.status === 'running'const members = steps.length ? steps : [data]- const reasoning = groupPart === 'response' ? '' : turnReasoning(steps, data)+ const shown = thinkingShown(roster.prefs)+ const reasoning = groupPart === 'response' || !shown ? '' : turnReasoning(steps, data)// A live step of the same Turn keeps the row ticking even when it sits on an// earlier step's cell.- const thinking = groupPart === 'response' ? undefined : thinkingStep(members)+ const thinking = groupPart === 'response' || !shown ? undefined : thinkingStep(members)const ms = useThinkingMs({ sessionId, turn: data.turn, settledSteps: members.filter(step => step.status !== 'running').length, skip: hidden || reasoning === '' })- // A streaming reply — or a live reasoning row — stands in for the activity row.+ // A streaming reply stands in for the activity row.useLiveNote(actions, sessionId, `text:${node.key ?? data.seq}`, !hidden && running && texts.length > 0 ? { text: true } : null)- useLiveNote(actions, sessionId, `think:${node.key ?? data.seq}`, !hidden && thinking !== undefined && reasoning !== '' ? { text: true } : null)if (hidden) return null// A relay spliced mid-turn is a 'context' node, hidden from the chat flow on// DSH 0.2; the step that answers it shows the event line where it was read,@@ -244,8 +244,8 @@ export function AssistantCell({ node, groupPart, sessionId, openFile, fileMentio// The flat layout heads a reply with who speaks, once per Turn: in the step that opens// it, in that step's reasoning part when the reasoning shows there.const speaker = layoutOf(roster.prefs) === 'flat' ? roster.byId[sessionId] : undefined- const head = speaker !== undefined && opensReply(steps, data)- && (reasoning !== '' || (texts.length > 0 && !(groupPart === 'response' && turnReasoning(steps, data) !== '')))+ const head = speaker !== undefined && opensReply(steps, data, shown)+ && (reasoning !== '' || (texts.length > 0 && !(groupPart === 'response' && shown && turnReasoning(steps, data) !== '')))return h(Fragment, null,relays.map(relay => {const source = relay.sourcediff --git a/ds-bot/src/client/i18n.js b/ds-bot/src/client/i18n.jsindex 07944c7c..83be2ebc 100644--- a/ds-bot/src/client/i18n.js+++ b/ds-bot/src/client/i18n.js@@ -386,6 +386,7 @@ const ZH = {Flat: '平铺','Bubble width': '气泡宽度','Text width': '正文宽度',+ 'Show thinking': '显示思考过程','Bots · {count}': 'Bot · {count}','First in the sidebar. Pick another Bot to hand it the role; {name} then stops being a Main Bot.': '排在侧栏最上面。选另一个 Bot 就会把主 Bot 交给它,{name} 随之不再是主 Bot。','Choose a Bot…': '选择一个 Bot…',diff --git a/ds-bot/src/client/index.js b/ds-bot/src/client/index.jsindex b930f318..66e82144 100644--- a/ds-bot/src/client/index.js+++ b/ds-bot/src/client/index.js@@ -310,7 +310,7 @@ export function apply(ctx) {releaseTokens = ctx.theme.overrideTokens('ds-bot', shellTokens(themes[id]))if (typeof release === 'function') release()if (snapshot.ready) {- try { localStorage.setItem(PREFS_KEY, JSON.stringify({ theme: prefs.theme, accent: prefs.accent, motion: prefs.motion, layout: prefs.layout, width: prefs.width, flatWidth: prefs.flatWidth })) } catch { /* storage unavailable */ }+ try { localStorage.setItem(PREFS_KEY, JSON.stringify({ theme: prefs.theme, accent: prefs.accent, motion: prefs.motion, layout: prefs.layout, width: prefs.width, flatWidth: prefs.flatWidth, thinking: prefs.thinking })) } catch { /* storage unavailable */ }}}render()@@ -730,6 +730,9 @@ export function apply(ctx) {// every message.() => shadow('conversation.chat.node', { key: 'question-reply', priority: BOT_PRIORITY, locale: 'chat' }, AnsweredReply),() => shadow('conversation.chat.node', { key: 'compaction', priority: BOT_PRIORITY, locale: 'chat' }, Nothing),+ // A Bot chat leaves DSH's context lines (tool updates, injected context) out; a Bot+ // message spliced in mid-turn gets an event line from the step that reads it instead.+ () => shadow('conversation.chat.node', { key: 'context', priority: BOT_PRIORITY, locale: 'chat' }, Nothing),...(canDrawUserMessages() ? ['user', 'steering'].map(key => () => shadow('conversation.chat.node', { key, priority: BOT_PRIORITY, locale: 'chat', inject: face }, UserMessageCell)) : []),() => shadow('conversation.input.permission', { priority: BOT_PRIORITY }, Nothing),() => shadow('conversation.input.plan', { priority: BOT_PRIORITY }, Nothing),diff --git a/ds-bot/src/client/settings.js b/ds-bot/src/client/settings.jsindex 0bbf6320..1b67abe9 100644--- a/ds-bot/src/client/settings.js+++ b/ds-bot/src/client/settings.js@@ -1,11 +1,11 @@import { createElement as h, useCallback, useEffect, useRef, useState } from 'react'import { ACCENT_INKS, INKS } from './inks.js'import { isMainOf } from './sources.js'-import { MESSAGE_WIDTH, allThemes, flatWidthOf, layoutOf, widthOf } from './themes.js'+import { MESSAGE_WIDTH, allThemes, flatWidthOf, layoutOf, thinkingShown, widthOf } from './themes.js'import { CloseIcon, ChevronLeftIcon, ChevronRightIcon, ClockIcon, ConnectorIcon, InfoIcon, PlugIcon, PlusIcon, SlidersIcon, SETTINGS_ICONS } from './icons.js'import { AdminStar, BotAvatar, RoomAvatar } from './mark.js'import { useEscape } from './overlay-hooks.js'-import { BotSettingsForm } from './bot-settings.js'+import { BotSettingsForm, Switch } from './bot-settings.js'import { Segmented, useGlide } from './motion.js'import { GroupSettingsForm, NewGroupForm } from './group-settings.js'import { CreateBot } from './create-bot.js'@@ -102,7 +102,8 @@ function GeneralPage({ roster, actions, run }) {h(SetRow, { label: t('Message layout') }, h(Choice, { label: t('Message layout'), value: layoutOf(prefs), options: LAYOUTS, pick: id => run(actions.setPrefs({ layout: id })) })),// The flat layout's text has a width of its own; the bubble width stays for the user's messages.layoutOf(prefs) === 'flat' ? h(SetRow, { label: t('Text width') }, h(WidthSlider, { label: t('Text width'), value: flatWidthOf(prefs), save: flatWidth => run(actions.setPrefs({ flatWidth })) })) : null,- h(SetRow, { label: t('Bubble width') }, h(WidthSlider, { label: t('Bubble width'), value: widthOf(prefs), save: width => run(actions.setPrefs({ width })) }))),+ h(SetRow, { label: t('Bubble width') }, h(WidthSlider, { label: t('Bubble width'), value: widthOf(prefs), save: width => run(actions.setPrefs({ width })) })),+ h(SetRow, { label: t('Show thinking') }, h(Switch, { label: t('Show thinking'), on: thinkingShown(prefs), onChange: thinking => run(actions.setPrefs({ thinking })) }))),actions.setSurface ? h(SetSection, { key: 'mode', title: t('Mode') },h(SetRow, { label: t('Classic Agent mode') },h('button', { type: 'button', className: 'bt-soft bt-soft-sm', onClick: () => actions.setSurface('agent') }, t('Switch')))) : null,diff --git a/ds-bot/src/client/themes.js b/ds-bot/src/client/themes.jsindex 49e80f38..82c3b3b9 100644--- a/ds-bot/src/client/themes.js+++ b/ds-bot/src/client/themes.js@@ -123,5 +123,6 @@ export const allThemes = () => ({ ...THEMES, ...customThemes })export const MESSAGE_WIDTH = { min: 50, max: 100, step: 5 }const percent = (value, initial) => (Number.isInteger(value) && value >= MESSAGE_WIDTH.min && value <= MESSAGE_WIDTH.max ? value : initial)export const layoutOf = prefs => (prefs?.layout === 'flat' ? 'flat' : 'bubble')+export const thinkingShown = prefs => prefs?.thinking === trueexport const widthOf = prefs => percent(prefs?.width, 80)export const flatWidthOf = prefs => percent(prefs?.flatWidth, 100)diff --git a/ds-bot/src/client/turn-reasoning.js b/ds-bot/src/client/turn-reasoning.jsindex 839235d3..17c82dfc 100644--- a/ds-bot/src/client/turn-reasoning.js+++ b/ds-bot/src/client/turn-reasoning.js@@ -8,10 +8,11 @@ export function turnReasoning(steps, current) {}// Whether `current` opens the Turn's reply in the chat: the first step with reply text,-// or the one that shows the Turn's reasoning, whichever comes first.-export function opensReply(steps, current) {+// or — while the reasoning shows — the one that shows the Turn's reasoning, whichever+// comes first.+export function opensReply(steps, current, withReasoning = true) {const members = steps.length ? steps : [current]- const reasoner = members.findLast(step => stepReasoning(step) !== '')+ const reasoner = withReasoning ? members.findLast(step => stepReasoning(step) !== '') : undefinedreturn members.find(step => texts(step).length > 0 || step === reasoner)?.step === current.step}diff --git a/ds-bot/src/host/channel.js b/ds-bot/src/host/channel.jsindex ba5f4ae0..10114e5b 100644--- a/ds-bot/src/host/channel.js+++ b/ds-bot/src/host/channel.js@@ -122,6 +122,12 @@ export function install(rt) {else if (Number.isInteger(body.flatWidth) && body.flatWidth >= 50 && body.flatWidth <= 100) state.prefs.flatWidth = body.flatWidthelse throw invalid('Flat text width must be a whole percent from 50 to 100')}+ if (body.thinking !== undefined) {+ // A value this version does not know is ignored, not refused: the toggle+ // may grow more states later.+ if (body.thinking === true) state.prefs.thinking = true+ else if (body.thinking === false || body.thinking === null) delete state.prefs.thinking+ }return rt.save()}diff --git a/ds-bot/test/install.test.js b/ds-bot/test/install.test.jsindex ccc6c33c..b71d0845 100644--- a/ds-bot/test/install.test.js+++ b/ds-bot/test/install.test.js@@ -164,6 +164,14 @@ test('the client channel answers from the saved state', async (t) => {assert.equal((await call('set-prefs', { flatWidth: 70 })).value.flatWidth, 70)assert.equal('flatWidth' in (await call('set-prefs', { flatWidth: 100 })).value, false)assert.deepEqual((await call('set-prefs', { flatWidth: 40 })).error, { code: 'bot/invalid', message: 'Flat text width must be a whole percent from 50 to 100', details: {} })+ // The thinking switch stores only true; false, null and unknown values leave nothing.+ assert.equal('thinking' in (await call('set-prefs', { thinking: 'yes' })).value, false)+ assert.equal('thinking' in (await call('set-prefs', { thinking: 1 })).value, false)+ assert.equal((await call('set-prefs', { thinking: true })).value.thinking, true)+ assert.equal((await call('set-prefs', { thinking: 'yes' })).value.thinking, true)+ assert.equal('thinking' in (await call('set-prefs', { thinking: false })).value, false)+ await call('set-prefs', { thinking: true })+ assert.equal('thinking' in (await call('set-prefs', { thinking: null })).value, false)// A refusal from the team code keeps its message for the user.assert.deepEqual((await call('delete-bot', { id: 'nobody' })).error, { code: 'bot/refused', message: 'Unknown Bot', details: {} })// Off the Desktop profile there are no Bot browsers.diff --git a/ds-bot/test/turn-reasoning.test.js b/ds-bot/test/turn-reasoning.test.jsindex 5c20623f..9f4e0e12 100644--- a/ds-bot/test/turn-reasoning.test.js+++ b/ds-bot/test/turn-reasoning.test.js@@ -56,3 +56,11 @@ test('a reply opens on its first text or on its reasoning row, whichever comes fassert.equal(opener([step(1, [tool]), step(2, [tool]), step(3, [{ kind: 'text', text: 'Done' }])]), 2)assert.equal(opener([step(1, [tool])]), -1)})++test("with the reasoning hidden, only a step's own text opens the reply", () => {+ const opener = steps => steps.findIndex(current => opensReply(steps, current, false))+ // A reasoning-only first step no longer opens it: the step that answers does.+ assert.equal(opener([step(1, [think('B'), tool]), step(2, [tool]), step(3, [{ kind: 'text', text: 'Done' }])]), 2)+ assert.equal(opener([step(1, [{ kind: 'text', text: 'Looking' }, tool]), step(2, [think('B'), tool]), step(3, [think('C'), { kind: 'text', text: 'Done' }])]), 0)+ assert.equal(opener([step(1, [think('B'), tool])]), -1)+})diff --git a/ds-bot/test/turn-tail.test.js b/ds-bot/test/turn-tail.test.jsindex 291f849d..3a96093d 100644--- a/ds-bot/test/turn-tail.test.js+++ b/ds-bot/test/turn-tail.test.js@@ -13,7 +13,7 @@ function MarkdownText() { return null }const effects = []const module = { exports: {} }runInNewContext(bundle.outputFiles[0].text, {- module, exports: module.exports,+ module, exports: module.exports, AbortController, fetch,require: (name) => {const platform = {react: {@@ -28,7 +28,7 @@ runInNewContext(bundle.outputFiles[0].text, {return platform[name]},})-const { AssistantCell, TurnTailCell } = module.exports+const { AssistantCell, TurnTailCell, ThinkingRow } = module.exports// Renders the named components of an element tree, leaving the rest as elements.const expand = (node, names) => {@@ -114,3 +114,37 @@ test('a Bot reply in its own chat stays whole up to 20,000 characters', () => {assert.equal(reply(long), long)assert.equal(reply('w'.repeat(25_000)), 'w'.repeat(600))})++// #465: the thinking row stays a switchable extra, and the one activity row is+// never given up to it.+test('the thinking row shows only with its switch on, and the activity row is never yielded to it', () => {+ const cell = (prefs, blocks, steps) => {+ effects.length = 0+ const noted = []+ const { props } = cellProps()+ props.node.data = { turn: 3, step: 1, seq: 10, status: 'running', finalNode: { seq: 10 }, blocks }+ props.useTurnSteps = () => steps+ props.actions = { noteLive: (sessionId, id) => noted.push(id) }+ const useRoster = select => select({ ...roster, prefs })+ const out = expand(AssistantCell({ ...props, useRoster }), [])+ for (const run of effects) run()+ return { out, noted }+ }+ const reason = [{ kind: 'reasoning', text: 'Weighing it' }]+ const thinking = { turn: 3, step: 1, status: 'running', blocks: reason }+ // Off: a thinking step draws nothing and notes nothing.+ const off = cell({}, reason, [thinking])+ assert.equal(off.out, null)+ assert.deepEqual(off.noted, [])+ // On: the live row shows — and still notes nothing, so the activity row stays.+ const on = cell({ thinking: true }, reason, [thinking])+ assert.equal(find(on.out, node => node.type === ThinkingRow).length, 1)+ assert.equal(on.noted.filter(id => id.startsWith('think:')).length, 0)+ assert.deepEqual(on.noted, [])+ // A reply streaming in does give the activity row its one note, on or off.+ const replying = { turn: 3, step: 1, status: 'running', blocks: [{ kind: 'reasoning', text: 'Weighing it' }, { kind: 'text', text: 'Done' }] }+ for (const prefs of [{}, { thinking: true }]) {+ const { noted } = cell(prefs, replying.blocks, [replying])+ assert.ok(noted.every(id => id.startsWith('text:')))+ }+})