From 75fd7d7833052383e1b61d4275d12c9a993c02d3 Mon Sep 17 00:00:00 2001 From: T Date: Wed, 27 May 2026 07:30:51 -0600 Subject: separate event for providing tool details OpenAI and Anthropic have tool details (id, name) converge on different timelines. In all cases they are available in `onBlockComplete` which comes with the full block, and previously we had an optional `BlockMeta` argument to `onBlockStart` - the anthropic timeline. We removed the `BlockMeta` from `onBlockStart` since it was always going to be unreliable, and now have an explicit `onToolDetails` instead. This allows us to provide the tool id and name as early as possible from the openai provider (could be in the middle of content deltas), and provide a reliable signal across providers. Also, fix test output. --- libpanto/src/agent.zig | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libpanto/src/agent.zig') diff --git a/libpanto/src/agent.zig b/libpanto/src/agent.zig index 6c970ad..bbcc54c 100644 --- a/libpanto/src/agent.zig +++ b/libpanto/src/agent.zig @@ -580,6 +580,7 @@ const NoopReceiver = struct { const vt: provider_mod.ReceiverVTable = .{ .onMessageStart = noop1, .onBlockStart = noop2, + .onToolDetails = noopToolDetails, .onContentDelta = noop3, .onBlockComplete = noop4, .onMessageComplete = noop5, @@ -587,6 +588,7 @@ const NoopReceiver = struct { }; fn noop1(_: *anyopaque, _: conversation.MessageRole) anyerror!void {} fn noop2(_: *anyopaque, _: provider_mod.ContentBlockType, _: usize) anyerror!void {} + fn noopToolDetails(_: *anyopaque, _: usize, _: []const u8, _: []const u8) anyerror!void {} fn noop3(_: *anyopaque, _: usize, _: []const u8) anyerror!void {} fn noop4(_: *anyopaque, _: usize, _: conversation.ContentBlock) anyerror!void {} fn noop5(_: *anyopaque, _: conversation.Message) anyerror!void {} -- cgit v1.3