Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
BREAKING CHANGE: `rtk proxy <cmd>` is now `rtk bypass <cmd>` (the old name stays as an alias), `--ultra-compact` is removed, `rtk gain` excludes oversized outputs from its headline rate, and the default binary's licence changes (an Apache-2.0 edition, rtk-oss, ships alongside). See BREAKING_CHANGES.md. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
📊 Automated PR Analysis
SummaryThis PR introduces RTK v1.0, adding a configurable pipeline system (pipeline.toml) that can deny, route, compress, or judge tool calls before/after execution, plus an optional local LLM proxy that strips noise from agent-to-model traffic. It also renames Review Checklist
Analyzed automatically by wshm · This is an automated analysis, not a human review. |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
CodeQL "cleartext logging of sensitive information": the 4 alerts are dismissed as false positives
Checked with a canary key against a fake worker, on success, a 401 response and a refused connection, with the decision log on: the key never appears in stdout, stderr, |
release-please releases the root package only, with tags kept as v<version>. The workspace members (engine, plugin, text) follow it as the Rust strategy bumps them; proxy/ is listed as an extra file. A per-crate setup would have published five releases with component tags, which the installers, Homebrew and winget cannot resolve. Also: the secret scanner's sk- label names no vendor, and the editions page uses the same install script URL as the README. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… tasks named after real commands; a blank message keeps a reason - `route` at hook.before_tool.edit is E005. The hand-over sent the edit to a `generate` task, which rewrote the whole target from a spec and the reference alone. A route at `any` no longer hands an Edit to `generate`. - The hook-path load applies the same reserved-command check as `validate` and `pipeline add`, so a `[task.make]` file is dropped there too instead of routing a command to `rtk make`, which runs make. - An empty or blank `message` on a deny or route falls back to the default text, so no host ever receives an empty block reason. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ook core is develop's again decision.rs, rewrite_cmd.rs, hook_check.rs and the OpenCode, Pi, Hermes and OpenClaw plugins are back to develop. Claude Code's hook consults the pipeline from its own module (hook_cmd/claude_pipeline.rs, engine only) before the 0.x flow: deny, route and answer block with their message, a swap is only offered where develop would rewrite and always asks, and with no pipeline file the hook is unchanged. `rtk rewrite` no longer prints anything at exit 2. Co-Authored-By: Claude Opus 5.5 <[email protected]>
pszymkowiak
left a comment
There was a problem hiding this comment.
Approving on 2b96061b as a maintainer decision to let v1.0 land, with the open points below to be addressed before the release ships. Full review was run on a built binary with an isolated HOME, plus a local fake upstream for the daemon.
Verified
- fmt and clippy clean on the workspace,
cargo test --all4886 green, Apache-2.0 edition builds, proxy tests 274 green. - 0.x compatibility: 21 commands ×
rtk rewrite+rtk hook claudewith deny rules, develop vs this PR: 0 differences.rtk init -gwithout a pipeline writes one PreToolUse/Bash entry.rtk proxyalias works,--ultra-compactgone. - Release build startup on the hook path 14.6 → 15.7 ms, binary 9.4 → 15.5 MB.
- Pipelines end to end: the 12
rtk pipelinesubcommands, the six built-ins, 20/22 guide TOML blocks and all 7 examples validate (the other 2 are not pipelines), 38 E/W codes emitted as documented, project trust with SHA re-check,rtk:posthookon Bash/Grep/Read, everygainflag, quick-start step by step. - Daemon: relay with
x-rtk-*stripped and consistent content-length, SSE, CCR 202 KB → 3.2 KB withcache_controlkept andrtk_retrieveinjected, ICM file 0600, 413 on 70 MB, clean 502 without the upstream URL, 20 concurrent requests,/admin/settingscannot repoint the upstream,rtk gainreads the proxy DB. - Since
e61317a1: pipeline rules now act on Claude Code only, a swap always asks, a task named after a real command is rejected, the release-please manifest conflict with master is gone.
Open before release (security)
- Proxy credential lending has no caller check (
proxy/src/relayed_auth.rs,forward.rs:331,config.rs:332defaulttrue). Reproduced: after one request withx-api-key: sk-test-1, a request with no credential reaches the upstream carryingsk-test-1. No Host/Origin validation anywhere (Origin: http://evil.exampleis forwarded). Lending is also path-dependent: applied inforward::relay, not inccr_forward. Suggest loopback peer check + Host validation + defaultfalse. mode="answer"runsrg -n <pattern>andcurl -sL <url>in the hook with model-controlled values and no--(task_cmd.rs:864,870), and readsfile_pathwithout the permission gate (:857). Suggest--, http(s) only, gate the path.swap_commandstill interpolates the task name unquoted (task_cmd.rs:891) andvalidateonly checks collision with rtk commands. With the swap now always asking, this is a prompt showing an injected command rather than an auto-allow, but the name should be validated against[A-Za-z0-9_-]+and quoted.cargo clippy --manifest-path proxy/Cargo.tomlfails underwarnings = "deny"(collapsible_match,proxy/src/context_analysis.rs:187, rustc 1.93.1).
Open before release (behaviour)
- Conditions:
input={limit_gt=…},timeout_gt,run_in_background=truenever match onshell/read;input_missing=["limit"]matches even when present (works onsearch/any). after_toolexit_codevalidates but is never populated.ansistrips SGR only (private modes, OSC 8, OSC titles,\r,\bsurvive).redactis inert in this build with only W009.shadow=trueon a deny silently disables it with no warning. One validation error drops every deny of that file with no hook-time signal. rtk bulk-readwith no task configured exits 127 with "Permission denied" instead of a clear message;rtk pipeline explain --tool Grep < out.txtdisagrees with the live hook (format not inferred from stdin); W005 depends on theextendsform.rtk llm-proxy status|stats|stoprefuse to run when the daemon binary is not besidertkor on PATH, although they are pure HTTP clients; the lookup missesproxy/target/. CCR floor for Bash/WebFetch is 300 tokens regardless of the rule'stokens_gt(undocumented).cost_usdis 0 forclaude-sonnet-4-5.- Pi plugin:
hooks/pi/rtk.tsreturns before the gate for any command starting withrtk, sortk ls; secretcmdbypasses a pipeline deny.pipeline.logrecords full commands verbatim in a 0644 file.
Docs
- Dead links: the five translated READMEs →
docs/TROUBLESHOOTING.md;docs/guide/index.md→ rootARCHITECTURE.md;proxy/README.md→TECHNICAL.mdinstead ofproxy/CONTRIBUTING.md. - Wrong facts:
editions.mdsays no deb/rpmConflicts(Cargo.toml declares them);agent-coverage.mdsays Antigravity has no rewriting hook;proxy/configuration.mdomitscache_align,normalize,compression(RTK_PROXY_COMPRESSION),icm_db,icm_ttl_secs,upstream_timeout,upstream_retries; quick-startrtk init --global --dry-run -vfails (-vmust precede the subcommand); errors.md header example says E003, binary emits E004; E010 documented as an error, W016 observed;make installused as the unsupported-command example whilemakehas a filter; agent counts differ across README (18/19), supported-agents (18, no Kimi), agent-coverage (20), hooks/README (13), TECHNICAL (7);rtk proxystill emitted bygit_cmd.rs:974andast_grep_cmd.rs:302; the tree is 0.49.0 while docs say v1.0 and master is 0.52.0.
Governance — rtk-engine and rtk-proxy are BUSL-1.1 and the default rtk binary links the engine while Cargo.toml says license = "Apache-2.0"; the rtk-oss edition, install.sh RTK_EDITION=oss and the CI purity check are in place. Recorded here as an explicit team decision.
Related open issues of the same family: #3970, #3634, #4545, #4281, #4282, #4147, #3738, #1875.
| .or(file.compression) | ||
| .unwrap_or_else(|| "off".to_string()), | ||
| pixel_compress: file.pixel_compress, | ||
| relay_borrowing: cli.relay_borrowing.or(file.relay_borrowing).unwrap_or(true), |
There was a problem hiding this comment.
Open before release. relay_borrowing defaults to true and lend_if_missing (forward.rs:331) has no loopback peer check and no Host/Origin validation. Reproduced against a local fake upstream: after one request with x-api-key: sk-test-1, a request carrying no credential at all reached the upstream with sk-test-1 attached; Origin: http://evil.example was forwarded unchanged. A DNS-rebinding page is same-origin with itself, so neither CORS nor the x-rtk-proxy header protects this. relay_borrowing = false does switch it off (verified). Also path-dependent: ccr_forward.rs never lends. Suggest: loopback peer check, Host validation, default false.
| Some("search") => { | ||
| let pattern = text("input.pattern")?; | ||
| let path = text("input.path").unwrap_or_else(|| ".".to_string()); | ||
| let command = vec!["rg".to_string(), "-n".to_string(), pattern.clone(), path]; |
There was a problem hiding this comment.
Open before release. rg -n <pattern> <path> and curl -sL <url> (line 870) run inside the PreToolUse hook with values from the model and no --; a pattern or URL starting with - is parsed as an option, and curl accepts file://. The read branch at 857 reads any file_path with no permission check (no permissions:: reference in this file or in pipeline_config.rs). Only reachable with mode = "answer". Suggest -- before the operands, http(s) only, and the host's path rules on the read.
| let resolved = resolve_task(task_name)?; | ||
| let question = task_question(&resolved).unwrap_or_else(|| IN_HOOK_QUESTION.to_string()); | ||
| Some(format!( | ||
| "rtk {task_name} --question {} -- sh -c {}", |
There was a problem hiding this comment.
Open before release. task_name is interpolated raw while question and command are single-quoted. validate only checks collision with built-in rtk commands, so [task."a b;…"] is accepted. Since 2b96061b a swap always asks, so this shows the injected text in a prompt instead of auto-allowing it (it did on a3790678). Still worth closing: validate names against [A-Za-z0-9_-]+ and quote here.
RTK v1.0: pipelines and LLM proxy
RTK has always filtered the output of the commands your agent runs. v1.0 lets you decide what happens to every tool call, and adds an optional proxy that trims what your agent sends to the model.
Nothing changes when you upgrade. If you don't write a pipeline, RTK behaves exactly as it does today: same hook, same rewrites, same filters.
Pipelines
A
pipeline.tomlfile holds rules that act on your agent's tool calls, before or after they run:git push --force.Start from a ready-made pipeline in
examples/pipelines/, or runrtk pipeline add.rtk pipeline validate,showandstatustell you what is active and why. Pipelines can be shared and installed from GitHub.Works with Claude Code, Cursor, Codex, Gemini CLI, Copilot, OpenCode, Pi, OpenClaw, Hermes and the other supported agents.
Delegation
rtk bulk-read, and tasks you define, hand a read, a summary or a generated file to a cheaper model. The files never enter your agent's context.LLM proxy (optional)
rtk llm-proxystarts a local daemon between your agent and its provider. It removes what no reader needs, such as colour codes, progress bars and repeated lines, before your agent sends them to the model. It is off unless you start it.Savings
rtk gainnow shows savings per pipeline, and what the proxy saved.What changes for you
rtk proxy <cmd>is nowrtk bypass <cmd>. The old name keeps working.rtk gainmay show a lower headline percentage on the same history. Very large outputs that used to inflate it are now reported separately. Your data is unchanged.--ultra-compactis removed.rtk-oss, is available on every install channel.rtk initafter upgrading so your agent's instructions use the new command names.Docs
The guide in
docs/guide/covers pipelines, delegation, the proxy and every supported agent.🤖 Generated with Claude Code