A team of long-lived bots for DeepSeek Harness, with main bots, bot-to-bot messages and group chats.
Draw a done display-only show_view card with the args accessors
Fei2411b1f2fdc749fd
diff --git a/ds-bot/client.js b/ds-bot/client.jsindex 1d37a03c..b8c580f2 100644--- a/ds-bot/client.js+++ b/ds-bot/client.js@@ -4331,9 +4331,9 @@ function WidgetCell({ sessionId, callId, args, done, isError, roster, actions, hreturn (0, import_react6.createElement)(PendingView, { sessionId, view: record, actions, inline: true });}if (done && isError) return (0, import_react6.createElement)("span", { className: "bt-q-gone", hidden: true });- const blueprint = normalizeView(args?.("view"));- const shown = checkShownView(args?.("title"), blueprint);- if (shown.error !== void 0 || shown.interactive || args?.("await_reply") === true) {+ const blueprint = normalizeView(args?.value?.("view"));+ const shown = checkShownView(args?.text?.("title"), blueprint);+ if (shown.error !== void 0 || shown.interactive || args?.value?.("await_reply") === true) {return (0, import_react6.createElement)("span", { className: "bt-q-gone", hidden: true });}return (0, import_react6.createElement)("div", { className: "bt-q-inline" }, (0, import_react6.createElement)(WidgetCard, { title: shown.title, view: blueprint }));@@ -5798,7 +5798,7 @@ function renderCall(call2, { sessionId, roster, actions, useUi, useWork, findBotreturn (0, import_react9.createElement)(PendingQuestion, { key: JSON.stringify([sessionId, question.id]), sessionId, question, actions, inline: true });}case "show_view":- return (0, import_react9.createElement)(WidgetCell, { sessionId, callId: call2.callId, args: argValue, done, isError: call2.isError, roster, actions, heldCards });+ return (0, import_react9.createElement)(WidgetCell, { sessionId, callId: call2.callId, args: { text: arg, value: argValue }, done, isError: call2.isError, roster, actions, heldCards });case "request_secret":return (0, import_react9.createElement)(SecretToolCell, { sessionId, callId: call2.callId, name: arg("name"), done, content: call2.content, roster, actions, heldCards });case "ask_user_question": {diff --git a/ds-bot/src/client/cells.js b/ds-bot/src/client/cells.jsindex 47032f88..88522089 100644--- a/ds-bot/src/client/cells.js+++ b/ds-bot/src/client/cells.js@@ -860,7 +860,7 @@ function renderCall(call, { sessionId, roster, actions, useUi, useWork, findBot,return h(PendingQuestion, { key: JSON.stringify([sessionId, question.id]), sessionId, question, actions, inline: true })}case 'show_view':- return h(WidgetCell, { sessionId, callId: call.callId, args: argValue, done, isError: call.isError, roster, actions, heldCards })+ return h(WidgetCell, { sessionId, callId: call.callId, args: { text: arg, value: argValue }, done, isError: call.isError, roster, actions, heldCards })case 'request_secret':return h(SecretToolCell, { sessionId, callId: call.callId, name: arg('name'), done, content: call.content, roster, actions, heldCards })case 'ask_user_question': {diff --git a/ds-bot/src/client/widget-cell.js b/ds-bot/src/client/widget-cell.jsindex f62801d7..bfe14ef8 100644--- a/ds-bot/src/client/widget-cell.js+++ b/ds-bot/src/client/widget-cell.js@@ -225,14 +225,15 @@ export function WidgetCell({ sessionId, callId, args, done, isError, roster, act// A refused call (bad blueprint) drew no card; don't render an empty one.if (done && isError) return h('span', { className: 'bt-q-gone', hidden: true })// Display-only cards draw from the recorded call arguments, which keep the- // provider's encoding: unwrap it the same way the host does before storing.- const blueprint = normalizeView(args?.('view'))- const shown = checkShownView(args?.('title'), blueprint)+ // provider's encoding: unwrap it the same way the host does before storing. The+ // args accessor reads strings through `text`; `value` drops them.+ const blueprint = normalizeView(args?.value?.('view'))+ const shown = checkShownView(args?.text?.('title'), blueprint)// A call the host refused — a blueprint it would not show, or a reply it cannot// wait for — leaves no card; the model's retry then stays the only one. So does// a settled interactive call: answered, dismissed or replaced, it leaves no gap// where it was (same as ask_user).- if (shown.error !== undefined || shown.interactive || args?.('await_reply') === true) {+ if (shown.error !== undefined || shown.interactive || args?.value?.('await_reply') === true) {return h('span', { className: 'bt-q-gone', hidden: true })}return h('div', { className: 'bt-q-inline' }, h(WidgetCard, { title: shown.title, view: blueprint }))diff --git a/ds-bot/test/tool-cells.test.js b/ds-bot/test/tool-cells.test.jsindex 38b1629c..32a43dc7 100644--- a/ds-bot/test/tool-cells.test.js+++ b/ds-bot/test/tool-cells.test.js@@ -588,3 +588,18 @@ test('a show_view call the host refused draws nothing; a display-only card drawsassert.ok(title !== undefined)assert.equal(text(title), 'Status')})++test('a display-only call still draws when the args come through the value accessor', () => {+ // DSH's PartialArguments reads strings through text() — value() returns+ // undefined for them — so the title has to go through the string accessor.+ const data = { title: 'Status', view: { type: 'metric', label: 'Done', value: '3' } }+ const callNode = {+ kind: 'tool-result', name: 'show_view', callId: 'view-call', isError: false,+ args: { text: key => (typeof data[key] === 'string' ? data[key] : undefined), value: key => (typeof data[key] === 'string' ? undefined : data[key]) },+ call: { name: 'show_view', argsRaw: JSON.stringify(data) }, content: text$('The view is on screen.'), subCalls: [],+ }+ const node = show(callNode, { roster: team({ views: {} }) })+ const title = find(node, item => item.props?.className === 'bt-q-title')+ assert.ok(title !== undefined, 'the card draws')+ assert.equal(text(title), 'Status')+})