mirror of
https://github.com/rtk-ai/rtk.git
synced 2026-09-19 07:33:17 +08:00
772b5012ed
* feat: passthrough fallback when Clap parse fails When RTK cannot parse a command (e.g. `rtk git -C /path status`), instead of exiting with error code 2, it now falls back to running the raw command directly. This keeps developer workflows unbroken. - Replace Cli::parse() with try_parse() + run_fallback() - Add parse_failures SQLite table for failure analytics - Add `rtk gain --failures` / `-F` to view failure log - Fallback preserves stdin/stdout/stderr via Stdio::inherit() - --help and --version still work normally Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: guard RTK meta-commands from fallback to raw execution When Clap fails to parse a meta-command like `rtk gain --badtypo`, show the Clap error directly instead of trying to execute `gain` as a binary from $PATH. Adds RTK_META_COMMANDS constant listing gain, discover, learn, init, config, proxy, hook-audit, cc-economics. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: move timer start before command execution in fallback TimedExecution::start() was called after the command finished, so all fallback commands showed ~0ms in rtk gain --history. Now the timer captures actual command runtime. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: add cleanup_old() call to record_parse_failure() The parse_failures table was never cleaned up because only record() called cleanup_old(). Now parse failures also trigger 90-day retention cleanup. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: strip ANSI codes from Clap error before SQLite storage Clap errors may contain terminal color codes. Strip them with utils::strip_ansi() before storing in the parse_failures table to avoid garbled output and wasted space. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: smoke test cargo test assertion and missing skip_test calls - cargo test check now matches RTK's filtered output format ("passed") in addition to raw "test result:" and "FAILURES" - Fix undefined `skip` calls to use existing `skip_test` function with proper (name, reason) arguments Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: fmt upstream files after rebase Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: update version refs to 0.23.0 and module count to 51 Upstream v0.23.0 release bumped Cargo.toml version and added mypy_cmd module. Update docs to match for CI validation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>