Skip to content

feat(hooks): add RTK_DISABLED=1 env var to bypass all hooks - #1167

Closed
iRonin wants to merge 1 commit into
rtk-ai:developfrom
iRonin:feat/rtk-disabled-env-var
Closed

iRonin wants to merge 1 commit into
rtk-ai:developfrom
iRonin:feat/rtk-disabled-env-var

Conversation

@iRonin

@iRonin iRonin commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds the RTK_DISABLED=1 environment variable that bypasses all hook rewrites, providing a simple opt-out mechanism for the rewrite system.

Changes

  • src/hooks/rewrite_cmd.rs: Added early exit check at the start of run() — when RTK_DISABLED=1, the function calls process::exit(1) (passthrough mode) before any rewrite logic runs.
  • src/hooks/rewrite_cmd.rs: Added test test_rtk_disabled_env_var_bypasses_rewrite to verify the env var check logic.
  • README.md: Added Environment Variables section documenting RTK_DISABLED and RTK_TELEMETRY_DISABLED.

Usage

export RTK_DISABLED=1
# All hook rewrites are now bypassed (passthrough mode)

Closes #1153

@CLAassistant

CLAassistant commented Apr 10, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@pszymkowiak pszymkowiak added effort-small Quelques heures, 1 fichier enhancement New feature or request labels Apr 10, 2026
@pszymkowiak

Copy link
Copy Markdown
Collaborator

[w] wshm · Automated triage by AI

📊 Automated PR Analysis

✨ Type feature
🟡 Risk medium

Summary

Adds an RTK_DISABLED=1 environment variable that bypasses all hook rewrites by calling process::exit(1) early in the run() function. Includes a test for the env var check and documents RTK_DISABLED alongside RTK_TELEMETRY_DISABLED in the README.

Review Checklist

  • Tests present
  • Breaking change
  • Docs updated

Linked issues: #1153


Analyzed automatically by wshm · This is an automated analysis, not a human review.

@iRonin
iRonin changed the base branch from master to develop April 10, 2026 13:10
@iRonin
iRonin force-pushed the feat/rtk-disabled-env-var branch 3 times, most recently from 466cc4d to 181de69 Compare April 10, 2026 17:53
@KuSh

KuSh commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator

Closing as a duplicate of #3917, which adds the same exported RTK_DISABLED=1 passthrough for rtk rewrite, with unit tests that do not touch the process environment, an end to end test for the exit code and stdout contract, and the documentation update. This branch has also been conflicting since April. Please review #3917 and comment there if anything from your version is missing, or reply here if you meant a different scope.

@KuSh KuSh closed this Sep 12, 2026
@KuSh KuSh added the duplicate This issue or pull request already exists label Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duplicate This issue or pull request already exists effort-small Quelques heures, 1 fichier enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

enhancement: add RTK_DISABLED=1 environment variable to bypass all hooks

4 participants