From dd965805f6f32ace27c16559327c48a2a8443795 Mon Sep 17 00:00:00 2001 From: Ayman Hamed Date: Mon, 24 Aug 2026 23:52:12 +0300 Subject: [PATCH] Test: pin evictionTargetFraction=1.0 in the protection-toggle test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test verifies keepLatestReadsInline:false, not eviction depth — the hysteresis default (0.5) correctly evicts deeper and broke its stale depth expectation. Caught after merge: the '| tail' pipe swallowed the suite's exit code. Co-Authored-By: Claude Opus 4.8 (1M context) --- Tests/SwiftAgentKitTests/SwiftAgentKitTests.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Tests/SwiftAgentKitTests/SwiftAgentKitTests.swift b/Tests/SwiftAgentKitTests/SwiftAgentKitTests.swift index 11929b9..3f9d70a 100644 --- a/Tests/SwiftAgentKitTests/SwiftAgentKitTests.swift +++ b/Tests/SwiftAgentKitTests/SwiftAgentKitTests.swift @@ -2074,6 +2074,9 @@ private func readCall(_ id: String, path: String) -> AgentToolCall { @Test func testKeepLatestReadsDisabledRestoresOldBehavior() async { let manager = ContextManager(inlineBudgetChars: 900, keepLatestReadsInline: false) + // This test verifies the PROTECTION toggle, not eviction depth — pin the + // hysteresis to evict-just-enough so the depth matches its expectations. + manager.evictionTargetFraction = 1.0 let readResult = "READ_OLD " + String(repeating: "r", count: 300) let messages: [AgentMessage] = [ .user("start"),