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.
This commit is contained in:
teknium1 2026-06-08 01:19:18 -07:00 committed by Teknium
parent de5fe2fa7d
commit 7a5827c8b0

View file

@ -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):