Skip to content

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

Tolerate DSH 0.2.2 assemblies without a tool list

Fei2411ea48c864f005
diff --git a/ds-bot/dev/harness/package.json b/ds-bot/dev/harness/package.json
index 870ff3e3..4634dcff 100644
--- a/ds-bot/dev/harness/package.json
+++ b/ds-bot/dev/harness/package.json
@@ -3,7 +3,7 @@
"private": true,
"description": "The DeepSeek Harness packages that the unit tests and the linter run against. Install with npm run harness in ds-bot/.",
"dependencies": {
- "@deepseek-ai/dsh": "0.2.1-rc.5",
+ "@deepseek-ai/dsh": "0.2.2-rc.1",
"jsdom": "29.1.1",
"oxlint": "1.76.0"
}
diff --git a/ds-bot/src/host/tools.js b/ds-bot/src/host/tools.js
index da70e1e3..5f1804a4 100644
--- a/ds-bot/src/host/tools.js
+++ b/ds-bot/src/host/tools.js
@@ -842,9 +842,11 @@ export function install(rt) {
if (held.filtered === true || typeof agent.ctx?.on !== 'function') return
const dispose = agent.ctx.on('system-prompt/assemble', async (_assembly, _context, next) => {
const assembled = await next()
+ // DSH 0.2.2 adds the tool list after this waterfall (#814), so only an
+ // older assembly still carries tools to drop here.
return {
...assembled,
- tools: assembled.tools.filter(tool => !HIDDEN_TOOLS.includes(tool.name)),
+ ...Array.isArray(assembled.tools) ? { tools: assembled.tools.filter(tool => !HIDDEN_TOOLS.includes(tool.name)) } : {},
sections: assembled.sections.filter(section => !HIDDEN_SECTIONS.has(section.name)),
}
})
@@ -944,6 +946,11 @@ export function install(rt) {
const assembled = await next()
const held = scoped.get(agent.session?.id)
if (held?.unlisted === undefined || held.unlisted.size === 0) return assembled
+ // DSH 0.2.2 collects the scoped tools itself after this waterfall (#814).
+ if (!Array.isArray(assembled.tools)) {
+ held.unlisted.clear()
+ return assembled
+ }
const pending = [...held.unlisted]
// Cleared whatever happens below: the names are offered once, not on
// every step.