Skip to content

fix: bypass keybinding customization gate for nonessential traffic mode#658

Open
VitalyOstanin wants to merge 1 commit intoPiebald-AI:mainfrom
VitalyOstanin:fix/keybinding-customization-gate
Open

fix: bypass keybinding customization gate for nonessential traffic mode#658
VitalyOstanin wants to merge 1 commit intoPiebald-AI:mainfrom
VitalyOstanin:fix/keybinding-customization-gate

Conversation

@VitalyOstanin
Copy link
Copy Markdown

@VitalyOstanin VitalyOstanin commented Apr 2, 2026

Summary

Custom keybindings from ~/.claude/keybindings.json are silently ignored when CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1. The tengu_keybinding_customization_release feature flag defaults to false without GrowthBook, causing isKeybindingCustomizationEnabled() to block all user keybinding loading.

This patch force-enables the gate function (return !0; before the GrowthBook check), same technique as worktreeMode, voiceMode, and channelsMode patches.

Changes

  • keybindingCustomization.ts — patch implementation with idempotency check
  • keybindingCustomization.test.ts — tests for success, already-patched, and pattern-not-found
  • index.ts — register patch as ALWAYS_APPLIED (no config condition)

Test plan

  • pnpm test — 224 tests pass
  • pnpm lint — no errors
  • Applied to CC 2.1.89 native binary — patch succeeds
  • Verified custom keybindings load with CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1

Summary by CodeRabbit

  • New Features

    • Added a keybinding customization patch that enables custom keybindings when a specific environment variable is set; it is applied as part of the standard patch flow.
  • Tests

    • Added tests validating the patch across patched, unpatched, and non-matching file states.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 2, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a45c7d4d-fd78-4334-8976-546fae5fa4dc

📥 Commits

Reviewing files that changed from the base of the PR and between 71d87e8 and 5ff401d.

📒 Files selected for processing (3)
  • src/patches/index.ts
  • src/patches/keybindingCustomization.test.ts
  • src/patches/keybindingCustomization.ts
✅ Files skipped from review due to trivial changes (2)
  • src/patches/index.ts
  • src/patches/keybindingCustomization.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/patches/keybindingCustomization.ts

📝 Walkthrough

Walkthrough

A new patch, keybinding-customization, was added and registered to always apply. It injects return !0; into a detected keybinding gate in target files via writeKeybindingCustomization, with tests covering successful patching, idempotency, and missing-pattern behavior.

Changes

Cohort / File(s) Summary
Patch Registration
src/patches/index.ts
Registered new keybinding-customization patch under PatchGroup.ALWAYS_APPLIED and wired writeKeybindingCustomization into patchImplementations.
Implementation
src/patches/keybindingCustomization.ts
Added `writeKeybindingCustomization(oldFile: string): string
Tests
src/patches/keybindingCustomization.test.ts
Added tests validating successful patch insertion, idempotent behavior when already patched, and null return when pattern absent.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • bl-ue
  • georpar

Poem

🐰 I hopped through code, a nibble and a twitch,
Slipped return !0; where the gate made a hitch.
Tests checked my burrow—three hops, all clear,
Patch applied, idempotent, nothing to fear. 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a patch to bypass the keybinding customization gate when nonessential traffic is disabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Custom keybindings from ~/.claude/keybindings.json are blocked when
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 because the feature flag
tengu_keybinding_customization_release defaults to false without
GrowthBook. This patch force-enables the gate function.
@VitalyOstanin VitalyOstanin force-pushed the fix/keybinding-customization-gate branch from 71d87e8 to 5ff401d Compare April 4, 2026 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant