diff --git a/src/agent/stirrup_agent/runner.py b/src/agent/stirrup_agent/runner.py index 46272278..bef1edc2 100644 --- a/src/agent/stirrup_agent/runner.py +++ b/src/agent/stirrup_agent/runner.py @@ -55,21 +55,10 @@ _CONTEXT_SUMMARIZATION_CUTOFF = 0.75 _CODE_EXEC_SYSTEM_PROMPT = """\ Code execution: -- MCP tools and their definitions are authoritative for domain data and semantics. - Never use code to query backing services or bypass an available MCP tool. -- Do not overuse code_exec. Answer directly from MCP results, domain knowledge, - and basic reasoning or arithmetic when sufficient. Use code_exec only for - necessary computation, data processing, workspace inspection, or validation. - Never use it for planning, comments, placeholders, or empty scripts. - Prefer one complete script that inspects, analyzes, and verifies. Do not repeat equivalent experiments; correct failures directly. - Stay inside the execution workspace and use relative paths. Workspace state persists across code_exec calls. -- For artifacts, inspect only the schema, counts, a small sample, or the specific - rows or fields needed, then process in place. If an artifact exceeds 200 KiB, - never print it in full; extract and process the relevant subset in bounded - batches. Avoid large record lists and verbose diagnostics. Reuse snapshots - unless domain state has changed. """ _DOCKER_CODE_EXEC_SYSTEM_PROMPT = """\ The Docker execution workspace is /workspace. Host filesystem paths are not diff --git a/src/agent/stirrup_agent/tests/test_runner.py b/src/agent/stirrup_agent/tests/test_runner.py index c64430c2..307f0a10 100644 --- a/src/agent/stirrup_agent/tests/test_runner.py +++ b/src/agent/stirrup_agent/tests/test_runner.py @@ -130,6 +130,19 @@ def test_stirrup_runner_uses_shared_prompt_when_code_is_disabled(): assert runner._build_system_prompt() == AGENT_SYSTEM_PROMPT +def test_stirrup_runner_uses_minimal_code_exec_guidance(): + runner = StirrupAgentRunner(code_backend="local") + + prompt = runner._build_system_prompt() + normalized_prompt = " ".join(prompt.split()) + + assert "Prefer one complete script" in normalized_prompt + assert "Keep all reads and writes inside the workspace" in normalized_prompt + assert "MCP tools and their definitions are authoritative" not in normalized_prompt + assert "Do not overuse code_exec" not in normalized_prompt + assert "If an artifact exceeds" not in normalized_prompt + + def test_stirrup_runner_forwards_temperature_to_litellm_client(): runner = StirrupAgentRunner( model="watsonx/ibm/granite-4-h-small",