Skip to content

fix(tee): safe truncation caps and tee/hint coverage - #1928

Merged
aeppling merged 3 commits into
developfrom
fix/tee-hint-trunc-quality
May 19, 2026
Merged

aeppling merged 3 commits into
developfrom
fix/tee-hint-trunc-quality

Conversation

@aeppling

@aeppling aeppling commented May 17, 2026 •

Copy link
Copy Markdown
Contributor

important

Merge #1895 first

Summary

Every RTK filter that truncates output must give the agent a way to recover the hidden content. Before this PR, many truncation sites showed "… +N more" with no recovery path, and some that did have tee hints used bare magic offsets that would silently diverge if the cap changed.

This PR addresses two things:

1. Full tee/hint coverage : All truncation sites now emit either:

  • force_tee_tail_hint for flat/homogeneous lists (one item = one line in the tee file), so the agent can tail -n +N directly to the first hidden item
  • force_tee_hint for structured/multi-line blocks (test failures, build error blocks), where a line offset is meaningless

2. Safe caps via named constants :

  • Every take(N) / > N / offset N+1 triplet is now derived from a single const MAX_XXX: usize = N, so changing the cap can't silently break the offset.

Bugs fixed

  • format_compose_ps was teeing the raw tab-separated docker output (raw) while the offset pointed to formatted line 21. The agent would get unreadable tabs. Fixed by pre-building all formatted lines and teeing those.
  • filter_cargo_test used force_tee_tail_hint with offset MAX_FAILURES + 1 on multi-line failure blocks , tail -n +11 would land mid-block. Switched to force_tee_hint.

aeppling and others added 3 commits May 19, 2026 10:23
Replace all bare magic offset literals (e.g. 21 for cap=20) with named
constants (MAX_XXX + 1) so offsets stay in sync if caps change.
Fix compose_ps to tee pre-formatted lines instead of raw tab-separated
input, so tail -n +N gives the agent readable content.
All 13 affected modules updated: container, dotnet, gh, glab, go, lint,
pnpm, pytest, rubocop, cargo, aws. 1884 tests pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@aeppling
aeppling force-pushed the fix/tee-hint-trunc-quality branch from 30a05ae to 4acdcf2 Compare May 19, 2026 08:29
@aeppling
aeppling merged commit 15a0d2e into develop May 19, 2026
17 checks passed
@aeppling aeppling mentioned this pull request May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants