# Filter AI keybindings when AI features are disabled \(\#56936\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/24c5b37e6e4952faf3145f10a97b3806aabfcb17)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 24c5b37e6e4952faf3145f10a97b3806aabfcb17

Requested commit: 24c5b37e6e4952faf3145f10a97b3806aabfcb17

Commit: 24c5b37e6e4952faf3145f10a97b3806aabfcb17

Tree: 2475dd63800780e87d83698795260ff1e96878c6

Author: Anthony Gregis

Committer: GitHub

## Message

```
Filter AI keybindings when AI features are disabled (#56936)

When `disable_ai` is set, bindings to AI-namespaced actions (assistant,
agent, inline_assistant, acp, edit_prediction, zeta) are now dropped at
keymap load time. Previously the bindings stayed active and their
handlers silently no-op'd, which shadowed lower-precedence editor
defaults — pressing ctrl-enter in an editor was captured by
`assistant::InlineAssist` and did nothing instead of falling through to
`editor::NewlineBelow`.

The filter applies to both default and user bindings, and a settings
observer reloads the keymap when `disable_ai` toggles at runtime.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #56692

Release Notes:

- Fixed AI keybindings remaining active and shadowing editor defaults
when AI features are disabled

---------

Co-authored-by: Chris Biscardi <chris@christopherbiscardi.com>
```

## Parents

- [04de6dab7c890d815e316f2f9554f9eeeaf8ebb2](https://git.cafe/gitcafe/zed/commit/04de6dab7c890d815e316f2f9554f9eeeaf8ebb2?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/24c5b37e6e4952faf3145f10a97b3806aabfcb17?format=markdown)
