File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1339,6 +1339,21 @@ impl AgentSession {
13391339 & self . tool_executor
13401340 }
13411341
1342+ /// Register a host-provided dynamic tool into the live session. Enables an
1343+ /// embedding app (e.g. the a3s-code CLI's login-gated `runtime` A3S Runtime
1344+ /// offload tool) to add a native tool at runtime; it enters the LLM's toolset
1345+ /// on the next run (`build_agent_loop` re-snapshots `definitions()` per run),
1346+ /// the same way MCP tools surface after `add_mcp_server`. Idempotent by name.
1347+ pub fn register_dynamic_tool ( & self , tool : Arc < dyn crate :: tools:: Tool > ) {
1348+ self . tool_executor . register_dynamic_tool ( tool) ;
1349+ }
1350+
1351+ /// Remove a previously host-registered dynamic tool by name (e.g. on logout).
1352+ /// No-op if no tool of that name is registered.
1353+ pub fn unregister_dynamic_tool ( & self , name : & str ) {
1354+ self . tool_executor . unregister_dynamic_tool ( name) ;
1355+ }
1356+
13421357 /// Remove an MCP server from this session.
13431358 ///
13441359 /// Disconnects the server and unregisters all its tools from the executor.
You can’t perform that action at this time.
0 commit comments