Commit Graph

637 Commits

Author SHA1 Message Date
Patrick szymkowiak da486bf394 fix(tee): prevent panic on UTF-8 multi-byte truncation boundary
&raw[..max_file_size] panics if the byte offset falls inside a
multi-byte UTF-8 character (e.g. Japanese, emoji). Now finds the
nearest char boundary before slicing.

Ref: issue #640 (L-3 finding)

Signed-off-by: Patrick Szymkowiak <patrick@rtk-ai.app>
Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-04-07 15:42:15 +02:00
aesoft aa6317fb83 Merge pull request #990 from TropicalDog17/fix/issue-948
fix(ls): filter quality wrong truncation
2026-04-06 16:38:12 +02:00
aesoft d92c5d264a Merge pull request #1049 from rtk-ai/fix/resolve-merge-conflict
fix(merge): changelog conflicts
2026-04-06 12:42:50 +02:00
Adrien Eppling 12e57e870f merge: resolve CHANGELOG.md conflict (develop ← master)
Keep develop's [Unreleased] section on top, followed by master's
released versions (0.34.3, 0.34.2).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-06 12:36:55 +02:00
aesoft d813919a24 Merge pull request #1021 from rtk-ai/hotfix/proxy-childguard-signal
fix(proxy): kill child process on SIGINT/SIGTERM to prevent orphans
2026-04-06 09:55:43 +02:00
Adrien Eppling 33185101fc fix(proxy): kill child process on SIGINT/SIGTERM to prevent orphans
Drop-based ChildGuard doesn't run on signals with panic=abort (release
profile). Register a signal handler that stores the child PID in an
AtomicU32 and kills it on SIGINT/SIGTERM, then re-raises the signal
with default handler for correct exit status propagation.

