The first bot can't be deleted even after another bot is the Chief of Staff

未关闭
#75 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
43/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript
领域
backend

调研方向

Read server/store.ts around deleteBot and server/default-bot.ts around defaultBotPatchRefusal and ensureDefaultBot; trace how the default bot marker and its ledger are updated when a bot is deleted. Check the bot deletion and patch route tests, then add coverage for deleting the former default bot after another bot becomes Chief of Staff. Done means the former default bot can be removed while the current Chief remains protected and the helper ledger behaves as intended.

由索引模型根据 Issue 内容生成。

描述

What happened

The bot this place made first — the starter, marked as the helper (defaultBot) — can be hidden from the sidebar, but it can never be deleted, and that does not change once another bot is the Chief of Staff. Delete answers:

dusk bot can't be deleted or archived. To take it off the sidebar, choose Hide in its menu, …

Verified on an isolated fixture (nothing of mine touched):

Dusk is the first bot, marked defaultBot
PATCH Dusk {sidebarHidden:true}   200     <- Hide from sidebar works
PATCH Dusk {hidden:true}          400     same "can't be deleted or archived" sentence
DELETE Dusk                       409     same sentence
make Bravo chief                  200
(make Charlie chief)              200     Dusk's crown is cleared, as it should be
DELETE Dusk                       409     still refused, chief or not

So the crown is not what blocks it. The refusal keys on the marker, not on the role:

  • server/store.ts:1478 — deleteBot throws for any bot.defaultBot.
  • server/default-bot.ts:29 (defaultBotPatchRefusal, used by server/routes/bot-patch.ts) — hidden: true is refused for the same bots.
  • server/default-bot.ts:145 (ensureDefaultBot) — a place that has had its helper never gets another one made (if (Object.hasOwn(ledger(...), person)) return null), so the marker effectively pins that row for the life of the place.
  • Nothing in the UI can move the marker: takeArrivingDefaultBot moves it only when a move brings another place's helper in.

The Chief's Hide being refused is intended (it is a different guard, bot-patch.ts:447, and I am not asking for it). This is only about the first/former bot.

Why it reads as a bug from here: the first bot is the throwaway starter. People rename it, use it for a while, then set up real bots and move the Chief of Staff; what is left is an ordinary-looking row that refuses Delete and offers only Hide — which keeps the bot, its conversations, its memory, its workspace folder and any routine it owns alive, with no way to remove them.

Steps to reproduce
  1. New install: the starter bot is the only bot and the Chief of Staff.
  2. Make another bot the Chief of Staff (the starter's crown is cleared).
  3. Right-click the starter → Delete: refused with the notice above, whatever the crown says.
  4. Right-click it → Hide from sidebar: works, and it is the only way out the app offers.
Version

0.2.17

Platform

macOS

Engine

No response

Logs or screenshots
Measured: DELETE defaultBot 409, PATCH {hidden:true} 400, PATCH {sidebarHidden:true} 200, before and
after another bot is the Chief.

What would settle it, in order of what the code already supports:
1. Let the marked bot be deleted once the place has another bot: clear the marker with it, and let the
   ledger record that this place's helper is gone (ensureDefaultBot already knows how to adopt an
   existing bot instead of creating one, should the person want a helper again).
2. Or offer "Make … my helper" so the marker can move to another bot, after which the old first bot is
   an ordinary bot and deletes normally.
3. Whatever the rule, the notice should name the helper as the reason — and stop pointing at a settings
   switch that is not in Settings → General (filed separately as #74).
主要语言
TypeScript
星标
277
派生
27
平均合并
2 小时 47 分钟
30 天内合并 PR
1

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

DuskBotAI/duskbot 的其他 Issue

查看 DuskBotAI/duskbot 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。