Skip to content

A team of long-lived bots for DeepSeek Harness, with main bots, bot-to-bot messages and group chats.

Show provider groups in the initial model chooser

yihao yea656831782b1
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 93ca02c6..42851734 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,10 @@ All notable changes to DS Bot are listed here. The format follows [Keep a Change
## [Unreleased]
+### Fixed
+
+- Group the first model choices by provider, so models with the same name can be distinguished. Providers with the same display name also show their provider IDs.
+
## [0.1.0] - 2026-10-10
The first public preview. Tested with DeepSeek Harness `0.2.1-alpha.1` (DSH Desktop and DSH Web).
diff --git a/ds-bot/client.js b/ds-bot/client.js
index 843b3518..daee45f8 100644
--- a/ds-bot/client.js
+++ b/ds-bot/client.js
@@ -5680,10 +5680,19 @@ var MENU_EXIT_MS = 120;
function groupModels(models) {
const groups = /* @__PURE__ */ new Map();
for (const model of models ?? []) {
- if (!groups.has(model.providerName)) groups.set(model.providerName, []);
- groups.get(model.providerName).push(model);
+ const provider = model.provider ?? model.providerName ?? model.ref.split("/")[0];
+ if (!groups.has(provider)) groups.set(provider, []);
+ groups.get(provider).push(model);
}
- return [...groups];
+ const names = /* @__PURE__ */ new Map();
+ for (const [provider, list] of groups) {
+ const name = list[0].providerName ?? provider;
+ names.set(name, (names.get(name) ?? 0) + 1);
+ }
+ return [...groups].map(([provider, list]) => {
+ const name = list[0].providerName ?? provider;
+ return [names.get(name) > 1 ? `${name} (${provider})` : name, list];
+ });
}
var servedOf = (roster, ref) => (roster.models ?? []).find((model) => model.ref === ref);
function modelOf(bot, roster) {
@@ -5696,7 +5705,7 @@ function modelOf(bot, roster) {
function ModelRows({ roster, current, onPick }) {
return groupModels(roster.models).map(([provider, list]) => (0, import_react13.createElement)(
import_react13.Fragment,
- { key: provider },
+ { key: list[0].provider ?? provider },
(0, import_react13.createElement)("div", { className: "bt-model-group", role: "presentation" }, provider),
list.map((model) => (0, import_react13.createElement)(
"button",
@@ -5824,15 +5833,21 @@ function ModelChoiceDock({ sessionId, useRoster, actions }) {
};
const text = lost ? t("{model} is not available anymore. Pick another model for me.", { model: bot.model.split("/").slice(1).join("/") }) : models.length === 0 ? t("Hi, I'm {name}. I don't have a model yet. How do you want to set one up?", { name: bot.name }) : t("Hi, I'm {name}. Pick a model for me first. You can change it later in my details.", { name: bot.name });
const choices = models.length === 0 ? setupChoices(actions).map(([label, run]) => (0, import_react13.createElement)("button", { key: label, type: "button", className: "bt-model-chip", onClick: run }, label)) : [
- ...models.map((model) => (0, import_react13.createElement)("button", {
- key: model.ref,
- type: "button",
- className: "bt-model-chip",
- disabled: busy !== "",
- "aria-busy": busy === model.ref || void 0,
- title: model.ref === roster.defaultModel ? `${model.ref} · ${t("Harness default")}` : model.ref,
- onClick: () => pick2(model.ref)
- }, model.name, busy === model.ref ? (0, import_react13.createElement)("span", { className: "bt-model-spin", "aria-label": t("Saving…") }) : null)),
+ ...groupModels(models).map(([provider, list]) => (0, import_react13.createElement)(
+ "div",
+ { key: list[0].provider ?? provider, className: "bt-model-choice-group", role: "group", "aria-label": provider },
+ (0, import_react13.createElement)("div", { className: "bt-model-choice-provider", "aria-hidden": true }, provider),
+ (0, import_react13.createElement)("div", { className: "bt-model-choice-chips" }, list.map((model) => (0, import_react13.createElement)("button", {
+ key: model.ref,
+ type: "button",
+ className: "bt-model-chip",
+ disabled: busy !== "",
+ "aria-busy": busy === model.ref || void 0,
+ "aria-label": `${model.name} · ${provider}`,
+ title: model.ref === roster.defaultModel ? `${model.ref} · ${t("Harness default")}` : model.ref,
+ onClick: () => pick2(model.ref)
+ }, model.name, busy === model.ref ? (0, import_react13.createElement)("span", { className: "bt-model-spin", "aria-label": t("Saving…") }) : null)))
+ )),
(0, import_react13.createElement)("button", { key: "manage", type: "button", className: "bt-model-chip bt-model-chip-quiet", onClick: openHarnessSettings }, (0, import_react13.createElement)(SlidersIcon), t("Manage models"))
];
return (0, import_react13.createElement)(
@@ -5905,6 +5920,9 @@ var MODEL_CSS = `
.bt-model-none{padding:8px;font-size:13px;line-height:18px;color:var(--bt-ink-2)}
.bt-model-dock{width:100%;max-width:var(--dsh-chat-content-width,748px);margin:0 auto;display:flex;flex-direction:column;align-items:flex-start;gap:8px;padding:0 0 10px;box-sizing:border-box;animation:bt-model-in ${SPRING_POP.duration}ms ${SPRING_POP.easing} backwards}
.bt-model-chips{display:flex;flex-wrap:wrap;gap:6px;margin-left:30px;max-width:min(560px,calc(100% - 30px));max-height:min(240px,36vh);overflow-y:auto;scrollbar-width:thin}
+.bt-model-choice-group{display:flex;flex-direction:column;gap:6px;width:100%;min-width:0}
+.bt-model-choice-provider{padding-top:4px;font-size:12px;line-height:16px;font-weight:500;color:var(--bt-ink-2);overflow-wrap:anywhere}
+.bt-model-choice-chips{display:flex;flex-wrap:wrap;gap:6px}
.bt-model-chip{display:inline-flex;align-items:center;gap:6px;min-height:30px;padding:5px 12px;border:.5px solid var(--bt-line-2);border-radius:999px;background:var(--bt-surface,transparent);color:var(--bt-ink);font:inherit;font-size:13px;line-height:18px;cursor:pointer;transition:background-color .12s ease,border-color .12s ease}
.bt-model-chip:hover:not(:disabled){background:var(--bt-hover)}
.bt-model-chip:focus-visible{outline:2px solid var(--bt-accent);outline-offset:1px}
diff --git a/ds-bot/src/client/model-menu.js b/ds-bot/src/client/model-menu.js
index 878d8eaa..15185252 100644
--- a/ds-bot/src/client/model-menu.js
+++ b/ds-bot/src/client/model-menu.js
@@ -16,10 +16,19 @@ const MENU_EXIT_MS = 120
export function groupModels(models) {
const groups = new Map()
for (const model of models ?? []) {
- if (!groups.has(model.providerName)) groups.set(model.providerName, [])
- groups.get(model.providerName).push(model)
+ const provider = model.provider ?? model.providerName ?? model.ref.split('/')[0]
+ if (!groups.has(provider)) groups.set(provider, [])
+ groups.get(provider).push(model)
}
- return [...groups]
+ const names = new Map()
+ for (const [provider, list] of groups) {
+ const name = list[0].providerName ?? provider
+ names.set(name, (names.get(name) ?? 0) + 1)
+ }
+ return [...groups].map(([provider, list]) => {
+ const name = list[0].providerName ?? provider
+ return [names.get(name) > 1 ? `${name} (${provider})` : name, list]
+ })
}
const servedOf = (roster, ref) => (roster.models ?? []).find(model => model.ref === ref)
@@ -34,7 +43,7 @@ export function modelOf(bot, roster) {
}
function ModelRows({ roster, current, onPick }) {
- return groupModels(roster.models).map(([provider, list]) => h(Fragment, { key: provider },
+ return groupModels(roster.models).map(([provider, list]) => h(Fragment, { key: list[0].provider ?? provider },
h('div', { className: 'bt-model-group', role: 'presentation' }, provider),
list.map(model => h('button', {
key: model.ref, type: 'button', role: 'menuitemradio', 'aria-checked': model.ref === current, title: model.ref,
@@ -138,11 +147,14 @@ export function ModelChoiceDock({ sessionId, useRoster, actions }) {
const choices = models.length === 0
? setupChoices(actions).map(([label, run]) => h('button', { key: label, type: 'button', className: 'bt-model-chip', onClick: run }, label))
: [
- ...models.map(model => h('button', {
- key: model.ref, type: 'button', className: 'bt-model-chip', disabled: busy !== '', 'aria-busy': busy === model.ref || undefined,
- title: model.ref === roster.defaultModel ? `${model.ref} · ${t('Harness default')}` : model.ref,
- onClick: () => pick(model.ref),
- }, model.name, busy === model.ref ? h('span', { className: 'bt-model-spin', 'aria-label': t('Saving…') }) : null)),
+ ...groupModels(models).map(([provider, list]) => h('div', { key: list[0].provider ?? provider, className: 'bt-model-choice-group', role: 'group', 'aria-label': provider },
+ h('div', { className: 'bt-model-choice-provider', 'aria-hidden': true }, provider),
+ h('div', { className: 'bt-model-choice-chips' }, list.map(model => h('button', {
+ key: model.ref, type: 'button', className: 'bt-model-chip', disabled: busy !== '', 'aria-busy': busy === model.ref || undefined,
+ 'aria-label': `${model.name} · ${provider}`,
+ title: model.ref === roster.defaultModel ? `${model.ref} · ${t('Harness default')}` : model.ref,
+ onClick: () => pick(model.ref),
+ }, model.name, busy === model.ref ? h('span', { className: 'bt-model-spin', 'aria-label': t('Saving…') }) : null))))),
h('button', { key: 'manage', type: 'button', className: 'bt-model-chip bt-model-chip-quiet', onClick: openHarnessSettings }, h(SlidersIcon), t('Manage models')),
]
return h('div', { className: 'bt-model-dock' },
@@ -209,6 +221,9 @@ export const MODEL_CSS = `
.bt-model-none{padding:8px;font-size:13px;line-height:18px;color:var(--bt-ink-2)}
.bt-model-dock{width:100%;max-width:var(--dsh-chat-content-width,748px);margin:0 auto;display:flex;flex-direction:column;align-items:flex-start;gap:8px;padding:0 0 10px;box-sizing:border-box;animation:bt-model-in ${SPRING_POP.duration}ms ${SPRING_POP.easing} backwards}
.bt-model-chips{display:flex;flex-wrap:wrap;gap:6px;margin-left:30px;max-width:min(560px,calc(100% - 30px));max-height:min(240px,36vh);overflow-y:auto;scrollbar-width:thin}
+.bt-model-choice-group{display:flex;flex-direction:column;gap:6px;width:100%;min-width:0}
+.bt-model-choice-provider{padding-top:4px;font-size:12px;line-height:16px;font-weight:500;color:var(--bt-ink-2);overflow-wrap:anywhere}
+.bt-model-choice-chips{display:flex;flex-wrap:wrap;gap:6px}
.bt-model-chip{display:inline-flex;align-items:center;gap:6px;min-height:30px;padding:5px 12px;border:.5px solid var(--bt-line-2);border-radius:999px;background:var(--bt-surface,transparent);color:var(--bt-ink);font:inherit;font-size:13px;line-height:18px;cursor:pointer;transition:background-color .12s ease,border-color .12s ease}
.bt-model-chip:hover:not(:disabled){background:var(--bt-hover)}
.bt-model-chip:focus-visible{outline:2px solid var(--bt-accent);outline-offset:1px}
diff --git a/ds-bot/test/model-menu.test.js b/ds-bot/test/model-menu.test.js
new file mode 100644
index 00000000..12033230
--- /dev/null
+++ b/ds-bot/test/model-menu.test.js
@@ -0,0 +1,94 @@
+import assert from 'node:assert/strict'
+import { test } from 'node:test'
+import { fileURLToPath } from 'node:url'
+import { runInNewContext } from 'node:vm'
+import { build } from 'esbuild'
+
+const bundle = await build({
+ entryPoints: [fileURLToPath(new URL('../src/client/model-menu.js', import.meta.url))],
+ bundle: true, format: 'cjs', platform: 'node', write: false,
+ external: ['react', 'react-dom', '@deepseek-ai/dsh-client-ui-primitives'],
+})
+const module = { exports: {} }
+runInNewContext(bundle.outputFiles[0].text, {
+ module, exports: module.exports,
+ require: name => {
+ const platform = {
+ react: {
+ createElement: (type, props, ...children) => ({ type, props: props ?? {}, children: children.flat(Infinity) }),
+ useState: initial => [initial, () => {}],
+ useEffect: () => {},
+ },
+ 'react-dom': {},
+ '@deepseek-ai/dsh-client-ui-primitives': {},
+ }
+ if (!(name in platform)) throw new Error(`no platform module ${name}`)
+ return platform[name]
+ },
+})
+const { groupModels, ModelChoiceDock } = module.exports
+
+function nodes(tree, match) {
+ if (!tree || typeof tree !== 'object') return []
+ return [...(match(tree) ? [tree] : []), ...(tree.children ?? []).flatMap(child => nodes(child, match))]
+}
+
+function dock(models, { model, ready = true } = {}) {
+ const picked = []
+ const bot = { id: 'chief', name: 'Chief', model }
+ const roster = { ready, byId: { chief: bot }, models, defaultModel: models[0]?.ref }
+ const tree = ModelChoiceDock({
+ sessionId: bot.id, useRoster: select => select(roster),
+ actions: { updateBot: (id, patch) => { picked.push([id, patch.model]); return Promise.resolve() } },
+ })
+ return { tree, picked }
+}
+
+const models = [
+ { ref: 'official/flash', provider: 'official', providerName: 'DeepSeek', name: 'DeepSeek Flash' },
+ { ref: 'local/flash', provider: 'local', providerName: 'Ollama', name: 'DeepSeek Flash' },
+ { ref: 'official/pro', provider: 'official', providerName: 'DeepSeek', name: 'DeepSeek Pro' },
+]
+
+test('the first model choice shows provider groups and keeps each model route', () => {
+ const { tree, picked } = dock(models)
+ const groups = nodes(tree, node => node.props.className === 'bt-model-choice-group')
+ assert.deepEqual(groups.map(group => group.props['aria-label']), ['DeepSeek', 'Ollama'])
+ assert.deepEqual(groups.map(group => nodes(group, node => node.props.className === 'bt-model-choice-provider')[0].children[0]), ['DeepSeek', 'Ollama'])
+ const buttons = groups.map(group => nodes(group, node => node.type === 'button'))
+ assert.deepEqual(buttons.map(list => list.map(button => button.children[0])), [['DeepSeek Flash', 'DeepSeek Pro'], ['DeepSeek Flash']])
+ assert.match(buttons[0][0].props.title, /official\/flash.*Harness default/)
+ buttons[1][0].props.onClick()
+ buttons[0][0].props.onClick()
+ assert.deepEqual(picked, [['chief', 'local/flash'], ['chief', 'official/flash']])
+ assert.equal(nodes(tree, node => node.type === 'button' && node.children.includes('Manage models')).length, 1)
+})
+
+test('providers with the same display name stay distinct, and unnamed providers use their id', () => {
+ const entries = [
+ { ...models[0], providerName: 'Cloud' },
+ { ...models[1], providerName: 'Cloud' },
+ { ref: 'custom/flash', provider: 'custom', name: 'Flash' },
+ ]
+ const groups = groupModels(entries)
+ assert.deepEqual(Array.from(groups, ([label, list]) => [label, Array.from(list, model => model.ref)]), [
+ ['Cloud (official)', ['official/flash']],
+ ['Cloud (local)', ['local/flash']],
+ ['custom', ['custom/flash']],
+ ])
+})
+
+test('an unavailable model offers the same provider groups', () => {
+ const { tree } = dock(models, { model: 'gone/flash' })
+ assert.deepEqual(nodes(tree, node => node.props.className === 'bt-model-choice-group').map(group => group.props['aria-label']), ['DeepSeek', 'Ollama'])
+ assert.ok(nodes(tree, node => node.props.className === 'bt-bubble')[0].children[0].includes('not available anymore'))
+})
+
+test('an empty catalog offers setup choices, and a ready model needs no choice dock', () => {
+ const { tree } = dock([])
+ assert.deepEqual(nodes(tree, node => node.type === 'button').map(button => button.children[0]), [
+ 'Enter a DeepSeek API key', 'Open settings to set up a custom model',
+ ])
+ assert.equal(dock(models, { model: models[0].ref }).tree, null)
+ assert.equal(dock(models, { ready: false }).tree, null)
+})