Skip to content

The agent says “fixed.” Which record should you trust?

OUR VIEW

A trajectory is useful for training when its decisions and outcomes are supported by evidence. A passed test establishes task success only to the extent that the test covers the requirements.

On this page

Code changes, a tool returns “test passed,” and the agent announces completion. Those events can still describe a failed task. An agent calls tools and uses their responses to decide what to do next; its trajectory records the request, actions and outcomes. Follow a small trace below to judge what it actually accomplished.

Read the record: what did the agent finish?

The following is an original teaching example, not customer data. The task is to sort integers in ascending order and remove duplicates. The initial function returns its input unchanged. The agent replaces it with sorted(xs), runs one test, receives a passing result and claims completion. JSON is a structured record format; start with task, each event’s type, and the test’s input and expected output.

Illustrative trace with simplified events; a complete replay environment is not supplied.
{
  "task_id": "demo-01",
  "task": "Return integers in ascending order, without duplicates.",
  "initial_code": "def normalize(xs): return xs",
  "events": [
    {
      "seq": 1,
      "type": "edit",
      "code": "def normalize(xs): return sorted(xs)"
    },
    {
      "seq": 2,
      "type": "tool_call",
      "call_id": "test-01",
      "tool": "python",
      "input": "assert normalize([3, 1, 2]) == [1, 2, 3]"
    },
    {
      "seq": 3,
      "type": "tool_result",
      "call_id": "test-01",
      "exit_code": 0,
      "stdout": "1 test passed"
    },
    {
      "seq": 4,
      "type": "final",
      "text": "Done. The function sorts and removes duplicates."
    }
  ]
}

The input 3, 1, 2 has no duplicates. Sorting it does produce 1, 2, 3. The test never exercises deduplication. With the input 2, 1, 2, sorted(xs) returns 1, 2, 2, while the task requires 1, 2. That counterexample disproves the completion claim without contradicting the record that this particular test passed.

Three labels can therefore coexist: the code was changed, the specified test passed, and the task remained incomplete. Treating the final message as a success label imports the agent’s mistake into the dataset. The failure concerns requirement coverage and outcome assessment; it is not evidence that the tool failed to execute.

What a call establishes depends on its links

SWE-Gym paper (arXiv v2) §5.1.1 gives its verifier observations and actions alongside the task statement and code diff, using both successful and unsuccessful trajectories for training.[1] This is a concrete reference for reading a process. Our example does not use its dataset or reproduce its model.

Evidence in the exampleSupported conclusionConclusion still unsupported
A tool_call and tool_result sharing a call_idThe specified call has an execution returnOther calls or the entire task succeeded
The test input, expected value and exit_codeThis execution passed this assertionAll relevant edge cases were covered
Initial code and the editThe change can be inspectedDependencies, files and environment can all be replayed
A final completion messageThe agent reported completionSuccess was independently established

A call_id connects a tool request to its return; a task_id groups task events. Concurrent calls may return out of order, and retries may repeat an action, so temporal proximity is not a reliable pairing rule. Field names alone establish little. Check who creates each identifier, its uniqueness scope and whether every relevant event carries it.

Start a batch review with a specific use

Suppose the objective is to train an agent to recognize when more testing is needed. Inspect records containing several requirements but only one test. Write down each requirement and identify the observation supporting it; leave untested requirements as unknown. Try an input that could disprove the completion claim and decide whether the label needs revision. This locates defects, but a small purposive sample cannot estimate the batch’s failure rate.

For batch checks, count different gaps separately: tool requests without returns, outcomes without task links, and success labels without assessment evidence. State whether each denominator is calls, trajectories or success-labeled trajectories. This helps locate a collection, conversion or annotation problem that one overall completeness percentage would obscure.

ADP paper (arXiv v2) proposes an intermediate representation between heterogeneous agent datasets and training pipelines.[2] When adapting such a representation, ask whether the same questions remain answerable after conversion: can calls still be paired, are failures retained, and have several attempts at one task been mistaken for different tasks? A shared messages field does not establish those properties.

When is this failed trajectory useful?

For imitating correct actions, learning the uncorrected sequence may reinforce inadequate testing. For training an outcome assessor, it is an informative negative example: the record explains the failure, and a concrete counterexample supports the label. A paired teaching example could retain the task, add a duplicate-input test and examine the next action. Such a revision must be labeled as constructed or synthetic, not passed off as an original run.

Describe a delivered batch in terms someone can check: for example, “Task statements, actions and execution returns are retained; success labels were checked with the specified tests. Environment files are not included, so full replay is not promised.” A reader can then judge what the material supports and where additional evidence is needed.

References

  1. SWE-Gym paper (arXiv v2) · §5.1.1 verifier inputs and training examples
  2. Agent Data Protocol paper (arXiv v2) · abstract and representation objective

Read next

All articles

Sign in to Padda

A code in your inbox. No password to remember.

Connecting to sign-in…