A team of long-lived bots for DeepSeek Harness, with main bots, bot-to-bot messages and group chats.
Distinguish an explicit Default thinking pick from an untouched one
Fei2411a24bbe868dd3
diff --git a/ds-bot/client.js b/ds-bot/client.jsindex 0c7d9bf8..e8939126 100644--- a/ds-bot/client.js+++ b/ds-bot/client.js@@ -10452,11 +10452,11 @@ function EffortRows({ reasoning, current, onPick }) {key: row.effort ?? "default",type: "button",role: "menuitemradio",- "aria-checked": row.effort === current,+ "aria-checked": (row.effort ?? null) === (current ?? null),onClick: () => onPick(row.effort)},(0, import_react20.createElement)("span", { className: "bt-menu-label" }, row.label),- (0, import_react20.createElement)("span", { className: "bt-model-tick", "aria-hidden": true }, row.effort === current ? (0, import_react20.createElement)(CheckIcon) : null)+ (0, import_react20.createElement)("span", { className: "bt-model-tick", "aria-hidden": true }, (row.effort ?? null) === (current ?? null) ? (0, import_react20.createElement)(CheckIcon) : null))));}@@ -12262,7 +12262,7 @@ function startModel(roster) {function createPayload({ name, look, image, model, effort, brief }) {const payload = { name, color: look.color, avatar: image ? { shape: look.shape, image } : { shape: look.shape } };if (model) payload.model = model;- if (effort) payload.effort = effort;+ if (effort !== void 0) payload.effort = effort;if (brief) payload.brief = brief;return payload;}@@ -12385,7 +12385,7 @@ function CreateBot({ roster, actions, start, brief = "", onBack, canGoBack, onCr(0, import_react26.createElement)(ModelMenu, { bot: { id: "new-bot", name: finalName, model: model || void 0, effort }, roster, actions, wide: true, onPick: (ref) => {setModel(ref);setEffort(void 0);- }, onPickEffort: setEffort }),+ }, onPickEffort: (picked) => setEffort(picked ?? null) }),(0, import_react26.createElement)("span", { className: "bt-note" }, (roster.models ?? []).length > 0 ? t("The Bot runs on this model. You can change it later in its details.") : t("Add a provider and a model in DeepSeek Harness first, or pick one in the Bot's chat later."))),error ? (0, import_react26.createElement)("div", { className: "bt-error", role: "alert", style: { padding: 0 } }, error) : null,diff --git a/ds-bot/src/client/bot-draft.js b/ds-bot/src/client/bot-draft.jsindex bc8d5645..c7659d87 100644--- a/ds-bot/src/client/bot-draft.js+++ b/ds-bot/src/client/bot-draft.js@@ -18,7 +18,7 @@ export function startModel(roster) {export function createPayload({ name, look, image, model, effort, brief }) {const payload = { name, color: look.color, avatar: image ? { shape: look.shape, image } : { shape: look.shape } }if (model) payload.model = model- if (effort) payload.effort = effort+ if (effort !== undefined) payload.effort = effortif (brief) payload.brief = briefreturn payload}diff --git a/ds-bot/src/client/create-bot.js b/ds-bot/src/client/create-bot.jsindex 5c53b75a..98350aee 100644--- a/ds-bot/src/client/create-bot.js+++ b/ds-bot/src/client/create-bot.js@@ -82,7 +82,7 @@ export function CreateBot({ roster, actions, start, brief = '', onBack, canGoBac: clash ? h('span', { className: 'bt-note bt-danger' }, t('A Bot named {name} already exists', { name: finalName })) : null),h('div', { className: 'bt-field' },h('span', { className: 'bt-field-label' }, t('Model')),- h(ModelMenu, { bot: { id: 'new-bot', name: finalName, model: model || undefined, effort }, roster, actions, wide: true, onPick: ref => { setModel(ref); setEffort(undefined) }, onPickEffort: setEffort }),+ h(ModelMenu, { bot: { id: 'new-bot', name: finalName, model: model || undefined, effort }, roster, actions, wide: true, onPick: ref => { setModel(ref); setEffort(undefined) }, onPickEffort: picked => setEffort(picked ?? null) }),h('span', { className: 'bt-note' }, (roster.models ?? []).length > 0? t('The Bot runs on this model. You can change it later in its details.'): t('Add a provider and a model in DeepSeek Harness first, or pick one in the Bot\'s chat later.'))),diff --git a/ds-bot/src/client/model-menu.js b/ds-bot/src/client/model-menu.jsindex 6980767a..731f0931 100644--- a/ds-bot/src/client/model-menu.js+++ b/ds-bot/src/client/model-menu.js@@ -77,11 +77,11 @@ function EffortRows({ reasoning, current, onPick }) {h('div', { className: 'bt-menu-sep', role: 'separator' }),h('div', { className: 'bt-model-group', role: 'presentation' }, t('Thinking level')),effortRows(reasoning).map(row => h('button', {- key: row.effort ?? 'default', type: 'button', role: 'menuitemradio', 'aria-checked': row.effort === current,+ key: row.effort ?? 'default', type: 'button', role: 'menuitemradio', 'aria-checked': (row.effort ?? null) === (current ?? null),onClick: () => onPick(row.effort),},h('span', { className: 'bt-menu-label' }, row.label),- h('span', { className: 'bt-model-tick', 'aria-hidden': true }, row.effort === current ? h(CheckIcon) : null))))+ h('span', { className: 'bt-model-tick', 'aria-hidden': true }, (row.effort ?? null) === (current ?? null) ? h(CheckIcon) : null))))}function ModelRows({ roster, current, onPick }) {diff --git a/ds-bot/src/host/roster.js b/ds-bot/src/host/roster.jsindex bd3917e3..adcf69d5 100644--- a/ds-bot/src/host/roster.js+++ b/ds-bot/src/host/roster.js@@ -143,9 +143,11 @@ export function install(rt) {const modelRef = model ? await rt.resolveModel(model) : pickModel ? undefined : await rt.defaultModel()// A thinking level needs a model to resolve against; with none it would be dropped// silently, so the create fails before a Session is made.- if (effort !== undefined && effort !== '' && modelRef === undefined) throw new Error('Pick a model before choosing a thinking level')- // An explicit level wins; else the Bot starts on the profile default's level.+ if (effort && modelRef === undefined) throw new Error('Pick a model before choosing a thinking level')+ // An explicit level wins; an explicit Default (null) picks the model's own+ // level; an untouched pick inherits the profile default's level.const effortId = modelRef === undefined ? undefined+ : effort === null || effort === '' ? undefined: (await rt.resolveEffort(modelRef, effort)) ?? await rt.defaultEffort(modelRef)const dir = workDir === undefined || workDir === null ? undefined : await rt.cleanWorkDir(workDir)const id = await createSession(cleanName, { dir })@@ -235,7 +237,9 @@ export function install(rt) {color: bot.color,avatar: bot.avatar,model: served ? bot.model : undefined,- effort: served ? bot.effort : undefined,+ // A copy of a Bot on the model's own default stays on it (null marks the+ // explicit Default pick); else the create would inherit the profile level.+ effort: served ? (bot.effort ?? null) : undefined,workDir,copyOf: bot.id,})diff --git a/ds-bot/test/roster.test.js b/ds-bot/test/roster.test.jsindex c02448ea..60e579e8 100644--- a/ds-bot/test/roster.test.js+++ b/ds-bot/test/roster.test.js@@ -257,6 +257,14 @@ test('a new Bot inherits the profile default thinking level', async (t) => {// An explicit level still wins, and a level the model does not serve is dropped.const coder = (await call('create-bot', { name: 'Coder', effort: 'low' })).valueassert.equal(coder.effort, 'low')++ // An explicit Default pick (null) stays on the model's own level, and so does a+ // copy of a Bot that has no level of its own.+ const plain = (await call('create-bot', { name: 'Plain', effort: null })).value+ assert.equal(plain.effort, undefined)+ const copy = (await call('duplicate-bot', { id: plain.id })).value+ assert.equal(copy.effort, undefined)+const other = { provider: 'deepseek', model: 'other', reasoningEffort: 'max' }const { call: call2, stop: stop2 } = start(undefined, { models: ['deepseek/deepseek-v4-flash'], reasoning, selection: other })t.after(stop2)