scicode_tool_use harness runs a SciCode-specific sequential tool-use flow with optional code-interpreter execution (official site scicode-bench.github.io). It supports the host_process environment only.
This harness generates code step by step. In tool_use mode it calls code_interpreter, feeds execution results back
to the model, and records the trajectory and generated code. Model credentials come from the CLI --model-* fields
and support openai-chat and openai-responses.
How it works
- Generation mode.
mode=naivegenerates step by step directly;tool_useruns a tool loop within each step.tool_namesselects the enabled tools (defaultcode_interpreter),tool_use_max_loopscaps loops per step, andwith_backgrounddecides whether step-by-step prompts carry step background. - Code execution.
code_interpreterruns incode_workdirwith a per-run timeout ofcode_timeout_seconds;execution_preambleruns before generated code, andpython_binaryselects the interpreter (defaults to the running one). - Optional sandbox. When
sandbox_urlis set, code execution is offloaded to a sandbox service:sandbox_memory_limit_mbcaps memory,sandbox_max_retries/sandbox_retry_delay_seconds/sandbox_api_timeout_secondscontrol API retries and timeout, andsandbox_no_proxysets proxy bypass. - Collect results. Normalizes the step-by-step generation and execution record into a trajectory and returns a
RunResult.
Parameters
Pass a JSON object via--harness-params '{...}', or a harness.params block in the file given to --config; the CLI wins on shared keys (deep-merge). See the Harnesses overview for merge precedence.
Parameter reference
| Parameter | Type | Default | Choices / values | Description |
|---|---|---|---|---|
mode | string | tool_use | naive / tool_use | Generation mode. |
tool_names | list | [“code_interpreter”] | — | Enabled tool list. |
tool_use_max_loops | int | 15 | ≥ 1 | Maximum tool-use loops allowed for each step. |
with_background | bool | true | true / false | Whether step-by-step prompts include step background. |
code_timeout_seconds | int | 180 | ≥ 1 | Timeout for one code_interpreter execution in seconds. |
code_workdir | string | .agentcompass/scicode_tool_use | — | Local working directory for code_interpreter. |
execution_preamble | string | "" | — | Additional code executed before generated code. |
python_binary | string | "" | — | Python executable used by the harness (defaults to the running interpreter). |
sandbox_url | string | "" | — | Optional sandbox service URL. |
sandbox_no_proxy | string | "" | — | Optional sandbox no_proxy value. |
sandbox_memory_limit_mb | int | 1024 | ≥ 1 | Sandbox code execution memory limit in MB. |
sandbox_max_retries | int | 3 | ≥ 1 | Retry count after sandbox API failures. |
sandbox_retry_delay_seconds | float | 2.0 | ≥ 0 | Sandbox API retry delay in seconds. |
sandbox_api_timeout_seconds | int | 30 | ≥ 1 | Sandbox API request timeout in seconds. |
Run examples
- Default
- Custom params
Local
code_interpreter, tool_use mode.Output
The harness returns aRunResult per task: the step-by-step generation and execution trajectory, the final code, and execution status. Per-task details and aggregate metrics are written by the benchmark under results/<benchmark>/<model>/<run>/ (see Results).