fix: one tool-set recipe per session, so a tool cannot vanish between rounds
Nightly Build / build (push) Successful in 7m36s
Nightly Build / build (push) Successful in 7m36s
Two "unknown tool (not in this turn's tool set)" failures, one disease: the turn's tool set was rebuilt from a different recipe depending on which entry point happened to drive it. A sub-agent got `ask_user_clarification`, `execute_subtask` and `activate_tools` and nothing else — while `agents/common/tools.md` and every reporting agent's prompt tell it to register its output with `update_scratchpad`. The child could see the scratchpad injected into its context but had no way to write to it. It now gets the scratchpad and todos tools, on the parent's `scratchpad_sid`: one blackboard per session, as the surrounding code already declared. `show_file_to_user` was injected per message by the WS handler, while `resume_session` and `resolve_pending_call` rebuilt the list with `execute_task` alone. So approving a card, or reconnecting mid-turn, continued the *same* conversation with the tool silently gone. There is now a single recipe, `ChatHub::session_interface_tools`, used by all three paths and fed by a builder the shell installs once through `Skald::set_interface_tools_builder`: the core keeps owning the tool, the shell keeps owning the policy of who gets it — Telegram still does not, since it cannot act on OpenFile.
This commit is contained in:
@@ -26,7 +26,9 @@ use crate::clarification::ClarificationManager;
|
||||
use crate::llm::LlmManager;
|
||||
use crate::llm::logging::RequestLogTarget;
|
||||
use crate::loop_adapters::activation::SkaldToolActivator;
|
||||
use crate::loop_adapters::builtins::{SkaldAskUserTool, SkaldHumanChannel};
|
||||
use crate::loop_adapters::builtins::{
|
||||
SkaldAskUserTool, SkaldHumanChannel, UpdateScratchpadTool, WriteTodosTool,
|
||||
};
|
||||
use crate::loop_adapters::history::SqliteHistory;
|
||||
use crate::loop_adapters::prefix_cache::PrefixCache;
|
||||
use crate::loop_adapters::runtime::LoopConfig;
|
||||
@@ -217,6 +219,18 @@ impl AgentCatalog for SkaldAgentCatalog {
|
||||
scope.session_id,
|
||||
Some(child_frame.get()),
|
||||
)))));
|
||||
// The blackboard and the checklist. Both are *told* to sub-agents by the
|
||||
// prompts (`agents/common/tools.md`, and every reporting agent ends with
|
||||
// "register your report with `update_scratchpad`"), and the scratchpad is
|
||||
// injected into a child's context — so leaving the writers out of the
|
||||
// child's tool set made a documented instruction unexecutable: the model
|
||||
// called them and got "unknown tool". `scratchpad_sid` is the parent's,
|
||||
// deliberately (see the context above): one blackboard per session.
|
||||
native.push(Arc::new(UpdateScratchpadTool::new(
|
||||
self.pool.clone(),
|
||||
scope.scratchpad_sid,
|
||||
)));
|
||||
native.push(Arc::new(WriteTodosTool));
|
||||
|
||||
let toolset: Arc<dyn agent_loop::tool::ToolSet> = Arc::new(
|
||||
SkaldToolSet::new(
|
||||
|
||||
Reference in New Issue
Block a user