Skip to content

Action shortcuts recorded in the browser are never saved #18427

Closed

Description

@saphid

Bug

In a browser client (hosted or local web) with settings:write, you can record a shortcut in a project action's Keybinding field, both in Settings → Project → Actions and in the chat's action editor. Saving reports success and the action is saved. But the shortcut is never written. Reopening the editor shows the old or empty shortcut.

Cause

Both save paths skip all keybinding writes outside Electron:

  • apps/web/src/components/settings/useProjectScriptSettings.ts: if (!isElectron) continue; before the shortcut upsert/remove loop
  • apps/web/src/components/ChatView.tsx: changesKeybinding requires isElectron, and if (!isElectron) return updateResult; returns before the keybinding write

The editor itself doesn't apply that gate, so the field is editable in the browser and its value is silently dropped.

Question for maintainers

Keybindings live in the environment's keybindings.json and the RPCs already check settings:write. The gate was kept deliberately in #15394 ("with the electron guard preserved"), but the reason isn't written down. Which direction is intended?

  1. Browser clients may set action shortcuts. Remove both isElectron gates; the existing scope checks still apply. A reference implementation with focused tests (browser and Electron paths) is on saphid:t3code/sweep/action-shortcut-browser.
  2. Shortcuts are desktop-only. Then disable or hide the Keybinding field outside Electron, so the browser doesn't offer a setting it won't save.

Happy to open a PR for either once the direction is clear. (Related, already open: #18412 fixes desktop saves deleting an unchanged shortcut when another field is edited.)

Found during an agent-driven audit (GPT-6.1 Sol), with the fix explored by GPT-6.1 Sol and reviewed by Claude Opus 5.5 in T3 Code. Filed by Claude Opus 5.5 in Claude Code via T3 Code on behalf of Alex Southwell.

Activity

  1. juliusmarminge commented on Oct 12, 2026

    @juliusmarminge
    Member

    Note

    Grok responding on behalf of Julius.

    This is a bug, confirmed on main. Browser keybindings aren't desktop-only. Settings → Keybindings already lets browser clients with settings:write add and edit bindings in keybindings.json, and only shows a warning that the browser may grab some shortcuts first. So the isElectron gates on the two action save paths are out of step with the rest of the app:

    • useProjectScriptSettings.ts: if (!isElectron) continue; skips the shortcut upsert/remove after a successful save.
    • ChatView.tsx: changesKeybinding requires isElectron, and if (!isElectron) return updateResult; returns success before the keybinding write.

    #15394 kept the guard as it was and doesn't give a reason for it. Nothing else on main treats action shortcuts as desktop-only.

    Option 1 is the right direction: remove both gates and keep the existing settings:write checks. Please open your branch as a PR with the browser and Electron tests, and keep it separate from #18412.

  2. added
    bugSomething is broken or behaving incorrectly.
    acceptedfeature request accepted
    via-triageFiled through npx t3 triage
    on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedfeature request acceptedbugSomething is broken or behaving incorrectly.via-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions