Skip to main content
The 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=naive generates step by step directly; tool_use runs a tool loop within each step. tool_names selects the enabled tools (default code_interpreter), tool_use_max_loops caps loops per step, and with_background decides whether step-by-step prompts carry step background.
  • Code execution. code_interpreter runs in code_workdir with a per-run timeout of code_timeout_seconds; execution_preamble runs before generated code, and python_binary selects the interpreter (defaults to the running one).
  • Optional sandbox. When sandbox_url is set, code execution is offloaded to a sandbox service: sandbox_memory_limit_mb caps memory, sandbox_max_retries / sandbox_retry_delay_seconds / sandbox_api_timeout_seconds control API retries and timeout, and sandbox_no_proxy sets 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

ParameterTypeDefaultChoices / valuesDescription
modestringtool_usenaive / tool_useGeneration mode.
tool_nameslist[“code_interpreter”]Enabled tool list.
tool_use_max_loopsint15≥ 1Maximum tool-use loops allowed for each step.
with_backgroundbooltruetrue / falseWhether step-by-step prompts include step background.
code_timeout_secondsint180≥ 1Timeout for one code_interpreter execution in seconds.
code_workdirstring.agentcompass/scicode_tool_useLocal working directory for code_interpreter.
execution_preamblestring""Additional code executed before generated code.
python_binarystring""Python executable used by the harness (defaults to the running interpreter).
sandbox_urlstring""Optional sandbox service URL.
sandbox_no_proxystring""Optional sandbox no_proxy value.
sandbox_memory_limit_mbint1024≥ 1Sandbox code execution memory limit in MB.
sandbox_max_retriesint3≥ 1Retry count after sandbox API failures.
sandbox_retry_delay_secondsfloat2.0≥ 0Sandbox API retry delay in seconds.
sandbox_api_timeout_secondsint30≥ 1Sandbox API request timeout in seconds.

Run examples

Local code_interpreter, tool_use mode.

Output

The harness returns a RunResult 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).