anomalyco / anomalyco/opencode
fix(app): auto-accept toggle disabled when no session is open
@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
- Open the app with no session (home / new-session view)
- Go to Settings → General
- The auto-accept permissions switch is disabled (no directory context)
- 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 shouldAutoAccept → enableAutoAccept). The switch stays disabled only when no directory is known at all. Tested locally (3 files, +25/−9); patch available on request.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.