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: Address code review feedback on tool format normalization
0xallamb9dcf7f63d68
diff --git a/strix/llm/llm.py b/strix/llm/llm.pyindex 507e8c82..d941361b 100644--- a/strix/llm/llm.py+++ b/strix/llm/llm.py@@ -145,11 +145,9 @@ class LLM:if delta:accumulated += deltaif "</function>" in accumulated or "</invoke>" in accumulated:- for end_tag in ("</function>", "</invoke>"):- pos = accumulated.find(end_tag)- if pos != -1:- accumulated = accumulated[: pos + len(end_tag)]- break+ end_tag = "</function>" if "</function>" in accumulated else "</invoke>"+ pos = accumulated.find(end_tag)+ accumulated = accumulated[: pos + len(end_tag)]yield LLMResponse(content=accumulated)done_streaming = 1continuediff --git a/strix/llm/utils.py b/strix/llm/utils.pyindex b8666617..1ba6a5f6 100644--- a/strix/llm/utils.py+++ b/strix/llm/utils.py@@ -3,8 +3,8 @@ import refrom typing import Any-_INVOKE_OPEN = re.compile(r'<invoke\s+name=["\']([^"\']+)["\']\s*>')-_PARAM_NAME_ATTR = re.compile(r'<parameter\s+name=["\']([^"\']+)["\']\s*>')+_INVOKE_OPEN = re.compile(r'<invoke\s+name=["\']([^"\']+)["\']>')+_PARAM_NAME_ATTR = re.compile(r'<parameter\s+name=["\']([^"\']+)["\']>')_FUNCTION_CALLS_TAG = re.compile(r"</?function_calls>")_QUOTED_FUNCTION = re.compile(r"""<function\s*=\s*['"]([^"']+)['"]\s*>""")_QUOTED_PARAMETER = re.compile(r"""<parameter\s*=\s*['"]([^"']+)['"]\s*>""")