From c4d7f70ff831cfcdad0f2a6224f9a14f86905de6 Mon Sep 17 00:00:00 2001 From: t Date: Thu, 2 Jul 2026 10:29:53 -0600 Subject: Stage and apply event-field overrides at tool lifecycle boundaries Stage writable event-field overrides by tool call id so they can be applied at the correct point in the turn lifecycle. Capture input overrides from tool_call_complete, capture output overrides from tool_result, and clear staged overrides defensively at turn start and shutdown. Also honor user_message text overrides when starting a turn, add the helper that applies staged overrides to the agent at dispatch boundaries, and cover the behavior with tests for staged input/output overrides. --- src/main.zig | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/main.zig') diff --git a/src/main.zig b/src/main.zig index 86f1cb1..02c0045 100644 --- a/src/main.zig +++ b/src/main.zig @@ -383,6 +383,10 @@ pub fn main(init: std.process.Init) !void { // any extension loads (which `require('panto')`). try rt.installPantoModule(); + // Hand extensions the live session agent (`panto.ext.agent`) so an + // `activate()` can act on the session directly (add_system_message…). + try rt.setExtAgent(agent); + // luv is installed (or already present) at this point; wire the // libuv-driven coroutine scheduler before any extensions get a // chance to register tools that might want to yield. -- cgit v1.3