summaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/main.zig b/src/main.zig
index ff00689..46b6320 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -365,21 +365,16 @@ pub fn main(init: std.process.Init) !void {
);
}
- // The tool registry is owned here and referenced by the active config
- // snapshot. Extensions register their tool source into it *after* the
- // agent is built; the agent holds a `*const Config` pointing at this
- // registry, so in-place registration before the first turn is visible.
- var registry = panto.ToolRegistry.init(alloc);
- defer registry.deinit();
-
// Assemble the active configuration snapshot and build the agent now,
// before luarocks bootstrap and extension loading. The agent adopts the
// store (for free persistence) and the resumed conversation (or starts
- // fresh). System-prompt seeding/reconciliation below runs *through* the
- // agent so those entries persist.
+ // fresh). The agent owns its own tool registry (post-R1); extensions
+ // register their tool source onto it *after* the agent is built but
+ // before the first turn, so in-place registration is visible.
+ // System-prompt seeding/reconciliation below runs *through* the agent
+ // so those entries persist.
const active_config: panto.config.Config = .{
.provider = provider_config,
- .registry = &registry,
.compaction = compaction_cfg,
};
var agent = panto.agent.Agent.init(
@@ -468,7 +463,7 @@ pub fn main(init: std.process.Init) !void {
std.log.debug("extensions: {d} tool(s) registered", .{n_ext_tools});
if (n_ext_tools > 0) {
- try registry.registerSource(rt.toolSource());
+ try agent.registerToolSource(rt.toolSource());
}
// Resolve the compaction system prompt (COMPACTION.md across layers,