From 027cea2f2565e91ef64a2a001e7cbe487a9a34ad Mon Sep 17 00:00:00 2001 From: 0xallam Date: Fri, 20 Feb 2026 08:26:44 -0800 Subject: [PATCH] fix: Handle stray quotes in tag names and enforce parameter tags in prompt --- strix/agents/StrixAgent/system_prompt.jinja | 8 ++++++++ strix/llm/utils.py | 11 ++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/strix/agents/StrixAgent/system_prompt.jinja b/strix/agents/StrixAgent/system_prompt.jinja index bcc1359..36c8850 100644 --- a/strix/agents/StrixAgent/system_prompt.jinja +++ b/strix/agents/StrixAgent/system_prompt.jinja @@ -328,6 +328,9 @@ WRONG formats — NEVER use these: - ... - {"tool_name": {"param_name": "value"}} - ```...``` +- value_without_parameter_tags + +EVERY argument MUST be wrapped in ... tags. NEVER put values directly in the function body without parameter tags. This WILL cause the tool call to fail. Do NOT emit any extra XML tags in your output. In particular: - NO ... or ... blocks @@ -337,6 +340,11 @@ If you need to reason, use the think tool. Your raw output must contain ONLY the Notice: use NOT , use NOT , use NOT . +Example (terminal tool): + +nmap -sV -p 1-1000 target.com + + Example (agent creation tool): Perform targeted XSS testing on the search endpoint diff --git a/strix/llm/utils.py b/strix/llm/utils.py index 1ba6a5f..8ab1693 100644 --- a/strix/llm/utils.py +++ b/strix/llm/utils.py @@ -6,8 +6,7 @@ from typing import Any _INVOKE_OPEN = re.compile(r'') _PARAM_NAME_ATTR = re.compile(r'') _FUNCTION_CALLS_TAG = re.compile(r"") -_QUOTED_FUNCTION = re.compile(r"""""") -_QUOTED_PARAMETER = re.compile(r"""""") +_STRIP_TAG_QUOTES = re.compile(r"<(function|parameter)\s*=\s*([^>]*?)>") def normalize_tool_format(content: str) -> str: @@ -27,11 +26,9 @@ def normalize_tool_format(content: str) -> str: content = _PARAM_NAME_ATTR.sub(r"", content) content = content.replace("", "") - content = _QUOTED_FUNCTION.sub(r"", content) - content = _QUOTED_PARAMETER.sub(r"", content) - - content = re.sub(r"", content + ) STRIX_MODEL_MAP: dict[str, str] = {