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>
This commit is contained in:
mysoul12138andClaude Opus 4.7 committed 2026-05-29 16:12:05 +08:00
1 parent b476126cb9
commit 7f63a1ce71
1 file changed
+11
+11
View File
@@ -0,0 +1,11 @@
"""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