Fixes orphan processes when rtk proxy is killed by Claude Code, process
managers, or manual kill — the root cause behind issue #897.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 19:58:03 +02:00
aesoft a919335519 Merge pull request #978 from rtk-ai/fix/batch-priority-issues
fix(main): kill zombie processes + path for rtk md + missing intergrations
2026-04-04 12:03:29 +02:00
aesoft 614c64eec2 Update Cargo.toml 2026-04-04 11:08:41 +02:00
aesoft bade4547b3 Update Cargo.toml 2026-04-04 11:07:36 +02:00
Tuan Tran d2ecbdb2ec bet 2026-04-04 01:10:31 +07:00
Tuan Tran 4cf0392777 chore: revert version bump 2026-04-04 01:07:54 +07:00
aesoft d85fe3384b fix(review): address ChildGuard disarm, stdin dedup, hook masking 2026-04-03 18:22:07 +02:00
aesoft 9c1cf2f403 Merge pull request #992 from em0t/fix/go-build-false-errors
fix(go): avoid false build errors from download logs
2026-04-03 16:04:23 +02:00
aesoft 13004e8b63 Merge branch 'fix/batch-priority-issues' of https://github.com/rtk-ai/rtk into fix/batch-priority-issues 2026-04-03 15:54:29 +02:00
em0t 2425ad68e5 fix(go): cover more build failure shapes
Signed-off-by: em0t <10153971+em0t@users.noreply.github.com>
2026-04-03 21:44:09 +08:00
aesoft 8465ca953f Merge pull request #980 from rtk-ai/fix/gh-pr-merge-canned
fix(gh): pass through gh pr merge instead of canned response (#938)
2026-04-03 15:34:06 +02:00
em0t 1177c9c873 fix(go): restore build error coverage
Signed-off-by: em0t <10153971+em0t@users.noreply.github.com>
2026-04-03 21:22:48 +08:00
aesoft 7571c8e101 Merge pull request #1000 from rtk-ai/fix/telemetry-init-message
fix(init): remove opt-out instruction from telemetry message
2026-04-03 15:13:38 +02:00
aesoft 62f4452276 Merge pull request #993 from em0t/fix/git-diff-hunk-context
fix(git): preserve full diff hunk headers
2026-04-03 14:46:01 +02:00
aesoft 1481bc5909 Merge pull request #994 from em0t/fix/go-test-failure-context
fix(go): preserve failing test location context
2026-04-03 14:43:52 +02:00
Patrick szymkowiak 7dbef2ce00 fix(init): remove telemetry info lines from init output
Telemetry details are already documented in the README privacy section.
No need to print them during init.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-04-03 13:37:52 +02:00
em0t 374fe64cfb fix(go): preserve failing test location context
Signed-off-by: em0t <10153971+em0t@users.noreply.github.com>
2026-04-03 18:09:21 +08:00
em0t 09b3ff9424 fix(git): preserve full diff hunk headers
Signed-off-by: em0t <10153971+em0t@users.noreply.github.com>
2026-04-03 18:09:20 +08:00
em0t d44fd3e034 fix(go): avoid false build errors from download logs
Signed-off-by: em0t <10153971+em0t@users.noreply.github.com>
2026-04-03 18:09:18 +08:00
aesoft 7217562355 Merge pull request #979 from rtk-ai/fix/grep-stdin-leak
fix(grep): close subprocess stdin to prevent memory leak (#897)
2026-04-03 11:33:01 +02:00
aesoft e918661440 fix(tracking): use std::env::temp_dir() for compatibility (instead of unix tmp) 2026-04-03 11:03:13 +02:00
aesoft 46b923f066 Merge branch 'fix/batch-priority-issues' of https://github.com/rtk-ai/rtk into fix/batch-priority-issues 2026-04-03 11:00:19 +02:00
aesoft 3f58018f4a fix(cmd): read/cat multiple file and consistent behavior 2026-04-03 11:00:16 +02:00
aesoft 9cf9ccc1ac fix(hook_check): detect missing integrations
Also fixes flaky test_rewrite_rtk_disabled_warns_on_stderr: the subprocess part relied on target/debug/rtk being current, but cargo test doesn't rebuild the standalone binary.

Added mtime guard -> skips when binary is older than test executable.
2026-04-03 10:56:32 +02:00
Tuan Tran cdb3db2bfc Merge branch 'develop' of github.com:rtk-ai/rtk into fix/issue-948 2026-04-03 14:19:22 +07:00
Tuan Tran e6b87d4eb2 fix: fix ls -la output parsing 2026-04-03 14:17:27 +07:00
aesoft eefeae4565 Merge pull request #982 from rtk-ai/fix/git-commit-ssh-signing
fix(git): inherit stdin for commit and push to preserve SSH signing (#733)
2026-04-03 09:03:08 +02:00
aesoft deda44f736 fix(docs): clean some docs + disclaimer 2026-04-02 21:33:38 +02:00
aesoft 158c74527f Merge pull request #981 from rtk-ai/fix/permission-default-ask
fix(security): default to ask when no permission rule matches (#886)
2026-04-02 21:08:44 +02:00
Patrick szymkowiak 6cee6c60b8 fix(git): inherit stdin for commit and push to preserve SSH signing (#733)
Command::output() sets stdin to Stdio::piped() by default, creating an
empty pipe instead of inheriting the terminal. SSH signing tools
(1Password, YubiKey, gpg-agent with pinentry) need TTY access on stdin
for passphrase prompts or agent communication. This caused signatures
to be silently dropped — commits succeeded but without gpgsig headers.

Fix: add .stdin(Stdio::inherit()) to git commit and git push commands
so they inherit the parent's stdin (terminal or hook pipe). Output
capture via stdout/stderr pipes is preserved.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-04-02 21:04:46 +02:00
Patrick szymkowiak d9ef47f998 docs(hooks): document permission precedence model in README
Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-04-02 20:28:51 +02:00
aesoft 402c48e669 Merge pull request #885 from jbronssin/feat/aws-expand-cli-filters
feat(aws): expand CLI filters from 8 to 25 subcommands
2026-04-02 19:23:17 +02:00
Patrick szymkowiak 41a6c6bf6d fix(security): default to ask when no permission rule matches (#886)
Previously, commands not in any deny/ask list were auto-allowed. This
bypassed Claude Code's least-privilege default where unlisted commands
should prompt the user for confirmation.

Permission precedence is now: Deny > Ask > Allow (explicit) > Default (ask).

Changes:
- permissions.rs: load allow rules from settings.json, add Default variant
- rewrite_cmd.rs: treat Default same as Ask (exit 3)
- hook_cmd.rs: add permission checks to Copilot VS Code hook (ask/allow/deny),
  add deny check to Gemini hook (no ask mode available in Gemini CLI)

Gemini CLI limitation: only supports allow/deny, no ask mode. Codex: ask
is parsed but fails open. These tools document the limitation.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-04-02 19:15:30 +02:00
Patrick szymkowiak e1f2845df0 fix(gh): pass through gh pr merge instead of canned response (#938)
pr_merge() was using run_filtered with a filter_fn that ignored stdout
and always returned "ok merged". This made AI agents believe PRs were
merged when they weren't.

Switch to run_passthrough so the real gh output is shown. gh pr merge
is a destructive action — the user must see exactly what happened.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-04-02 17:25:25 +02:00
Patrick szymkowiak 09979cf297 fix(grep): close subprocess stdin to prevent memory leak (#897)
When RTK runs via Claude Code's PreToolUse hook, grep/rg subprocesses
inherit the hook's open stdin pipe. They block waiting for EOF and never
terminate, accumulating memory unboundedly (reported: 514GB on 96GB Mac,
kernel panic).

Fix: set stdin(Stdio::null()) on both rg and grep fallback commands so
subprocesses get immediate EOF instead of inheriting the parent pipe.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-04-02 17:21:48 +02:00
aesoft d16fc6dacb fix(main): kill zombie processes + path for rtk md
https://github.com/rtk-ai/rtk/issues/892
https://github.com/rtk-ai/rtk/issues/897
2026-04-02 14:51:10 +02:00
aesoft 45d8dcaf3d Merge pull request #974 from rtk-ai/release-please--branches--master--components--rtk
chore(master): release 0.34.3
dev-0.35.0-rc.101 dev-0.35.0-rc.109 v0.34.3 dev-0.35.0-rc.102 dev-0.35.0-rc.103 dev-0.35.0-rc.105 dev-0.35.0-rc.106 dev-0.35.0-rc.107 dev-0.35.0-rc.108 dev-0.35.0-rc.100 dev-0.35.0-rc.110 dev-0.35.0-rc.111
2026-04-02 11:12:27 +02:00
github-actions[bot] e51be7a022 chore(master): release 0.34.3 2026-04-02 09:05:03 +00:00
aesoft bff0258424 Merge pull request #934 from rtk-ai/develop
fix(refacto): wrappers for standardization, exit codes lexer tokenizer, constants, code clean
2026-04-02 11:04:16 +02:00
aesoft 5bd35a33ad Merge pull request #952 from rtk-ai/fix/pr-934-review
fix(review): PR #934
2026-03-31 20:45:44 +02:00
aesoft bae7930119 fix(review): PR #934 2026-03-31 20:43:59 +02:00
Florian BRUNIAUX 13e37bf7a8 ci: enforce test presence on new/modified filter modules
Add check-test-presence.sh script and CI job that fails if any *_cmd.rs
file added or modified in a PR is missing a #[cfg(test)] block.

- New CI job runs with no dependencies (parallel to all other jobs, <10s)
- Uses --diff-filter=AM to catch both added files and test deletions
- --self-test mode for local verification
- Add missing tests to wget_cmd.rs (17 tests) and env_cmd.rs (12 tests)
  covering pure functions: compact_url, format_size, parse_error,
  extract_filename, mask_value, is_lang_var, is_cloud_var, etc.

Fixes the enforcement gap: CONTRIBUTING.md required tests but CI did not
check. Now 34/34 *_cmd.rs modules have #[cfg(test)].

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
2026-03-31 12:02:53 +02:00
Florian BRUNIAUX 7e6452c543 Merge pull request #528 from ousamabenyounes/fix/rtk-disabled-warning
warn: emit stderr warning on RTK_DISABLED=1 (#508)
2026-03-31 11:37:24 +02:00
Jb d1b37ced01 feat(aws): expand CLI filters from 8 to 25 subcommands
Add 17 specialized filters for high-token-waste AWS operations:
- CloudWatch Logs (get-log-events, filter-log-events, get-query-results)
- CloudFormation describe-stack-events (failures-first)
- Lambda list-functions, get-function (strips Environment secrets)
- IAM list-roles (extract principals), list-users
- DynamoDB scan/query/get-item (recursive type unwrapping)
- ECS describe-tasks (stoppedReason + exitCode)
- EC2 describe-security-groups (compact rule notation)
- S3API list-objects-v2, S3 sync/cp (text summary)
- EKS describe-cluster, SQS receive-message
- Secrets Manager get-secret-value

Architecture:
- Extract run_aws_filtered() shared runner with Result<i32> return
- Add force_tee_hint() for truncation recovery (no dead ends for LLMs)
- Follow six-phase contract (stderr tracking, tee on failure, exit codes)
- Migrate existing 8 handlers to shared runner

Inspired by #644 for DynamoDB get-item, S3 transfer, Secrets Manager,
query-results, and N-type precision.
2026-03-30 20:38:32 +02:00
aesoft 14265b48c3 Merge pull request #933 from rtk-ai/maintainers-apply-doc
fix(docs): add maintainers docs
2026-03-30 19:56:32 +02:00