Skip to content

feat: /test slash command — run project tests with inline failure rendering #316

@Hmbown

Description

@Hmbown

Problem

The agent has run_tests as an internal tool but users can't drive it directly. Test failures during agent work get surfaced as raw cargo test / pytest / npm test output, which is hard to parse in a transcript.

Proposed solution

/test [path] slash command:

  1. Auto-detect the project's test runner from manifest (Cargo.toml → cargo, package.json → npm/pnpm/yarn, pyproject.toml → pytest, etc.).
  2. Run the test command. Stream output live.
  3. Parse failure output structurally:
    • File:line of the assertion
    • Expected vs actual values
    • Backtrace (folded by default, expandable)
  4. Render failures as cards (like tool results) with file:line as a clickable opener (Ctrl+Click → open in $EDITOR / code -g <file>:<line>).
  5. Summary line at the end: "12 passed, 1 failed, 0 ignored — 4.2s".

Companion: file:line clickability everywhere

Stack traces in tool errors, sandbox denials, etc. all get parsed for path:line patterns and rendered as openable links.

Acceptance criteria

  • /test runs the right command per project type (Rust / Node / Python at minimum).
  • Failure card renders with structured fields (file, line, message).
  • At least one click target opens an editor (env-driven: $EDITOR, code -g, idea --line, etc.).
  • Summary line on completion.
  • Works inside a sub-agent invocation.

Related

  • crates/tui/src/tools/run_tests.rs — existing internal tool.
  • crates/tui/src/commands/ — where the new slash command lives.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions