using Agent.Core.Logging;using Agent.Core.Ollama;using Xunit;namespace Agent.Core.DesignTests;public class OllamaClientHistoryTests{ [Fact] public void Save_and_load_conversation_round_trip() { string root = CreateTempHistoryRoot(); try { var logger = new Logger(); var client = new OllamaClient(logger, new ChatHistoryStore(root)) { Model = "gemma4" }; client.ClearHistory(); client.History.Add("user", "Hello from design tests"); client.History.Add("assistant", "Hello back", tokens: 4); client.SaveCurrentConversation(); client.StartNewSession(); client.ClearHistory(); Assert.DoesNotContain( client.History, m => !m.Role.Equals("system", StringComparison.OrdinalIgnoreCase)); IReadOnlyList<ChatSessionSummary> sessions = client.ListSavedConversations(); Assert.Single(sessions); Assert.True(client.LoadSavedConversation(1)); Assert.Contains(client.History, m => m.Content.Contains("Hello from design tests", StringComparison.Ordinal)); Assert.Contains(client.History, m => m.Content.Contains("Hello back", StringComparison.Ordinal)); } finally { TryDeleteDirectory(root); } } [Fact] public void LoadSavedConversation_returns_false_for_invalid_index() { string root = CreateTempHistoryRoot(); try { var client = new OllamaClient(new Logger(), new ChatHistoryStore(root)); Assert.False(client.LoadSavedConversation(99)); } finally { TryDeleteDirectory(root); } } private static string CreateTempHistoryRoot() { string path = Path.Combine(Path.GetTempPath(), "AgentCore-DesignTests", Guid.NewGuid().ToString("N")); Directory.CreateDirectory(path); return path; } private static void TryDeleteDirectory(string path) { try { if (Directory.Exists(path)) { Directory.Delete(path, recursive: true); } } catch { } }}
Documentation
Version 3 design tests
Automated checks for chat, history, and Kokoro TTS (sanitizer + optional live speech).
Quick run
python src/Version3/DesignTests/run-design-tests.py
python src/Version3/DesignTests/run-design-tests.py --live
.\src\Version3\DesignTests\run-design-tests.ps1 -Live
What runs
| Suite | Needs network | Covers | |-------|----------------|--------| | ChatHistoryStoreTests | No | Same as V1 history XML | | OllamaClientHistoryTests | No | Client save/load | | KokoroTtsSanitizerTests | No | Markdown/emoji/URL stripping for speech | | OllamaLiveTests | Yes (--live) | Ollama chat | | KokoroTtsLiveTests | Yes (--live) | Kokoro model load + SpeakAsync |
First Kokoro live run may download ~320MB of model weights.
Console video (testers)
Record Version 3 console sessions (chat + TTS + history):
python src/TestManager/test_manager.py record v2 chat-tts --build
See src/TestManager/README.md.
All versions
python src/run-all-design-tests.py
python src/run-all-design-tests.py --live