Skip to content

Parser fallback truncates to 500 chars on parse failure — LLM gets near-empty output #620

Closed

Description

@FlorianBruniaux

Problem

When the parser encounters an unexpected tier or panics, src/parser/mod.rs:92,99 truncates output to 500 characters as a "safe fallback".

500 chars is almost nothing — a typical error message from vitest, playwright, or cargo test is 2-5x that size. Claude receives a truncated error with no way to diagnose it, then loops trying different commands.

Root cause

src/parser/mod.rs:92,99:

// When tier > max, fallback to first 500 chars
output[..500.min(output.len())].to_string()

Impact

  • Vitest/Playwright failure messages are cut mid-sentence
  • Claude can't see the actual assertion failure or stack trace
  • Claude retries the test command, generating duplicate truncated output
  • Loop continues until context limit or user intervention

Proposed fix

Two options (pick one or both):

Option A — Raise truncation limit:
Change 500 → 3000 chars. Enough to show full error messages.

Option B — Passthrough on failure (preferred):
When the parser fails, return the unmodified raw output instead of truncating. RTK's contract is "smaller output or the same output" — never less signal than the raw command.

Acceptance criteria

  • Parse failure returns ≥ the full output of the underlying command
  • No test failure message is truncated mid-way
  • RTK never returns less information than the raw command on parser error

Activity

  1. added
    bug
    filter-quality
    P0
    on Mar 16, 2026
  2. pszymkowiak commented on Mar 17, 2026

    @pszymkowiak
    Collaborator

    Fixed in v0.30.0 — parser fallback truncation raised from 500 to 2000 chars. Verified with release binary.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0bugfilter-quality

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions