Skip to content

Output lost on composite commands (make ci-local / vitest) - summary lines removed #1035

@mo-xiaoxi

Description

@mo-xiaoxi

Environment

  • RTK version: 0.34.3
  • OS: macOS Darwin 24.6.0
  • Claude Code hook config:
{
  "PreToolUse": [{
    "hooks": [{"command": "rtk-rewrite.sh", "type": "command"}],
    "matcher": "Bash"
  }]
}

Problem

RTK's output filtering causes critical CI result lines to be lost when running composite/long commands. Two specific issues observed:

1. vitest output parsing failure

Running npx vitest run produces:

[RTK:PASSTHROUGH] vitest parser: All parsing tiers failed

RTK cannot parse vitest's output format. The passthrough fallback sometimes still loses output.

2. make target output is cut off

Running make ci-local (which chains ruff check + pytest + vitest + quality check) gets cut off at ~13% of pytest results:

tests/unit/.../test_agent_frontmatter_fixtures[valid/agent-valid.md-True] PASSED [ 13%]
... (1379 lines truncated)

The cut removes:

  • The pytest summary line (251 passed, 18 skipped)
  • The entire vitest run (277 passed)
  • The quality check results

This means we cannot determine if CI passed or failed from the output, even though the exit code was 0.

3. File redirect also affected

Even when redirecting to a file (make ci-local > /tmp/output.log 2>&1), the log file contains the same ... (1379 lines truncated) marker, suggesting RTK filters before the output reaches the file.

Expected Behavior

  • Long composite commands (make targets chaining multiple tools) should not lose their summary/verdict lines
  • At minimum, the last N lines (tail) should always be preserved, as CI tools print pass/fail summaries at the end
  • vitest format should be recognized, or unknown formats should pass through cleanly

Suggested Fix

  1. Always preserve tail: Even when trimming middle sections, keep the last 20-30 lines (most CI tools print summaries at the end)
  2. Whitelist make/composite commands: Don't filter output from make, npm test, npx vitest etc.
  3. vitest parser: Add vitest output format support alongside existing jest/pytest parsers

Workaround

Remove the RTK hook from Claude Code settings entirely, losing all token-saving benefits.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingeffort-medium1-2 jours, quelques fichiersfilter-qualityFilter produces incorrect/truncated signal

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions