Skip to content

fix(hook): honor exclusions for tail line ranges - #3719

Closed
juliosuas wants to merge 1 commit into
rtk-ai:developfrom
juliosuas:fix/hook-tail-exclude-command
Closed

juliosuas wants to merge 1 commit into
rtk-ai:developfrom
juliosuas:fix/hook-tail-exclude-command

Conversation

@juliosuas

Copy link
Copy Markdown

Summary

Test plan

  • cargo fmt --all --check && cargo clippy --all-targets && cargo test
  • Manual testing: an isolated config with tail or ^tail -n leaves tail -n 400 /var/log/foo.log unchanged; without an exclusion it still rewrites to rtk read /var/log/foo.log --tail-lines 400

Security note: this changes Tier 1 rewrite logic in src/discover/registry.rs; the diff received isolated full-suite testing and an independent senior security/quality review before publication.


Restored after an accidental fork deletion. Same commits as #3109.

@KuSh

KuSh commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator

Closing as a duplicate of #3324, which fixes the same fast-path gap.

Two things from yours are being carried over: the path-stripped match — #3324 currently only strips the env prefix, so /usr/bin/head -20 f would still slip through, and I've asked for yours to be added — and the regex-pattern test case. Of the seven PRs open against this one branch, yours is the only one that handles path-prefixed invocations.

One note on the issue link: #3107 bundles three problems — rtk read buffering the whole file, output-vs-memory bounds, and the exclusion gap. This fixes only the third, so #3324 will reference it as a partial fix rather than closing it. The memory half is tracked by #3132.

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