anomalyco / anomalyco/opencode

fix(app): auto-accept toggle disabled when no session is open

Open
#48,237 4 comments 0 reactions 1 assignee View on GitHub

@Hona is already working on this.

Since Sep 9, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

The Settings → General auto-accept permissions switch is greyed out whenever no session is open (home / new-session / draft views). Possibly the same family as #37617 / #45159 / #31137 — this report adds a root-cause analysis and a tested fix design: createPermissionScopeController resolves its directory only from session lineage, and the settings dialog never forwards the route directory it already computes.

Reproduction
  1. Open the app with no session (home / new-session view)
  2. Go to Settings → General
  3. The auto-accept permissions switch is disabled (no directory context)
  4. Open any session → the switch works (session lineage supplies the directory)
Environment
  • opencode v1.18.29 (source build), Linux; likely all platforms / distributions
  • No session open (home / draft views)
Suggested fix

Add a fallbackDirectory to the controller (session lineage first, route directory otherwise) and thread directory() from DialogSettings through SettingsGeneralV2. With no session, the switch reflects and writes the directory-level flag, which new sessions already inherit on submit (submit.ts shouldAutoAcceptenableAutoAccept). The switch stays disabled only when no directory is known at all. Tested locally (3 files, +25/−9); patch available on request.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.