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/root.zig | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'libpanto/src/root.zig') diff --git a/libpanto/src/root.zig b/libpanto/src/root.zig index 5dacfef..ff02d4d 100644 --- a/libpanto/src/root.zig +++ b/libpanto/src/root.zig @@ -1,3 +1,5 @@ +const std = @import("std"); + pub const conversation = @import("conversation.zig"); pub const provider = @import("provider.zig"); pub const agent = @import("agent.zig"); @@ -25,7 +27,15 @@ const anthropic_messages_json = @import("anthropic_messages_json.zig"); const provider_anthropic_messages = @import("provider_anthropic_messages.zig"); test { - const std = @import("std"); + // Test contract: deliberate error-path tests should not produce visible + // log output. Library code logs at `.err` for genuine production failures + // and `.warn` for expected-failure paths exercised by tests; the test + // runner's logger gates on `std.testing.log_level`, which defaults to + // `.warn`. Raising it to `.err` silences expected warnings without + // changing production behavior. Anything that *should* be visible in a + // passing test must use `std.debug.print` or assert via the testing API. + std.testing.log_level = .err; + std.testing.refAllDecls(@This()); std.testing.refAllDecls(openai_chat_json); std.testing.refAllDecls(provider_openai_chat); -- cgit v1.3