Skip to content

Fixed Bypass Permissions edit mode not suppressing the file diff dialog - #112

Merged
oleg68 merged 1 commit into
nbplugins:mainfrom
oleg68:bugfix/bypass-permissions-registry-lost
May 12, 2026
Merged

oleg68 merged 1 commit into
nbplugins:mainfrom
oleg68:bugfix/bypass-permissions-registry-lost

Conversation

@oleg68

@oleg68 oleg68 commented May 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • startProcess() called setEditMode() before setWorkingDirectory(), so the edit mode was never written to EDIT_MODE_REGISTRY (which requires a non-null working directory)
  • getEditModeForCwd() found no entry and returned DEFAULT, causing the diff permission dialog to appear even in Bypass Permissions mode
  • Fix: setWorkingDirectory() now syncs the current editMode into the registry when the directory is assigned

Test plan

  • New unit test setWorkingDirectoryAfterEditModeSyncsRegistry reproduces the bug and passes with the fix
  • All 18 ClaudeSessionModelTest tests pass
  • Manual: open a session, select Bypass Permissions in the edit mode combo, ask Claude to edit a file → diff tab must not appear

🤖 Generated with Claude Code

The edit mode was stored in EDIT_MODE_REGISTRY only when workingDirectory
was already set. In startProcess(), setEditMode() is called before
setWorkingDirectory(), so the registry entry was silently skipped and
getEditModeForCwd() returned DEFAULT for every hook call.

Fix: setWorkingDirectory() now writes the current editMode to the registry
when workingDirectory is assigned and editMode is non-null.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@oleg68
oleg68 merged commit 043ecf8 into nbplugins:main May 12, 2026
3 checks passed
@oleg68
oleg68 deleted the bugfix/bypass-permissions-registry-lost branch May 12, 2026 05:15
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