fix: reconcile typed history with run exits

This commit is contained in:
2026-08-27 15:12:05 +09:00
parent ec798c58d7
commit 1515a2fb86
11 changed files with 144 additions and 195 deletions
+4 -4
View File
@@ -9,8 +9,8 @@ use std::path::Path;
use std::sync::Arc;
use std::sync::atomic::{AtomicUsize, Ordering};
use agen::Engine;
use agen::tool::{Tool, ToolDefinition, ToolError, ToolMeta, ToolOutput};
use agen::{Engine, History};
use async_trait::async_trait;
use common::MockLlmClient;
@@ -134,7 +134,7 @@ async fn test_engine_simple_text_response() {
let client = MockLlmClient::from_fixture(&fixture_path).unwrap();
let engine = Engine::new(client);
let mut history: History = History::new();
let mut history = agen::History::new();
// Send a simple message (Mutable::run consumes self, returns tuple)
let result = engine.run(&mut history, "Hello").await;
@@ -160,7 +160,7 @@ async fn test_engine_tool_call() {
let client = MockLlmClient::from_fixture(&fixture_path).unwrap();
let mut engine = Engine::new(client);
let mut history: History = History::new();
let mut history = agen::History::new();
// Register tool
let weather_tool = MockWeatherTool::new();
@@ -202,7 +202,7 @@ async fn test_engine_with_programmatic_events() {
let client = MockLlmClient::new(events);
let engine = Engine::new(client);
let mut history: History = History::new();
let mut history = agen::History::new();
// Mutable::run consumes self, returns tuple
let result = engine.run(&mut history, "Greet me").await;