Repository navigation
Conversation
…eady_rtk percent" This reverts commit ea56548.
📊 Automated PR Analysis
SummaryFixes the discover module's savings rate calculation to use a weighted average across all sub-commands in a bucket instead of using the first-seen sub-command's rate. Also fixes the 'Already using RTK' percentage to use floating-point division instead of integer division, preventing small percentages from being truncated to 0%. Review Checklist
Analyzed automatically by wshm · This is an automated analysis, not a human review. |
Simplified `rtk curl` Filter
Strip env prefix (sudo, VAR=val) before exclude check so PGPASSWORD=x psql matches ["psql"]. Match against full command instead of first token so ["git push"] matches "git push origin main". Compile exclude entries as regex so ["^curl"] works as pattern. Invalid regex falls back to prefix match with eprintln warning. Non-regex patterns auto-anchor with ^ and \b to prevent substring matches (e.g. "go" won't exclude "golangci-lint").
Replace \b with ($|\s) to only match end-of-string or whitespace. Empty string and bare "^" patterns produce regexes that match all commands, silently disabling all rewrites on a config typo. Skip trivial patterns with an eprintln warning.
Removing old guards, windows can now just use the binary hook engine from 0.37 Related issues: - Fixes #502 : rtk init --global falls back to --claude-md on Windows - Fixes #1353 : Feature request: hook-based mode on Windows - Partially addresses #330 : Add hooks support for Windows - Partially addresses #913 : Persistent "No hook installed" warning on Windows - Partially addresses #1373 : Suppress "No hook installed" warning on Windows - Partially addresses #682 : Config to suppress hook warning - Related to #1248 : Windows PowerShell compatibility gaps Supersedes community PRs: - #1123 fix(init): enable hook installation on Windows - #1027 fix(init): enable hook-based mode on Windows - #809 feat: enable hook-based mode on Windows - #452 feat: add Windows hook support for rtk init --global - #551 feat: native cross-platform hook for Windows support - #150 feat(hook): native cross-platform hook-rewrite command - #1063 Feat/windows hooks
fix(discover): exclude_commands bypass for env-prefix, sub cmd + regex
fix(hooks): windows use 'rtk hook claude' no fallback
pszymkowiak
left a comment
There was a problem hiding this comment.
LGTM — good batch release.
Strong points:
- Every fix is tied to an open issue, tests added for each regression
- regex::escape +
($|\s)anchoring nicely prevents substring false positives (golangci vs go) - UTF-8 safe curl truncation via is_char_boundary
- Weighted savings average fix is correct and well-commented
- Windows support unified cleanly with RTK_CLAUDE_DIR override for tests
Minor non-blockers:
- curl: when force_tee_hint returns None and output >= 500 bytes, the full response passes through untruncated. Intentional? If a user disables tee, large JSON payloads will hit the context window.
- hooks/init.rs tests use std::env::set_var which is only safe here because of CLAUDE_DIR_LOCK. Fine for this module, but worth flagging if other tests in the crate ever touch the same var.
- Nit: title "Next Release" is generic; something like "release: windows support + discover fixes + curl simplification" reads better in the master changelog.
Approving.
Pre release reviewLayer: L1: Build gate RELEASE READYAll 1606 unit tests pass, all 6 integration tests pass, all new features work correctly, install/uninstall cycle works cleanly. The only new smoke test failure is the expected curl behavior change. The 5 rewrite test failures are a pre-existing test script bug (it checks exit code before checking content, and rtk rewrite intentionally uses exit 3). |
Next Release
Next Release
Feats
Fix
fix(discover): weighted savings rate per bucket, decimal already_rtk percent
fix(curl): simplified curl filter (avoid retries) - ISSUE bug(rtk curl): JSON schema conversion destroys API response values, breaks browser CDP connections #1152
fix(discover): exclude_commands bypass for env-prefix, sub cmd + regex ISSUES psql -h flag conflict + exclude_commands ignores env-var prefixed commands #917 Support exclude_commands config for auto-rewrite hook #243 bug(hooks): exclude_commands has no effect on rtk rewrite or hook output in 0.36.0 #1335
fix(hooks): windows use 'rtk hook claude' no fallback, remove guards ISSUES Support hook-based mode on Windows (rtk init --global) #502 Feature Request: Support hook-based mode on Windows #1353 Add hooks support for Windows #330 Persistent "No hook installed" warning on Windows after rtk init -g --opencode #913 Add option to suppress 'No hook installed' warning on Windows #1373 Need config to suppress warnings like "No hook installed — run
rtk init -gfor automatic token savings" #682 [BUG] RTK Windows PowerShell Compatibility Gaps #1248 ( check in the PR comments to see all supersed PR )