A team of long-lived bots for DeepSeek Harness, with main bots, bot-to-bot messages and group chats.
Drop the aside's own output cap, use the route's limit
klarkxyaf9142ca40ce
diff --git a/docs/plans/2026-10-21-btw.md b/docs/plans/2026-10-21-btw.mdindex 6bafd2cf..ebb41122 100644--- a/docs/plans/2026-10-21-btw.md+++ b/docs/plans/2026-10-21-btw.md@@ -26,7 +26,7 @@ Bot 之间也有反方向「拉」事实的需求(我需要对方掌握的事### 无工具的调用-- btw 请求与会话自己的请求保持同构:同路由、同思考强度、同工具声明和工具历史,只在末尾追加 btw 问题;输出上限由 btw 自定(答案本应短),其余沿用快照路由的配置。+- btw 请求与会话自己的请求保持同构:同路由、同思考强度、同工具声明和工具历史,只在末尾追加 btw 问题;输出上限同样沿用快照路由的配置——思考与答案共享输出预算,btw 自定的低上限会让思考模型的答案经常在完成前被截断。- 因为带着工具声明,btw 的提示词明确写明「只回答,不要调用任何工具」;host 不执行任何工具:模型返回的工具调用块一律不派发。允许重试一次;第二次仍返回工具调用即失败,卡片显示失败原因。重试的那次调用同样计入用量。- 答案若自称执行了操作,不可信(btw 不会执行任何工具);卡片固定标注「基于目前已有进展的回答,没有执行任何操作」。@@ -61,3 +61,4 @@ Bot 之间也有反方向「拉」事实的需求(我需要对方掌握的事## 变更- 2026-10-21:初稿;第一轮评审修订(快照的工具平衡边界、入口走输入触发机制、快照路由语义、卡片截断与取消规则);第二轮评审修订(请求与会话同构以复用缓存前缀、去掉思考强度降级、群聊/附件/空问题三种认领后拒绝、在飞并发上限每个 Bot 2 个、Bot 对 Bot 的 `ask_bot` 移出本设计另行提案);第三轮评审修订(运行中的回合没有回合尾槽位,在跑卡片改到输入框上方泊位、回合结束后归位;旧分段卡片并入 DS Bot 自己的旧分段渲染;缓存表述降级为「复用前缀、是否命中依提供方」,删去「近乎零成本」;「已落盘」改为「已提交到 Session」;认领后立即受理、后台答题)。待 Issue 与 PR。+- 2026-10-23:评审反馈(#413):去掉 btw 自定的输出上限(2000 token),改用路由自身的上限——思考与答案共享输出预算,自定的低上限会让思考模型的 btw 经常以截断失败收场。卡片每 Bot 20 条的上限维持不变。diff --git a/ds-bot/src/host/btw.js b/ds-bot/src/host/btw.jsindex 523fe374..c030f1d1 100644--- a/ds-bot/src/host/btw.js+++ b/ds-bot/src/host/btw.js@@ -2,7 +2,7 @@// Nothing is written into the Session, and no tool call is ever dispatched.import { randomUUID } from 'node:crypto'import { BlockAssembler } from '@deepseek-ai/dsh-llm'-import { BTW_CARDS_MAX, BTW_CUT, BTW_IN_FLIGHT, BTW_LIMIT, BTW_MAX_TOKENS, BTW_TEXT_MAX } from './constants.js'+import { BTW_CARDS_MAX, BTW_CUT, BTW_IN_FLIGHT, BTW_LIMIT, BTW_TEXT_MAX } from './constants.js'import { headOf } from './text.js'// The mock model recognizes an aside by this first line.@@ -266,8 +266,9 @@ export function install(rt) {}}- // The same route as the conversation, including temperature and stop. The- // aside sets its own output budget. The messages array is tagged for usage.+ // The same route as the conversation, including temperature, stop, and the output+ // budget: thinking shares it, so an aside must not set a small one of its own. The+ // messages array is tagged for usage.async function callModel(snapshot, question, retry, signal) {const messages = rt.tagUsage([...snapshot.messages,@@ -280,7 +281,6 @@ export function install(rt) {messages,toolHistory: snapshot.toolHistory,...(tools ? { tools: [...tools] } : {}),- maxTokens: BTW_MAX_TOKENS,sessionId: snapshot.sessionId,signal,})) assembler.push(chunk)diff --git a/ds-bot/src/host/constants.js b/ds-bot/src/host/constants.jsindex 2977c20c..2fa145d8 100644--- a/ds-bot/src/host/constants.js+++ b/ds-bot/src/host/constants.js@@ -94,7 +94,5 @@ export const BTW_TEXT_MAX = 2000export const BTW_CUT = ' [truncated]'// Aside calls in flight for one Bot. Each one reads the whole conversation.export const BTW_IN_FLIGHT = 2-// Output budget for an aside. The answer is meant to be short; thinking shares it.-export const BTW_MAX_TOKENS = 2000-// Shown when an aside stops because it used that whole budget. The partial answer stays.+// Shown when an aside stops at the route's own output limit. The partial answer stays.export const BTW_LIMIT = 'Answer cut off at the output limit.'diff --git a/ds-bot/test/btw.test.js b/ds-bot/test/btw.test.jsindex 48fabbce..5a47b08f 100644--- a/ds-bot/test/btw.test.js+++ b/ds-bot/test/btw.test.js@@ -5,7 +5,7 @@ import { join } from 'node:path'import { test } from 'node:test'import { createRuntime } from '../index.js'import { BTW_MARKER, normalizeBtwCards, trimToolBoundary } from '../src/host/btw.js'-import { BTW_CARDS_MAX, BTW_CUT, BTW_MAX_TOKENS, BTW_TEXT_MAX } from '../src/host/constants.js'+import { BTW_CARDS_MAX, BTW_CUT, BTW_TEXT_MAX } from '../src/host/constants.js'import { headOf } from '../src/host/text.js'import { fakeContext } from './fake-ctx.js'@@ -246,8 +246,7 @@ test('an aside uses the session route, drops the pending tool call, and writes nassert.equal(request.provider, 'deepseek')assert.equal(request.model, 'aside-model')assert.equal(request.reasoningEffort, 'high')- assert.equal(request.maxTokens, BTW_MAX_TOKENS)- assert.notEqual(request.maxTokens, header.config.maxTokens)+ assert.equal(request.maxTokens, header.config.maxTokens)assert.equal(request.temperature, 0.2)assert.deepEqual(request.stop, ['END'])assert.equal(request.sessionId, 's-now')