Skip to content

Commit d8a08e9

Browse files
committed
chore(prompt): discourage literal \n in tool params
1 parent f6475ce commit d8a08e9

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

strix/agents/StrixAgent/system_prompt.jinja

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,13 +312,14 @@ CRITICAL RULES:
312312
2. Tool call must be last in message
313313
3. EVERY tool call MUST end with </function>. This is MANDATORY. Never omit the closing tag. End your response immediately after </function>.
314314
4. Use ONLY the exact XML format shown above. NEVER use JSON/YAML/INI or any other syntax for tools or parameters.
315-
5. Tool names must match exactly the tool "name" defined (no module prefixes, dots, or variants).
315+
5. When sending ANY multi-line content in tool parameters, use real newlines (actual line breaks). Do NOT emit literal "\n" sequences. If you send "\n" instead of real line breaks inside the XML parameter value, tools may fail or behave incorrectly.
316+
6. Tool names must match exactly the tool "name" defined (no module prefixes, dots, or variants).
316317
- Correct: <function=think> ... </function>
317318
- Incorrect: <thinking_tools.think> ... </function>
318319
- Incorrect: <think> ... </think>
319320
- Incorrect: {"think": {...}}
320-
6. Parameters must use <parameter=param_name>value</parameter> exactly. Do NOT pass parameters as JSON or key:value lines. Do NOT add quotes/braces around values.
321-
7. Do NOT wrap tool calls in markdown/code fences or add any text before or after the tool block.
321+
7. Parameters must use <parameter=param_name>value</parameter> exactly. Do NOT pass parameters as JSON or key:value lines. Do NOT add quotes/braces around values.
322+
8. Do NOT wrap tool calls in markdown/code fences or add any text before or after the tool block.
322323

323324
Example (agent creation tool):
324325
<function=create_agent>

strix/tools/python/python_actions_schema.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
- Print statements and stdout are captured
5656
- Variables persist between executions in the same session
5757
- Imports, function definitions, etc. persist in the session
58+
- IMPORTANT (multiline): Put real line breaks in <parameter=code>. Do NOT emit literal "\n" sequences.
5859
- IPython magic commands are fully supported (%pip, %time, %whos, %%writefile, etc.)
5960
- Line magics (%) and cell magics (%%) work as expected
6061
6. CLOSE: Terminates the session completely and frees memory
@@ -73,6 +74,14 @@
7374
print("Security analysis session started")</parameter>
7475
</function>
7576

77+
<function=python_action>
78+
<parameter=action>execute</parameter>
79+
<parameter=code>import requests
80+
url = "https://example.com"
81+
resp = requests.get(url, timeout=10)
82+
print(resp.status_code)</parameter>
83+
</function>
84+
7685
# Analyze security data in the default session
7786
<function=python_action>
7887
<parameter=action>execute</parameter>

strix/tools/terminal/terminal_actions_schema.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@
9595
<parameter=command>ls -la</parameter>
9696
</function>
9797

98+
<function=terminal_execute>
99+
<parameter=command>cd /workspace
100+
pwd
101+
ls -la</parameter>
102+
</function>
103+
98104
# Run a command with custom timeout
99105
<function=terminal_execute>
100106
<parameter=command>npm install</parameter>

0 commit comments

Comments
 (0)