docs(disable): add disable env vars master implementation plan#362
Merged
Conversation
…v vars Create a LazyLock<DisableRegistry> singleton in jcode-base/src/disable.rs that caches all JCODE_DISABLE_* env vars at first access. Provides: - DisableFlag enum (12 variants: All, Hooks, Plugins, Memory, Swarm, Ambient, Mcp, Compaction, Telemetry, Mermaid, DesktopAnimation, PowerInhibit) - Master kill-switch: JCODE_DISABLE_ALL=1 disables all subsystems - Selective skip lists: JCODE_DISABLE_HOOK, JCODE_DISABLE_TOOL, etc. - Unified API: disabled(flag), hook_disabled(name), tool_disabled(name) Migrations: - env_overrides.rs: populates Config fields from DisableRegistry, keeps deprecated env var reads for backward compat with warnings - telemetry.rs: checks DisableFlag::Telemetry before JCODE_NO_TELEMETRY - power_inhibit.rs: checks both legacy env var and DisableFlag::PowerInhibit - animation.rs: checks DisableFlag::DesktopAnimation before JCODE_DESKTOP_REDUCED_MOTION - config_file.rs: early init of DisableRegistry at Config::load() Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Fix JCODE_DISABLE_BASE_TOOLS=false backward compat regression: deprecated env var now assigns parsed boolean directly instead of only upgrading to true, so =false correctly re-enables base tools. - Cache JCODE_DISABLE_BASE_TOOLS in DisableRegistry at init time instead of reading env var on every base_tools_disabled() call, consistent with the load-once principle used by all other flags.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Master implementation plan for centralizing jcode's scattered environment variable kill-switches into a unified
JCODE_DISABLE_*system, inspired by oh-my-claudecode's 3-tier disable architecture.Background
jcode currently has ~90
JCODE_*env vars scattered acrossenv_overrides.rsand various source files — all are config overrides, not kill-switches. OnlyJCODE_DISABLE_BASE_TOOLSis a true kill-switch. There's no centralized registry, no caching, no master kill, and no consistent pattern.Solution
Design follows oh-my-claudecode's 3-tier approach:
JCODE_DISABLE=1disables everythingJCODE_DISABLE_HOOKS=1,JCODE_DISABLE_PLUGINS=1, etc.JCODE_DISABLE_HOOK=pre_tool_use,post_tool_useNew crate module
crates/jcode-base/src/disable.rswith:DisableFlagenum (11 variants)DisableRegistrywithLazyLockcachingJCODE_DISABLE_FEATURE=...for experiment flag skippingFile
Full plan at
.omo/plans/disable-env-master-plan.md(694 lines, 11 sections).Next Steps
disable.rsmodule + env_overrides migration