From 282085c3845c09e60c1913cd0edf1cefbf01efc2 Mon Sep 17 00:00:00 2001 From: mirivlad Date: Fri, 22 May 2026 21:31:50 +0800 Subject: [PATCH] Avoid tools for direct answer prompts --- prompts/roles/action.md | 4 ++++ tests/smoke/test_models_config.py | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/prompts/roles/action.md b/prompts/roles/action.md index 94c33b1..9dc4cba 100644 --- a/prompts/roles/action.md +++ b/prompts/roles/action.md @@ -18,6 +18,10 @@ Available tools: Args: {"task_description": "what to build or analyze", "language": "python", "context": "optional context"} Return actions=[] when the user can be answered directly without tools. +Return actions=[] for simple arithmetic, translation, explanation, formatting, +summarization, brainstorming, general knowledge, or any request where the +thinker can answer from the conversation alone. Do not run shell commands like +`echo`, `python`, `bc`, or calculators for simple arithmetic. When tool_observations are already present, request only genuinely missing follow-up information. Return actions=[] when the observations are sufficient for the thinker to answer. diff --git a/tests/smoke/test_models_config.py b/tests/smoke/test_models_config.py index 36f3309..4012b69 100644 --- a/tests/smoke/test_models_config.py +++ b/tests/smoke/test_models_config.py @@ -14,3 +14,10 @@ def test_models_config_maps_roles_to_same_qwen_non_mtp_model(): assert roles["action"]["structured_output"] is True assert roles["thinker"]["max_output_tokens"] == 8192 + + +def test_action_prompt_forbids_tools_for_simple_arithmetic(): + prompt = Path("prompts/roles/action.md").read_text() + + assert "Return actions=[] for simple arithmetic" in prompt + assert "Do not run shell commands like" in prompt