Skip to content

[Eval Harness] Step 2: Agent runner — execute task, capture full trajectory #1515

Description

@Lexus2016

Parent: #1481 (Eval harness foundation — decomposed per owner request)

This is Step 2 of the eval harness. Depends on #1514 (Step 1: task set).

Scope (this issue — ≤200 lines)

Build the agent runner — a function that takes an EvalTask, executes the agent against it, and captures the full trajectory (all tool calls, arguments, results, model turns). This is the execution layer.

Specific changes

  1. EvalTrajectory dataclass: captures the full execution record:

    • task_id: which task was run
    • tool_calls: list of {tool, args, result, timestamp} dicts
    • model_turns: number of model round-trips
    • final_answer: the agent's final text output
    • duration_seconds: wall-clock time
    • error: exception if the agent crashed, else None
  2. run_eval_task(task: EvalTask, agent_config: dict) -> EvalTrajectory: the core runner function. Spins up a minimal agent session (pinned base config), feeds the task prompt, and records the trajectory.

  3. Trajectory serialization: EvalTrajectory.to_dict() / .to_jsonl() for output to scores.jsonl.

  4. Agent config pinning: accept a base config (model, tools, system prompt) so runs are reproducible.

What this issue does NOT do

Success criteria

  • EvalTrajectory dataclass with all fields
  • run_eval_task() executes agent and captures trajectory
  • Trajectory serialization to dict/jsonl
  • Agent config pinning for reproducibility
  • Unit test: runner captures tool calls from a simple task
  • Unit test: trajectory serializes correctly
  • Fits ≤200-line self-merge cap

Dependencies

Existing code checked

  • scripts/evolution_evaluator.py — scoring rubric only, does not execute agents
  • No existing agent runner for eval in the codebase (verified by grep)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions