Agents run the slow test suite: they are never told the project's fast test command #65

Closed
opened 2026-09-26 22:06:53 -04:00 by cmoriarty · 1 comment
Owner

Problem

On run run_01M3FS9FFXEHTY5WTHX36V4Z5Y (issue #52, fix.implement attempt 3), the step's test subagent ran uv run pytest tests/ -q and was still at about 52% after 15 minutes: one process, every slow test, and tests/integration too. This repository has had a fast lane since #39. ./tools/test.sh runs pytest -n auto -m "not slow" tests/unit across every core, plus the UI checks, in about a minute. The agent never used it.

Two causes, one in this repository and one in Braid:

  1. The fast lane is documented only in CLAUDE.md. opencode reads AGENTS.md, and it reads CLAUDE.md only when there is no AGENTS.md. This repository's AGENTS.md holds nothing but Braid's generated block, which says nothing about tests. So Braid's agents never learn the lane exists.
  2. Braid's prompts invent a slow command. The openspec.test.* prompt offers uv run pytest -q tests/unit as its example: no parallelism, no slow-test filter. Nothing in the generated AGENTS.md block, or in the delegation guidance for the test subagent, tells an agent to look for and use the project's own documented test command. So in any repository an agent picks whatever pytest/npm test call it thinks of first.

The same guessed command also ends up in .osf/test/unit.command, which the orchestrator then runs itself to judge the lane, so the cost is paid twice.

Fix

  1. This repository: a "Running the tests" section in AGENTS.md, outside Braid's block, giving the fast commands and saying not to run pytest tests/ bare. tools/test.sh itself is not the one to hand agents: its browser step shares a fixed fixture port (8719), and two concurrent runs would test each other's builds.
  2. Braid, for every repository:
    • the generated AGENTS.md block says to use the project's own documented test command (AGENTS.md, CLAUDE.md, README, CONTRIBUTING, a test script, a Makefile target), to run in parallel where the project supports it, and to leave slow and integration suites to the steps that own them;
    • the test-lane prompts, both OpenSpec and quick-fix, say the same where they ask for .osf/test/<lane>.command, and drop the misleading example;
    • the test subagent guidance in the delegation policy says to give it the project's fast command.
## Problem On run `run_01M3FS9FFXEHTY5WTHX36V4Z5Y` (issue #52, `fix.implement` attempt 3), the step's `test` subagent ran `uv run pytest tests/ -q` and was still at about 52% after 15 minutes: one process, every slow test, and `tests/integration` too. This repository has had a fast lane since #39. `./tools/test.sh` runs `pytest -n auto -m "not slow" tests/unit` across every core, plus the UI checks, in about a minute. The agent never used it. Two causes, one in this repository and one in Braid: 1. **The fast lane is documented only in `CLAUDE.md`.** opencode reads `AGENTS.md`, and it reads `CLAUDE.md` only when there is no `AGENTS.md`. This repository's `AGENTS.md` holds nothing but Braid's generated block, which says nothing about tests. So Braid's agents never learn the lane exists. 2. **Braid's prompts invent a slow command.** The `openspec.test.*` prompt offers `uv run pytest -q tests/unit` as its example: no parallelism, no slow-test filter. Nothing in the generated `AGENTS.md` block, or in the delegation guidance for the `test` subagent, tells an agent to look for and use the project's own documented test command. So in any repository an agent picks whatever `pytest`/`npm test` call it thinks of first. The same guessed command also ends up in `.osf/test/unit.command`, which the orchestrator then runs itself to judge the lane, so the cost is paid twice. ## Fix 1. **This repository:** a "Running the tests" section in `AGENTS.md`, outside Braid's block, giving the fast commands and saying not to run `pytest tests/` bare. `tools/test.sh` itself is not the one to hand agents: its browser step shares a fixed fixture port (8719), and two concurrent runs would test each other's builds. 2. **Braid, for every repository:** - the generated `AGENTS.md` block says to use the project's own documented test command (`AGENTS.md`, `CLAUDE.md`, README, CONTRIBUTING, a test script, a Makefile target), to run in parallel where the project supports it, and to leave slow and integration suites to the steps that own them; - the test-lane prompts, both OpenSpec and quick-fix, say the same where they ask for `.osf/test/<lane>.command`, and drop the misleading example; - the `test` subagent guidance in the delegation policy says to give it the project's fast command.
Author
Owner

Shipped in #66 (e224078, archived as 2026-09-26-agents-use-project-test-command).

  • Braid's AGENTS.md block now tells every agent to use the project's own documented test command, to hand it to a test subagent, to run in parallel where it can, and to leave slow, integration and end-to-end suites to their own steps.
  • script.agents-md keeps its block current: it replaces the text between its markers when it differs, and leaves the rest of AGENTS.md byte for byte. Repositories that merged an earlier run's block will get the new one on their next run.
  • The test-lane prompts (OpenSpec and quick-fix) send the agent to the project's command for .osf/test/<lane>.command, and the misleading uv run pytest -q tests/unit example is gone.
  • This repository's AGENTS.md has "Running the tests". The unit line (uv run pytest -q -n auto -m "not slow" tests/unit --deselect tests/unit/test_metrics.py && cd ui && npx tsc -b && npx vitest run) runs 1,772 backend and 410 UI tests in 36 s, against 30+ minutes for pytest tests/.

A run already in flight keeps the AGENTS.md it was scaffolded with.

Shipped in #66 (`e224078`, archived as `2026-09-26-agents-use-project-test-command`). - **Braid's `AGENTS.md` block** now tells every agent to use the project's own documented test command, to hand it to a `test` subagent, to run in parallel where it can, and to leave slow, integration and end-to-end suites to their own steps. - **`script.agents-md` keeps its block current:** it replaces the text between its markers when it differs, and leaves the rest of `AGENTS.md` byte for byte. Repositories that merged an earlier run's block will get the new one on their next run. - **The test-lane prompts** (OpenSpec and quick-fix) send the agent to the project's command for `.osf/test/<lane>.command`, and the misleading `uv run pytest -q tests/unit` example is gone. - **This repository's `AGENTS.md`** has "Running the tests". The unit line (`uv run pytest -q -n auto -m "not slow" tests/unit --deselect tests/unit/test_metrics.py && cd ui && npx tsc -b && npx vitest run`) runs 1,772 backend and 410 UI tests in 36 s, against 30+ minutes for `pytest tests/`. A run already in flight keeps the `AGENTS.md` it was scaffolded with.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cmoriarty/braid#65
No description provided.