Skip to content

Result file for AI agents, with its path on the console #1552

Backlog

Description

@OsirisTerje

Split out from #1515, based on the comment there of 2026-10-23. #1515 now covers the console output only.

Idea

In agent mode, the adapter writes a result file per test assembly and prints one line with its path, for example NUnit results: <path>. The console stays short. The file carries the data, and the agent reads it only when it needs more.

Original design:

  1. The file is written by default in agent mode, with failures only. An option writes the full run, including passed tests and durations, for questions such as "why is this flaky or slow?".
  2. The console line with the path is the important part. Without it, agents rarely find the file.

Why a file

Aspect Console output Result file
Control over format Partial. The VSTest logger or MTP draws it. Full. NUnit owns the schema.
Same in VSTest and MTP No, two different renderers Yes
Mixed with other output Yes: build output, other loggers, warnings No
Token cost Paid on every run Paid only when the agent reads it
Short vs detailed Chosen with settings before the run One file; the agent selects what it needs (jq)

What changed since the proposal

The console part of #1515 is implemented and measured. In agent mode the console output for failed tests is already short: the VSTest logger prints each failed test with message, a filtered stack trace and its output, and the adapter sends almost nothing else (56 % to 63 % less output in the repro). So the file is no longer needed for the failures themselves. What it still adds:

  1. Data about the full run: passed tests, durations, and skip and inconclusive reasons, without putting them on the console.
  2. The same format in VSTest and MTP mode.
  3. Structured data that an agent can query, instead of parsing console text.

Open questions

  1. Format: XML now, through the existing TestOutputXml/OutputXmlFolderMode mechanism, or JSON once the framework has its serializer? A first step could be to print the path line in agent mode when TestOutputXml is set.
  2. Default in agent mode, or opt-in? Writing a file on every run costs I/O and leaves files behind. Opt-in costs discoverability.
  3. Stale files: overwrite on every run and include a run timestamp, so an agent does not read the result of an old run after a build failure.
  4. Many files: one per test assembly and target framework. Use predictable names in the results directory, or an index file.
  5. Overlap with existing loggers: --logger trx already writes a full result file. Check what the NUnit file adds beyond TRX for an agent.

🤖 Made by @OsirisTerje with Claude

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions