Repository navigation
feat(agent): derive the Bot's tools when work is admitted - #6602
Conversation
The Bot kept the tool list it was created with, so a Bot opened by an older build never received tools a newer build added. Derive the list from the coordination policy and the current composition each time work is admitted (a user message, a scheduled wake or a notification), and use that same result for the tool catalog and the standing instructions. Accepted work keeps the list it was admitted with. When it is resumed, the check for the Bot is that the accepted list is still inside the coordination policy, instead of equality with the stored list. Other Sessions keep their explicit selection and their existing checks. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Astro-Han
left a comment
There was a problem hiding this comment.
Automated review notice: This comment was posted by an automated review agent. It is not an independent human review and does not replace one.
Reviewed all six changed files at 3a4560a03cca0be173cf6eb59b769d9eebd42361. I found no confirmed P0–P2 issue in this scope.
The stale-list premise is supported by the existing Bot creation path: it persists the coordination tools available at creation. Fresh message admission now derives the registered Bot's allowed tools from the coordination policy intersected with the installed composition. Direct sends, notification delivery and scheduled dispatch use that result for both the accepted message basis and the Bot instructions. Ordinary sessions retain their configured selection; Bot-only voice/sleep and worker ownership checks remain separate.
Queued and parked work keeps its accepted tool list. The relaxed stored-selection comparison does not remove the existing catalog/binding checks or current permission checks. Consequently, this is not evidence that an arbitrary queued operation can survive an incompatible tool-composition change.
I checked the successful CI run 41608886501 for this exact commit, including the new stale-list regression, Bot identity/delegation tests and frozen-retry checks. The new regression exercises direct admission with a deliberately narrowed persisted list; it does not itself cover that same stale-list setup through notification, scheduled and restart recovery paths. I did not execute Rust tests or a native desktop acceptance run locally. The actual static merge into 0a3473ccc553cea687dc813d48cb5bd0bf9590c3 succeeds.
P3 attribution: the PR identifies Claude Code and the commit includes Co-Authored-By, but it lacks the required Generated-by: Claude Code trailer. Please retain that trailer in the final merged commit. Persisted session metadata still exposes the old list; this change makes the effective Bot selection policy-derived rather than rewriting that metadata.
Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.
Resolve the same effective policy for manual Resume and skill candidates. Extend the existing model-request regression through Stop and Resume, and check standing instructions outside the tool definitions. Generated-by: Maka
Astro-Han
left a comment
There was a problem hiding this comment.
Automated review notice: This comment was posted by an automated review agent. It is not an independent human review and does not replace one.
Reviewed the final c1e202573baf9cdd0f4fe4532b7562a31a2b3504 diff and its increment from my earlier review. The two additional production changes use admitted_tools in manual continuation (owner/execution.rs) and read-only skill candidate selection (owner/skills.rs). Ordinary sessions retain their configured selection. Continuation still rechecks the live session configuration and permissions, and retains its historical prompt and tool protocol.
The extended Bot regression now stops an admitted request, resumes its recorded source and checks both model requests. It also checks the standing instructions in system/developer messages rather than searching the tool definitions. In run 41638930944, that exact regression passed in 3.620 seconds. I read the actual hosted log; I did not run Rust or native desktop tests locally. The earlier limits on notification/scheduled/restart combinations still apply.
The overall run failed: the NSH browser shader test timed out after 20 seconds, and the existing desktop model-menu test could not find the “Choose model” control. I inspected both logs; I have not established that either failure was caused by this Bot change, so I am not reporting them as a demonstrated PR-caused P2. They also mean this final commit did not have an all-green CI run.
I found no new confirmed P0–P2 issue in this increment. The PR is already merged as 0f6a49744636eed22d3296dbb5862652511add78; its eight-file patch matches the reviewed PR patch. The merged commit contains both Generated-by: Claude Code and Generated-by: Maka, resolving the attribution-trailer concern in my earlier review.
Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.
…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]>
* feat(workbench): let the user start the Bot over 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]> * feat(workbench): let the user start the Bot over, keeping the old replies 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]> * test(agent): an archived former Bot accepts no message Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(workbench): show a replaced Bot as read-only history, and date it 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]> * fix(workbench): date a replaced Bot's title as month-day, not by locale Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Summary
A Bot opened by an older build kept the tool list it was created with, so tools a newer build added never reached it. This derives the Bot's tools when work is admitted instead.
Follows the review on #6569: tool upgrades and "start over" are separate, and the upgrade goes first. This PR is only the upgrade; the start-over button stays in #6569 and will be reworked there.
admitted_toolsreturnsCOORDINATION_TOOLSfiltered by the current composition. It is used wherever a message basis is captured for the Bot: a user message (send), a scheduled wake (dispatch) and a notification (notifications, which also carries the worker-finished wake). The tool catalog, the executor check and the standing instructions all read the same result.COORDINATION_TOOLS, instead of equality with the stored list (accepted_tools_match). Other Sessions keep their explicit selection and the existing equality check.None.Open question
The Session still stores the list written at creation. For the Bot it is now ignored by admission, so it is only informational (it is shown in the Session record). I kept it to avoid a stored-model change in this PR. If you would rather drop it for Bot Sessions, I can do that as a follow-up once we agree on how the record should express "policy-derived".
Verification
bot_tools_follow_the_current_composition_not_the_list_stored_at_creation: a Bot whose stored list was cut totodo_read(an older build) is sent a message, and the model's request containsSessionCreate,SessionSend,SendUserandsleep, does not containWorkspaceFile, and the standing instructions nameSessionSend.cargo test -p maka-agent-nativepasses withLANG=en_US.UTF-8. 20 tests timed out under full parallel load on my machine; all 20 pass when rerun with--test-threads=3. Five Bot tests failed on the unchanged base without that locale. clippy-D warningsand nightlyrustfmtare clean.🤖 Generated with Claude Code