A team of long-lived bots for DeepSeek Harness, with main bots, bot-to-bot messages and group chats.
Show one line when a read-only window refuses a secret card
Fei24114eb945e34ea4
diff --git a/ds-bot/client.js b/ds-bot/client.jsindex 662dd1c1..fbc27844 100644--- a/ds-bot/client.js+++ b/ds-bot/client.js@@ -632,6 +632,7 @@ var ZH = {Canceled: "已取消",Done: "完成","{bot} is using {name}": "{bot} 正在使用 {name}",+ "{bot} could not ask for a key: this window can only view the team": "{bot} 没能要密钥:这个窗口只能查看团队","a saved key": "一个已保存的密钥","Chosen Bots": "指定的 Bot","Who may use {name}": "谁可以用 {name}",@@ -4602,6 +4603,9 @@ function SecretToolCell({ sessionId, callId, name, done, content, roster, actionif (done && /already saved/.test(contentText(content))) {return (0, import_react7.createElement)("div", { className: "bt-event" }, (0, import_react7.createElement)("span", { className: "bt-secret-event" }, (0, import_react7.createElement)(KeyIcon), t("{bot} is using {name}", { bot: bot.name, name: name ?? t("a saved key") })));}+ if (done && contentText(content).startsWith("No card can be shown now")) {+ return (0, import_react7.createElement)("div", { className: "bt-event" }, (0, import_react7.createElement)("span", { className: "bt-secret-event" }, (0, import_react7.createElement)(KeyIcon), t("{bot} could not ask for a key: this window can only view the team", { bot: bot.name })));+ }return null;}function SecretDock({ sessionId, useRoster, useCards, useHeldCards, actions }) {diff --git a/ds-bot/src/client/i18n.js b/ds-bot/src/client/i18n.jsindex b0ec1473..b9474a8e 100644--- a/ds-bot/src/client/i18n.js+++ b/ds-bot/src/client/i18n.js@@ -579,6 +579,7 @@ const ZH = {Canceled: '已取消',Done: '完成','{bot} is using {name}': '{bot} 正在使用 {name}',+ '{bot} could not ask for a key: this window can only view the team': '{bot} 没能要密钥:这个窗口只能查看团队','a saved key': '一个已保存的密钥','Chosen Bots': '指定的 Bot','Who may use {name}': '谁可以用 {name}',diff --git a/ds-bot/src/client/secret-card.js b/ds-bot/src/client/secret-card.jsindex e1f329f5..5176c087 100644--- a/ds-bot/src/client/secret-card.js+++ b/ds-bot/src/client/secret-card.js@@ -161,6 +161,11 @@ export function SecretToolCell({ sessionId, callId, name, done, content, roster,if (done && /already saved/.test(contentText(content))) {return h('div', { className: 'bt-event' }, h('span', { className: 'bt-secret-event' }, h(KeyIcon), t('{bot} is using {name}', { bot: bot.name, name: name ?? t('a saved key') })))}+ // A read-only window shows no card, so the refusal is said in one line, or the Bot+ // just trails off with nothing on screen.+ if (done && contentText(content).startsWith('No card can be shown now')) {+ return h('div', { className: 'bt-event' }, h('span', { className: 'bt-secret-event' }, h(KeyIcon), t('{bot} could not ask for a key: this window can only view the team', { bot: bot.name })))+ }return null}diff --git a/ds-bot/test/tool-cells.test.js b/ds-bot/test/tool-cells.test.jsindex 32a43dc7..21700204 100644--- a/ds-bot/test/tool-cells.test.js+++ b/ds-bot/test/tool-cells.test.js@@ -346,6 +346,15 @@ const docks = (store, roster, options) => {return out}+test('a secret request refused on a read-only window says so in one line', () => {+ const refused = 'No card can be shown now. The Bot team in /somewhere is open in another dsh (Web or Desktop, pid 4 on host-a). This window shows the team but cannot change it; close the other one and reload.'+ const root = program([call('request_secret', 'program:ro', { args: { name: 'DEMO_TOKEN' }, content: refused })])+ assert.match(shown(root), /Chief could not ask for a key: this window can only view the team/)+ // Other refusals stay silent: they are written for the model.+ const wrong = 'Secret cards only work in your own chat. Tell the group you will ask the user in your own chat, and call request_secret there.'+ assert.equal(shown(program([call('request_secret', 'program:grp', { args: { name: 'DEMO_TOKEN' }, content: wrong })])), '')+})+test('a card whose call is not drawn waits in the dock; a drawn one shows only at its call', () => {const store = cardStore()const roster = team({ questions: { chief: question('program:ptc:1') }, secretRequests: { chief: [request('program:ptc:2')] } })