From 7a5827c8b029bc43aa6f0cbf631bb458aa4d8990 Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Mon, 8 Jun 2026 01:19:18 -0700 Subject: [PATCH] test: repoint percentage-clamp source guard to gateway/slash_commands.py test_gateway_run_clamped read gateway/run.py asserting the /usage stats handler clamps pct with min(100, ...). That handler moved to gateway/slash_commands.py in this PR's extraction; repoint the guard so it still fires on clamp removal. tests/run_agent/ + tests/gateway/ 8024 passed / 0 failed. --- tests/run_agent/test_percentage_clamp.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/run_agent/test_percentage_clamp.py b/tests/run_agent/test_percentage_clamp.py index fcb66c5bbbf..ca407ef8dda 100644 --- a/tests/run_agent/test_percentage_clamp.py +++ b/tests/run_agent/test_percentage_clamp.py @@ -81,10 +81,12 @@ class TestSourceLinesAreClamped: return f.read() def test_gateway_run_clamped(self): - src = self._read_file("gateway/run.py") + # The /usage stats handler was extracted from gateway/run.py into + # gateway/slash_commands.py (god-file decomposition Phase 3b). + src = self._read_file("gateway/slash_commands.py") # Check that the stats handler has min(100, ...) assert "min(100, ctx.last_prompt_tokens" in src, ( - "gateway/run.py stats pct is not clamped with min(100, ...)" + "gateway/slash_commands.py stats pct is not clamped with min(100, ...)" ) def test_cli_clamped(self):