Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions src/agent/stirrup_agent/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions src/agent/stirrup_agent/tests/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down