You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
discover/gain: RTK_DISABLED= after a wrapper the hook rewrites through (nice, timeout, command) is never counted as a bypass #4278
RTK_DISABLED=1 placed after a wrapper that the hook rewrites through is a real bypass — the hook itself flags it — but neither rtk discover nor rtk gain counts it.
So removing the RTK_DISABLED=1 does recover the savings, and the runtime says so. Analytics disagrees: strip_disabled_prefix (src/discover/registry.rs) only peels an ENV_PREFIX match anchored at ^, so nice RTK_DISABLED=1 docker ps has an empty env prefix and the line lands in TOP UNHANDLED under nice.
Measured on develop (c75f1590) with a generated sweep of 264 lines (17 wrappers × 8 supported commands × both orderings) through the real ClaudeProvider, each scored against rtk rewrite "<line without the RTK_DISABLED= token>": 72 real bypasses are not counted, all of the wrapper-first shape (nice, nice -n5, timeout 30, command, …). The number is identical with #3808 applied.
Direction
The analytics peel should be able to see through any wrapper, and let would_be_covered_without_bypass decide — asked about the line the user typed minus the RTK_DISABLED= assignment, wrapper included. That gate already knows which wrappers the hook rewrites through (built-in ones and the user's hooks.transparent_prefixes), so the peel does not need its own wrapper list; it only has to find the assignment. gain's warning has no such gate (#4277), so it should not take this until it has one.
strip_disabled_prefix only matches RTK_DISABLED= anchored at start, so wrapper-prefixed bypasses (nice, timeout, command) are miscounted as unhandled instead of bypasses; peel should defer to would_be_covered_without_bypass after stripping the assignment anywhere before the real command.
📁 Relevant files
src/discover/registry.rs
Suggested Actions
Rework strip_disabled_prefix in src/discover/registry.rs to find RTK_DISABLED= anywhere before the command, not just at…
Delegate the covered/uncovered decision to would_be_covered_without_bypass so no separate wrapper list is needed
Verify fix against the 264-line sweep (17 wrappers × 8 commands × both orderings) cited in the issue
Activity
rtk-wshm-sync-bot commentedon Sep 26, 2026
🔍 Automated Triage
bugmediumSummary
strip_disabled_prefix only matches RTK_DISABLED= anchored at start, so wrapper-prefixed bypasses (nice, timeout, command) are miscounted as unhandled instead of bypasses; peel should defer to would_be_covered_without_bypass after stripping the assignment anywhere before the real command.
📁 Relevant files
src/discover/registry.rsSuggested Actions
Triaged automatically by wshm · This is an automated analysis, not a human review.