Open-source AI penetration testing tool to find and fix your app’s vulnerabilities.
Python agentsai-hackingai-penetration-testingai-pentestingai-securityartificial-intelligencebug-bountycode-qualityctf-toolscybersecuritycybersecurity-toolsethical-hackinghackingllm-securityoffensive-securitypenetration-testingpentesting-toolsred-teamingsecuritysecurity-automation
fix(tui): show 'more content available' for view_request over 15 lines (#687)
sean-kim05aec5f1445518
diff --git a/strix/interface/tui/renderers/proxy_renderer.py b/strix/interface/tui/renderers/proxy_renderer.pyindex 6fbbe121..359b494d 100644--- a/strix/interface/tui/renderers/proxy_renderer.py+++ b/strix/interface/tui/renderers/proxy_renderer.py@@ -191,7 +191,7 @@ class ViewRequestRenderer(BaseToolRenderer):if i < len(lines) - 1:text.append("\n")- if has_more or len(lines) > 15:+ if has_more or len(content.split("\n")) > 15:text.append("\n")text.append(" ... more content available", style="dim italic")diff --git a/tests/test_proxy_renderer.py b/tests/test_proxy_renderer.pynew file mode 100644index 00000000..341a1f40--- /dev/null+++ b/tests/test_proxy_renderer.py@@ -0,0 +1,46 @@+"""Tests for the proxy tool TUI renderers."""++from __future__ import annotations++from rich.text import Text++from strix.interface.tui.renderers.proxy_renderer import ViewRequestRenderer+++def _plain(static: object) -> str:+ content = static.content # type: ignore[attr-defined]+ return content.plain if isinstance(content, Text) else str(content)+++def _render(content: str, *, has_more: bool) -> str:+ tool_data = {+ "status": "completed",+ "result": {+ "content": content,+ "has_more": has_more,+ "page": 1,+ "total_lines": len(content.split("\n")),+ },+ }+ return _plain(ViewRequestRenderer.render(tool_data))+++_MARKER = "... more content available"+++def test_more_content_hint_shown_when_over_fifteen_lines() -> None:+ content = "\n".join(f"line{i}" for i in range(30))++ assert _MARKER in _render(content, has_more=False)+++def test_no_more_content_hint_within_fifteen_lines() -> None:+ content = "\n".join(f"line{i}" for i in range(5))++ assert _MARKER not in _render(content, has_more=False)+++def test_more_content_hint_shown_when_has_more_flag_set() -> None:+ content = "\n".join(f"line{i}" for i in range(3))++ assert _MARKER in _render(content, has_more=True)