Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ All notable changes to DS Bot are listed here. The format follows [Keep a Change

## [Unreleased]

### Changed

- A question card closes when its Bot finishes a later turn you can see that asks nothing, so a stale card no longer stays on screen until you answer it. A hidden turn that only answers another Bot leaves the card open. A click on a closed card is refused.

### Added

- `void_question` lets a Main Bot withdraw another Bot's open question card. The Bot is told, and a late click on the card is refused.

## [0.2.4] - 2026-10-29

### Added
Expand Down
2 changes: 1 addition & 1 deletion ds-bot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Tested with dsh `0.2.1-rc.4` (Web) and `0.2.0-rc.2` (Web and Desktop).
- **Long-lived Bots**: each Bot is a dsh Session in the "DS Bot" workspace, with its own name, role, instructions and model.
- **Working folders**: a Bot can work in a folder you choose instead of the team workspace, and a group chat can set one folder for all its members there. Pick it in the Bot's settings or details panel or in the group's settings, or ask a Bot (`update_bot`, `update_group`). After a change, the chat goes on in a fresh part that starts in the new folder. When a Bot sets a folder outside the team workspace, or adds a Bot to a group that works in one, it asks for your approval if those Bots can only write in their folder. Folders that hold dsh data (`$DSH_HOME`, the team's data) are refused. The team workspace itself moves in Settings > General > Locations; Bots and groups that work there go on in a fresh part in the new folder, and the old folder keeps its files.
- **Permission presets**: each Bot runs with its own dsh permission preset (Read only, Workspace or Full access), set in its details panel. A group chat can run all its members with one preset there, in place of their own: turn on **Same for every member** under Permissions in the group's settings. Only you set permissions; Bots cannot change them.
- **Bots work together**: `message_bot` sends a message to another Bot, `create_bot` and `update_bot` add and set up Bots (including a profile photo from a local image file or a data URL), and `ask_user` asks you a question without blocking the other Bots. `show_view` draws a card in a Bot's own chat — text, metrics, tables, progress, choices, confirmations and short forms; an interactive card waits for your answer.
- **Bots work together**: `message_bot` sends a message to another Bot, `create_bot` and `update_bot` add and set up Bots (including a profile photo from a local image file or a data URL), and `ask_user` asks you a question without blocking the other Bots. A question card closes when the Bot finishes a later turn you can see that asks nothing, or when a Main Bot withdraws it with `void_question`; a turn that only answers another Bot leaves it open, and a late click on a closed card is refused. `show_view` draws a card in a Bot's own chat: text, metrics, tables, progress, choices, confirmations and short forms; an interactive card waits for your answer.
- **Group chats**: members speak one at a time, and each one reads the latest messages first. A message can `@Name` a member to pass the turn on; type `@` to pick one from a list. **+ → Reference a chat** adds another Bot's chat to a message as context, and in a group the members who answer get it. A member with nothing new to add stays quiet (`[PASS]`). Each member has its own hidden Session per group, so a group never reads a Bot's private chat.
- **Roles and permissions**:

Expand Down
2 changes: 1 addition & 1 deletion ds-bot/src/host/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const AGENT_SESSION_TITLE_MAX = 80
// Desktop profile, so a restriction filters this list down to registered names.
export const TEAM_TOOLS = [
'list_bots', 'message_bot', 'stop_bot', 'create_bot', 'update_bot', 'list_bot_models',
'create_group', 'update_group', 'delete_group', 'post_to_group', 'ask_user', 'show_view',
'create_group', 'update_group', 'delete_group', 'post_to_group', 'ask_user', 'void_question', 'show_view',
'request_secret', 'list_secrets', 'group_relay', 'read_own_chat',
'read_group_chat', 'remember', 'forget', 'recall', 'read_browser',
'list_capabilities', 'save_capability', 'delete_capability',
Expand Down
1 change: 1 addition & 0 deletions ds-bot/src/host/delivery.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export function install(rt) {
if (resumed && role !== 'room') return `[Message from ${fromName} · DeepSeek Harness restarted while you were working on it]`
if (role === 'reply') return `[Reply from ${fromName}${goesOn}]`
if (role === 'stopped') return `[Stopped by ${fromName}]`
if (role === 'voided') return `[Question voided by ${fromName}]`
if (role === 'room') return `[Group chat "${roomName}" · ${note}]`
if (role === 'report') return `[Group chat "${roomName}" · replies to your post${goesOn}]`
if (role === 'kickoff') return '[Bot team setup]'
Expand Down
5 changes: 5 additions & 0 deletions ds-bot/src/host/privacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,11 @@ export function install(rt) {
if (bot) throw closed(bot, 'turns')
return
}
case 'void_question': {
const bot = target(args.bot)
if (bot) throw closed(bot, 'questions')
return
}
case 'attach_capability':
case 'detach_capability': {
const bot = target(args.bot)
Expand Down
3 changes: 2 additions & 1 deletion ds-bot/src/host/prompt.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions ds-bot/src/host/tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,39 @@ export function install(rt) {
},
}))

ctx.tools.register(defineTool({
name: 'void_question',
description: 'Main Bot only. Withdraw the question card another Bot left open for the user, when it no longer applies. The card leaves the screen, a late click on it is refused, and the Bot is told in a new turn.',
parameters: {
bot: { type: 'string', required: true, description: 'Exact Bot name from list_bots' },
reason: { type: 'string', description: 'Why it was voided; the Bot reads this' },
},
output,
async execute(args, exec) {
await rt.load()
const sender = callerBot(exec)
if (sender === undefined || !rt.isMain(sender.id)) refuse('Only a Main Bot can void a question.')
const target = rt.findBot(args.bot)
if (target === undefined) refuse(`No Bot named ${args.bot}. Team: ${Object.values(state.bots).map(bot => bot.name).join(', ')}`)
const chat = rt.chatOf(target.id)
const question = rt.own(state.questions, chat)
if (question === undefined) refuse(`${target.name} has no open question.`)
delete state.questions[chat]
await rt.save()
if (target.id === sender.id) return 'Your question is voided.'
const why = String(args.reason ?? '').trim()
const text = `Your question "${question.question}" is withdrawn, so no answer to it will reach you. Do not act on it.${why ? `
Reason: ${why}` : ''}`
try {
await rt.deliver({ fromId: sender.id, toId: target.id, text, role: 'voided', ...callerRoom(exec) })
} catch (error) {
rt.warn('ds-bot: telling %s its question was voided failed: %s', target.name, error)
return `The question of ${target.name} is voided, but ${target.name} could not be told. Tell it with message_bot.`
}
return `The question of ${target.name} is voided and it has been told.`
},
}))

// Scoped per Bot session, not global: another plugin's global show_view serves
// the sessions ds-bot does not own, while this one shadows it inside them.
const showViewTool = defineTool({
Expand Down
16 changes: 15 additions & 1 deletion ds-bot/src/host/turns.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export function install(rt) {
/** @type {Record<string, string>} */
let activity = {}
const activityOf = (tool) => {
if (/^(message_bot|stop_bot|create_bot|update_bot|create_group|update_group|delete_group|post_to_group)$/.test(tool)) return 'sending'
if (/^(message_bot|stop_bot|void_question|create_bot|update_bot|create_group|update_group|delete_group|post_to_group)$/.test(tool)) return 'sending'
if (tool === 'group_relay') return 'orbit'
if (/search|fetch|browse|browser|read|grep|glob|list/i.test(tool)) return 'searching'
return 'working'
Expand Down Expand Up @@ -408,6 +408,7 @@ export function install(rt) {
entry.joined = []
entry.later = []
entry.steeredAt = undefined
entry.card = state.questions[id]?.id
if (entry.pending !== undefined) {
claimTrigger(id, entry, entry.pending)
entry.pending = undefined
Expand Down Expand Up @@ -539,6 +540,7 @@ export function install(rt) {
case 'turn/end': {
setActivity(id, undefined)
const info = entry.info
const turn = entry.turn
const joined = entry.joined ?? []
// What the group already saw of the turn is not posted again.
const texts = entry.texts.slice(entry.shown)
Expand All @@ -561,6 +563,8 @@ export function install(rt) {
entry.lastCalled = undefined
const later = entry.later ?? []
entry.later = []
const card = entry.card
entry.card = undefined
for (const result of later) {
void rt.deliver({
fromId: result.info.senderSessionId,
Expand All @@ -586,6 +590,16 @@ export function install(rt) {
const wroteCall = failure === undefined && reason?.kind === 'completed' && lastCalled !== true && writesToolCall(lastText)
const retry = wroteCall && info?.retried !== true && !(info?.role === 'room' && stoppedRoomTurns.has(info.exchangeId))
if (retry) void retryWrittenCall(id, info).catch(error => rt.warn('ds-bot: asking %s to run its written tool call failed: %s', id, error))
// A finished turn the user could see that asked nothing has moved on, so the card
// it left standing is stale. `card` is the card this turn opened on: a turn that
// asked has another id, or none here at all. A hidden Bot-to-Bot turn shows the user
// nothing, so its card still waits for them. A fresh part's handoff turn carries its
// card over; a failed or stopped turn said nothing about it.
const hidden = (state.exchangeTurns[id] ?? []).includes(turn)
if (card !== undefined && state.questions[id]?.id === card && reason?.kind === 'completed' && !retry && !hidden && info?.handoff !== true) {
delete state.questions[id]
void rt.save().catch(() => {})
}
const replyText = () => {
const reply = (wroteCall ? texts.map(stripWrittenCalls) : texts).join('\n\n').trim()
return wroteCall && reply === '' ? 'Tried to run a tool but wrote the call as text, so it did not run.' : reply
Expand Down
1 change: 1 addition & 0 deletions ds-bot/test/install.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ test('apply registers listeners, tools, and effects in a fixed order', (t) => {
'tool delete_group',
'tool post_to_group',
'tool ask_user',
'tool void_question',
// show_view is scoped per Bot agent, not a global registration.

'tools guard',
Expand Down
Loading