Description
In OpenCode Desktop 1.18.3, the "Auto-accept permissions" toggle in the Settings dialog is permanently disabled (cursor: not-allowed) regardless of context. Users cannot enable auto-accept through the settings UI, even though the underlying feature works correctly via the TUI command palette (Mod+Shift+A or the permissions.autoaccept command) and the opencode --auto CLI flag.
Environment
- OpenCode Desktop: 1.18.3
- Platform: Windows (likely all platforms)
- Installation:
@opencode-aidesktop (Electron)
Reproduction
- Install OpenCode Desktop 1.18.3
- Open the app (any directory, including new/unused ones)
- Go to Settings -> General tab
- Hover over the "Auto-accept permissions" toggle -> cursor shows
not-allowed
- Click the toggle -> no response
Expected behavior
The toggle should be clickable. When enabled, subsequent permission requests should be automatically approved for the current session or directory, matching the behavior of Mod+Shift+A and opencode --auto.
Root cause
The settings dialog has two implementations selected at runtime based on settings.general.newLayoutDesigns:
// openSettings() in main-hem2imez.js
const module = settings.general.newLayoutDesigns()
? await import("./index-CHbW1EYV.js") // New layout (default in 1.18.3)
: await import("./dialog-settings-C3QH-NWT.js"); // Old layout (fallback)
When newLayoutDesigns is true (the default in 1.18.3), the new layout is loaded. Both implementations have the same fatal pattern -- the toggle's disabled property is bound to a directory lookup that always fails because no context is passed to the dialog.
New layout (index-CHbW1EYV.js):
const dir = createMemo(() => {
if (!props.sessionID) return void 0; // sessionID is never passed
return serverSync().session.lineage.peek(props.sessionID)?.session.directory;
});
// ...
<Switch
get checked() { return accepting(); }
get disabled() { return !dir(); } // always true
/>
Old layout (dialog-settings-C3QH-NWT.js):
const dir = createMemo(() => decode64(params.dir)); // params.dir is never passed
<Switch
get disabled() { return !dir(); } // always true
/>
The dialog is instantiated with empty props at the call site:
// main-hem2imez.js line 114429
dialog.show(() => createComponent(x2.DialogSettings, {})); // no sessionID, no dir
No sessionID or dir parameter is passed to the component, so dir() persistently returns undefined and the toggle is permanently disabled.
Meanwhile, the TUI command palette implementation works correctly because it directly accesses the SDK's current working directory:
// command palette handler
const toggleAutoAccept = () => {
const sessionID = params.id;
if (sessionID) permission.toggleAutoAccept(sessionID, sdk().directory);
else permission.toggleAutoAcceptDirectory(sdk().directory);
};
Suggested fix
Two possible approaches:
Option A -- Minimal (change disabled + add directory fallback):
- Set
disabled: false on the Switch so the toggle is always clickable
- Add fallback in
toggleAccept() to use toggleAutoAcceptDirectory(sdk().directory) when no sessionID is available (mirroring the command palette logic)
Option B -- Structural:
Pass the active session/directory context when opening the settings dialog:
dialog.show(() => createComponent(x2.DialogSettings, {
sessionID: currentSessionID,
dir: base64Encode(sdk().directory)
}));
Related
Description
In OpenCode Desktop 1.18.3, the "Auto-accept permissions" toggle in the Settings dialog is permanently disabled (cursor:
not-allowed) regardless of context. Users cannot enable auto-accept through the settings UI, even though the underlying feature works correctly via the TUI command palette (Mod+Shift+Aor thepermissions.autoacceptcommand) and theopencode --autoCLI flag.Environment
@opencode-aidesktop(Electron)Reproduction
not-allowedExpected behavior
The toggle should be clickable. When enabled, subsequent permission requests should be automatically approved for the current session or directory, matching the behavior of
Mod+Shift+Aandopencode --auto.Root cause
The settings dialog has two implementations selected at runtime based on
settings.general.newLayoutDesigns:When
newLayoutDesignsistrue(the default in 1.18.3), the new layout is loaded. Both implementations have the same fatal pattern -- the toggle'sdisabledproperty is bound to a directory lookup that always fails because no context is passed to the dialog.New layout (
index-CHbW1EYV.js):Old layout (
dialog-settings-C3QH-NWT.js):The dialog is instantiated with empty props at the call site:
No
sessionIDordirparameter is passed to the component, sodir()persistently returnsundefinedand the toggle is permanently disabled.Meanwhile, the TUI command palette implementation works correctly because it directly accesses the SDK's current working directory:
Suggested fix
Two possible approaches:
Option A -- Minimal (change
disabled+ add directory fallback):disabled: falseon the Switch so the toggle is always clickabletoggleAccept()to usetoggleAutoAcceptDirectory(sdk().directory)when nosessionIDis available (mirroring the command palette logic)Option B -- Structural:
Pass the active session/directory context when opening the settings dialog:
Related