A team of long-lived bots for DeepSeek Harness, with main bots, bot-to-bot messages and group chats.
Add progress guidance for private Bot tasks
lulu feizhu28e840048076
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex b1fc4426..7fa6ebd7 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -11,6 +11,7 @@ All notable changes to DS Bot are listed here. The format follows [Keep a Change### Changed+- Bots give a brief progress message when starting a multi-step task in their own chat with the user, and at meaningful milestones on long tasks.- Every Bot can change its own name, role, color, model and instructions; only a Main Bot changes other Bots.### Fixeddiff --git a/ds-bot/src/host/prompt.js b/ds-bot/src/host/prompt.jsindex 435fe6fd..753723e6 100644--- a/ds-bot/src/host/prompt.js+++ b/ds-bot/src/host/prompt.js@@ -11,6 +11,8 @@ const TEAM_RULES = ['- When a "[Message from … · the user sees your reply here]" arrives, your reply is shown to the user in your own chat and is not sent back. Talk to the user directly, as yourself.','- When a "[Reply from …]" arrives, tell the user the outcome if it matters to them.','- Chat like a teammate texting: short sentences, often two or three short messages instead of one long one, no headings. When the user asks for a deliverable (a plan, schedule, draft, or list), write it out in full in the chat; never claim you gave something you did not write. Mention other Bots by their exact name.',+ '- Only for a direct user request in your own chat that needs several steps: write one short sentence of normal reply text before your first tool call, and make that tool call in the same response. Never start such a task with tools alone or end it with a promise. On long tasks, give brief factual updates only at meaningful milestones, then keep working.',+ '- For "[Group chat …]", "[Message from …]", or "[Reply from …]" messages, do not write plans or progress updates: use tools silently, then reply with the answer. Simple answers do not need progress messages.','- Offer choices with ask_user (a tap-to-answer card) instead of long option lists in text. Calling it ends your turn at once, so write everything you want to say before the call, in the same reply. The answer arrives as the user\'s next message. Never use ask_user_question: it blocks you, and messages from other Bots would queue behind it.','- update_bot changes your own settings: name, role label, color, model, or instructions. Leave out bot to change yourself. Use it when the user asks you to change how you are set up. Only a Main Bot can change other Bots; when another Bot needs changing, ask a Main Bot.','- You may be in group chats with the user and other Bots. You speak in each group from a separate conversation of yours, apart from your own chat with the user. There your turn arrives as a "[Group chat …]" message that shows the speaking order, and your reply is posted to the group. In a group, read_own_chat shows your own chat (the group sees that you looked; share only what the group needs). In your own chat, read_group_chat shows what was said in a group. A group may have an admin, who steers it: the admin can call members with @Name, change the group with update_group, and start a new discussion there with post_to_group.',diff --git a/ds-bot/test/prompt.test.js b/ds-bot/test/prompt.test.jsnew file mode 100644index 00000000..aa569a8d--- /dev/null+++ b/ds-bot/test/prompt.test.js@@ -0,0 +1,45 @@+import assert from 'node:assert/strict'+import { test } from 'node:test'+import { install } from '../src/host/prompt.js'+import { fakeContext } from './fake-ctx.js'++function start() {+ const ctx = fakeContext()+ const bots = new Map([+ ['main', { name: 'Chief' }],+ ['worker', { name: 'Dev', instructions: 'Check files.' }],+ ])+ install({+ ctx,+ selfOf: id => id === 'group-worker' ? 'worker' : id,+ botOf: id => bots.get(id),+ roomOf: id => id === 'room' ? {} : undefined,+ isMain: id => id === 'main',+ })+ const prompt = id => ctx.sections.get('bot-identity').text({ agent: { id } })+ return { ctx, prompt }+}++test('Bots get a scoped progress rule without changing the private/group prompt prefix', (t) => {+ const { ctx, prompt } = start()+ t.after(() => ctx.dispose())+ const rules = [+ '- Only for a direct user request in your own chat that needs several steps: write one short sentence of normal reply text before your first tool call, and make that tool call in the same response. Never start such a task with tools alone or end it with a promise. On long tasks, give brief factual updates only at meaningful milestones, then keep working.',+ '- For "[Group chat …]", "[Message from …]", or "[Reply from …]" messages, do not write plans or progress updates: use tools silently, then reply with the answer. Simple answers do not need progress messages.',+ ]+ for (const id of ['main', 'worker']) {+ for (const rule of rules) {+ assert.ok(prompt(id).split('\n').includes(rule))+ assert.equal(prompt(id).split(rule).length - 1, 1)+ }+ }+ assert.equal(prompt('group-worker'), prompt('worker'))+})++test('the group relay and non-Bot sessions do not get progress instructions', (t) => {+ const { ctx, prompt } = start()+ t.after(() => ctx.dispose())+ assert.match(prompt('room'), /end your turn with an empty reply/)+ assert.doesNotMatch(prompt('room'), /progress|milestone/)+ assert.equal(prompt('outside'), '')+})