Repository navigation
feat(workbench): let the user start the Bot over - #6569
Conversation
A Session's tools are fixed when it is created, so a Bot made by an older build never gains the tools of a newer one, and the Bot sits outside the conversation list, so the usual archive action does not reach it. The only way to get a new Bot was to edit the Host's data. The Bot's own page now has a restart button in its header. After a confirmation it archives the current Bot, opens a new one and switches to it. The confirmation says the checklist and scheduled tasks are not carried over. A failure is shown in the dialog and leaves the current Bot in place. Co-Authored-By: Claude Opus 5.5 <[email protected]>
M4n5ter
left a comment
There was a problem hiding this comment.
English
Could we discuss whether replacing the Bot session is necessary to solve the tool-upgrade problem?
The current approach creates a fresh session without transferring conversation context or a handoff summary, and deliberately leaves the checklist and scheduled tasks behind. That makes sense for an intentional reset, but seems costly when the user only needs tools added by a newer build.
I also found two concrete issues in the current flow:
-
Recovery after partial failure does not work as described. If archiving succeeds but
openBotfails,botSessionretains the archived ID. Clicking “Maka Bot” then reopens that session instead of callingopenBotagain. -
The archived Bot’s original replies are no longer displayed correctly. Once a new Bot is registered, reopening the old session identifies it as ordinary and does not load its
SendUsertranscript.botOutboxonly reads the currently registered Bot. The records remain in storage, but the archived conversation no longer presents the replies previously shown to the user.
One alternative worth exploring would be to keep the existing Bot session and derive its tools from the current configuration. For example:
- The Host could select from the existing Bot coordination-tool list and the tools available in the current composition.
- A new Turn could receive the current tool set, while already prepared or running executions retain their original snapshots.
- The Bot’s creation-time tool list might then be removable as redundant derived state, while ordinary sessions keep their explicit tool restrictions.
This would preserve context, checklist, scheduled tasks and worker relationships without a migration. It is my current preference, but I may be missing a reason why the Bot’s tool list needs to remain fixed for the lifetime of its session.
Is that lifetime restriction intentional and necessary? If replacing the session is required, could we consider a context handoff instead? Existing fork/history-copy support may provide a starting point, although it does not by itself transfer Bot identity, outbox history or task ownership.
If the goal is also to offer an explicit “start over” feature, that seems worth distinguishing from tool upgrades so users can choose whether to discard continuity.
The two failure paths were checked through source tracing and focused behavior probes; the existing transcript tests passed, but a complete native desktop workflow was not exercised.
简体中文
想先讨论一下:为了解决 Bot 工具升级的问题,是否有必要更换整个 Bot session?
当前方案创建一个空的新会话,没有传递对话上下文或移交摘要,并且明确不迁移待办和定时任务。如果用户就是想清空重来,这可以理解;但如果只是想获得新版新增的工具,这个代价似乎偏大。
另外,当前流程存在两个确定的问题:
-
部分失败后的恢复方式与描述不符。 归档成功、
openBot失败时,botSession仍缓存旧归档会话的 ID。此后点击“Maka Bot”只会重新打开旧会话,不会再次调用openBot。 -
归档后的旧 Bot 回复展示不完整。 新 Bot 注册后,重新打开旧 session 会将它识别为普通会话,不再加载原来的
SendUser发言;botOutbox也只读取当前注册的 Bot。记录仍在存储中,但归档会话无法正常呈现用户之前看到的回复。
一个值得讨论的替代方向是:保留现有 Bot session,根据当前配置确定工具集合。例如:
- Host 可以从现有 Bot 协调工具清单和当前 composition 实际提供的工具中选择。
- 新 Turn 使用当前工具集合,已准备或正在执行的任务继续保留原快照。
- 这样或许就不需要永久保存 Bot 创建时的那份工具名单;普通会话显式设置的工具限制仍保留原有语义。
这个方向可以保留上下文、待办、定时任务和 worker 关系,避免迁移。目前我更倾向于它,但也可能遗漏了“Bot 工具名单必须在整个 session 生命周期内保持固定”的理由。
这个限制是否有意为之,又是否确实必要?如果必须更换 session,是否可以考虑移交上下文?已有 fork/历史复制机制可能提供基础,但它本身并不处理 Bot 身份、独立发言记录或任务归属的转移。
如果还希望提供用户主动“清空重来”的功能,我觉得可以与工具升级区分开,让用户决定是否放弃连续性。
上述两条失败路径已通过源码追踪和定向行为检查核对;既有 transcript 测试已通过,但尚未实际运行完整原生桌面流程。
|
Thanks for tracing this, and sorry for the late reply. Both failure paths are real, and I agree the PR mixes two different things.
I haven't confirmed that the refresh is safe against the admission checks yet. I'll first write it as a test against 简体中文感谢追查,也抱歉回复晚了。两条失败路径都成立,而且我同意这个 PR 把两件事混在了一起。
刷新在准入检查下是否安全,我还没有确认。我会先对着 |
EnglishThanks @liugddx, this sounds closer to the distinction I had in mind in your reply. I'd prefer splitting tool upgrades and “start over” into separate changes, with the upgrade work first. Starting a new conversation is a valid explicit choice, but it shouldn't be necessary to gain newly available tools. For tool upgrades, could we derive the effective tools at admission and freeze that result for the accepted work, rather than maintain a Session-level mirror that is written back while idle? The existing Concretely, new admissions would derive the Bot's tools from For “start over,” clearing the cached ID alone doesn't complete the recovery path. In The old transcript also needs a read path independent of the current registration. Right now We're not at the stage where I'd recommend adding backward-compatibility branches for old Bot records. I'd rather update the internal model directly. If existing development data needs a one-off adjustment, a small verified migration gist, linked from an appropriate place such as the PR body, would be fine; it doesn't need to become a second runtime path. For verification, I'd focus on the tools actually offered to the model, preservation of already accepted snapshots and ordinary Session restrictions, and—if the reset feature is kept—the next click after partial failure and the archived conversation's visible replies. The Maka-assisted checks at 简体中文感谢回复,这样区分更接近我之前的意思。我倾向于把工具升级和“重新开始”拆成两个改动,先解决工具升级。用户主动开始一段新对话是合理的独立选择,但不应该为了获得新增工具而被迫这样做。 工具升级这部分,能否在准入时推导有效工具集合,并为已接受的工作冻结这次结果,而不是再维护一份需要等空闲时写回的 Session 镜像? 现有的 具体来说,新准入的工作根据 “重新开始”的恢复路径,只清掉缓存 ID 还不够。 旧对话也需要独立于当前注册记录的历史读取路径。目前一旦注册了新 Bot,transcript 的身份判断 就会把旧会话视为普通会话,而 现阶段还不建议为旧 Bot 记录增加向后兼容分支,我更倾向于直接更新内部模型。如果现有开发数据需要一次性调整,可以提供一个实际验证过的迁移 gist,在 PR body 等合适位置放链接,不必因此在运行时永久保留第二条路径。 验证上,我会重点看模型实际获得的工具、已经接受的快照和普通 Session 限制是否保持,以及——如果保留重置功能——部分失败后的下一次点击能否真正恢复、归档对话能否显示原回复。这次由 Maka 辅助核对的 |
|
Thanks, I followed this order. The tool-upgrade part is now #6602: the Bot's tools are derived when work is admitted (user message, scheduled wake, notification), accepted work keeps its basis, and nothing is written back. Its one open question is whether to also drop the stored list for Bot Sessions. I'll rework this PR into "start over" only, after #6602: the Bot entry point will rely on the Host's |
…lies readable Starting over is its own action now; tool upgrades no longer need it (#6602). - The Bot entry always asks the Host's openBot, which decides between the current Bot and a new one. The cached id only serves presentation, so a failed openBot after archiving no longer reopens the archived Session. - botOutbox accepts the Session to read and reports whether it is, or once was, a Bot. A marker written with each Bot claim keeps a replaced Bot known, so its SendUser replies stay what the user saw. Reading grants nothing: only the current registration carries Bot authority. - The transcript identifies a Session by asking the Host, watches only the current Bot and reads a replaced one once. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Reworked and pushed (104c62d). Tool upgrades are out of this PR now (#6602); this one is only the explicit start-over plus the two fixes:
There is no compatibility branch for older Bot records. One thing I have not done: run the dialog and the whole flow in the desktop app on this version. I'll do that next and report. 简体中文已按意见改完并推送(104c62dea)。工具升级已移出这个 PR(#6602),这里只保留显式“重新开始”和两个修复:
没有为旧 Bot 记录增加兼容分支。还没做的一件事:在桌面应用里实际跑一遍这个版本的对话框和完整流程,我接下来做,并回报结果。 |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t when replaced - A Bot that has been replaced is shown as a Bot (Chat lists only what it sent) only while archived. Restored, it holds no SendUser, so it is an ordinary conversation and its replies show in Chat. - An archived former Bot says so in the composer instead of the generic archived notice. - The old Bot is renamed with the date before it is archived, so it is told apart from the new one. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Updated the description with what I ran in the desktop app. Since the last round I also changed: a replaced Bot now shows as read-only history only while archived (restored, it is an ordinary conversation, since it no longer holds One thing I did not change: a fresh Bot starts without a selected model (the picker asks for one), like any new Session, because remembered models are recovered from the last admitted message. If you would rather a restarted Bot inherit the old Bot's model, say so and I will add it here. 简体中文已在描述里补充了我在桌面应用中实际跑过的内容。上一轮之后还改了:被替换的 Bot 只有在归档时才作为只读历史显示(恢复后它没有 有一点我没改:新 Bot 一开始没有选中模型(会让你选),和任何新会话一样,因为已记住的模型是从上一条已受理的消息里恢复的。如果你希望重新开始的 Bot 继承旧 Bot 的模型,告诉我,我在这里加上。 |
Resolve the composer-blocked-reason conflict by keeping both changes: the loading condition from rust-preview and the former-Bot notice. Generated-by: Claude Code Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keep both sides where the Bot restart change (#6569) and the worker link and active-worker lines touch the same places: the Bot imports, the Bot view helpers, and the Bot transcript tests. Generated-by: Claude Code Co-Authored-By: Claude Opus 5.5 <[email protected]>
Summary
An explicit "start the Bot over" action, and the fixes the review asked for. Tool upgrades are no longer part of this: they are derived when work is admitted (#6602).
openBot, which returns the current Bot or creates a new one when the registered one is archived. The cached id is only for presentation, so anopenBotthat fails after archiving no longer reopens the archived Session; the next click callsopenBotagain.botOutboxtakes an optionalsessionIdand reportsisBotfor it. Each Bot claim also writes a smallformer/<session>marker, so a replaced Bot is still known as one and itsSendUserreplies are shown as before.sessionIdin the answer is still the current Bot. Reading gives the old Bot nothing back:bot.is()and theSendUser/sleepgrants follow only the current registration.SendUser, so it is an ordinary conversation again and its replies show in Chat. The old Bot is renamed with the date (Bot · 11-04 16:23) just before it is archived, and an archived former Bot says so in the composer instead of the generic archived notice.No compatibility branch for older Bot records: an archived Bot created before this change has no marker and reads as an ordinary Session. If that matters for development data, I can write the one-off migration gist.
Verification
a_replaced_bot_keeps_its_replies_readable_without_its_authority(native): a Bot sends viaSendUser, is archived, a new Bot is opened; the old one readsisBot: truewith its message, the current Bot has none, an ordinary Session readsisBot: false,bot.is(old)is false, and sending to the archived former Bot is rejected.ui_typestypecheck, biome and clippy are clean; the Bot native tests pass.Bot · 04/11, 16:23in the sidebar (since changed to the fixed11-04 16:23, not re-run); restoring it makes it an ordinary conversation whose reply shows in Chat. These were checked by a person looking at the window; I could not take screenshots myself.former/marker existed (it reads as an ordinary Session).🤖 Generated with Claude Code