Module agent

Module agent 

Source
Expand description

2026-09-26: The agentic benchmark’s agent loop: tool-calling turns against the served endpoint, with the tools run inside a per-iteration sandbox directory. Its tools, prompt and caps are modelled on the opencode client that bench/fp8_dgx2_drift/harness/run_tier.sh drives.

Owner: bench, agentic. Invariants:

  • The loop runs at most max_turns turns.
  • Every tool result sent back to the model has passed through truncate.
  • run_task reaps processes whose working directory is in the sandbox after the loop returns, whether it returned Ok or Err.

Re-exports§

pub use shell::truncate;
pub use tools::glob_match;
pub use tools::tool_schema;

Modules§

norm
2026-09-26: Normalising bash tool output so that identical work reads identically: progress lines are dropped, and timestamps, dates, durations, pids and ps bookkeeping columns become placeholders. Every tool output is fed back to the model, so a build that reports in 0.00s on one run and in 1.23s on the next gives two greedy runs different contexts.
shell
2026-09-26: Running the shell command the model wrote, and bounding its time, memory and output.
tools
2026-09-26: The six tools the agent loop offers (bash, read, write, edit, glob, grep) and their implementations.
trace
2026-09-26: Per-iteration trajectory file: the prompt, then each turn’s reasoning, text, tool calls and finish reason, and each tool result, as plain text so diff of two runs shows the first turn at which they split. The outcome columns (webserver_ok, steps, turns) can agree while the trajectories differ.

Structs§

AgentConfig
Transcript
2026-09-26: What one agent run did, for scoring and diagnostics.

Functions§

resolve
2026-09-26: Resolve path inside sandbox. The check is lexical, because the target usually does not exist yet: a relative path, or an absolute one already under sandbox, is accepted unless it has a .. component or resolves, through an existing symlink, outside the sandbox.
run_task
2026-09-26: Run one agentic task until the agent stops calling tools or the turn cap is reached.