Files
hermes-webui/tests/test_tool_snippet_limit_parity.py
mysoul12138andClaude Opus 4.7 7f63a1ce71 Add regression test for JS/Python snippet limit parity
Prevents the JS slice(0,N) and Python _TOOL_RESULT_SNIPPET_MAX from
drifting apart again.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 16:12:05 +08:00

12 lines
417 B
Python

"""Regression test: JS tool-result snippet limit matches the Python backend limit."""
from pathlib import Path
REPO = Path(__file__).resolve().parent.parent
def test_tool_snippet_limit_parity():
py = (REPO / "api" / "streaming.py").read_text(encoding="utf-8")
js = (REPO / "static" / "ui.js").read_text(encoding="utf-8")
assert "_TOOL_RESULT_SNIPPET_MAX = 4000" in py
assert ".slice(0,4000)" in js