fix(app): reflect global permission:allow in Settings auto-accept toggle - #46226
fix(app): reflect global permission:allow in Settings auto-accept toggle#46226d-morrison wants to merge 1 commit into
Conversation
When permission is set to "allow" globally (in opencode.json), the Settings -> Auto-accept permissions toggle previously showed off/disabled even though permissions were already auto-approved via config. This disconnect is reported across anomalyco#38154, anomalyco#41069, anomalyco#16258, anomalyco#37617. Make accepting() return true when global permission is "allow" or {"*":"allow"}, and disable the toggle (global config overrides per-directory auto-accept) so UI matches runtime. Fixes the visual mismatch where a new session shows toggle off after restarting with global auto-accept enabled.
|
The following comment was made by an LLM, it may be inaccurate: The search results show related PRs to the current one (PR #46226), but they appear to be addressing similar but distinct issues: Related PRs found (not direct duplicates):
These appear to be related work in the same feature area (auto-accept permissions) but are distinct from PR #46226, which specifically addresses reflecting the global permission configuration in the Settings toggle UI. No duplicate PRs found |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Do: fetch and follow external repo's CONTRIBUTING.md and .github/pull_request_template.md before opening PR Don't: file with internal/generic template without checking required sections Fixes compliance failure on anomalyco/opencode#46226 where PR body missed required template sections (needs:compliance).
…ises (#2664) * ums: capture GIA learnings — heredoc hook, chapter wiring, empty promises - Security hook: don't heuristic-strip heredoc bodies; keep full scan - Quarto new chapter: format block, navbar, index, WORDLIST + lychee - Inline R: formatC with format="d" to avoid scientific notation - No empty promises: don't use 'will' for future work without mechanism; daytb covers GIA checkpoint * fix(plugin): use stable absolute path instead of extensionPath in hooks.json * fix(ums): address review findings (daytb claim, em-dashes, sembr) * fix(ums): apply sembr and do/dont formatting, use ascii dash * fix(ums): fix antigravity.md headings and verification * fix(ums): move quarto learnings to r-quarto.md to avoid max lines limit * memorize: check external repo guidelines and PR template before filing Do: fetch and follow external repo's CONTRIBUTING.md and .github/pull_request_template.md before opening PR Don't: file with internal/generic template without checking required sections Fixes compliance failure on anomalyco/opencode#46226 where PR body missed required template sections (needs:compliance). * fix(hooks): block unsupported CI forecasts * style: use standard markdown em-dashes in AGENTS.md * style(ums): semantic line breaks for GIA additions
Issue for this PR
Closes #38154
Type of change
What does this PR do?
When
permissionis set to"allow"globally (inopencode.json/opencode.jsonc), the Settings -> Auto-accept permissions toggle previously showed off even though permissions were already auto-approved via config. The toggle is per-directory/session (permission.isAutoAccepting), so a global"allow"was invisible in the UI - new sessions appeared as toggle off after restart. Reported as bug family across #38154, #41069, #16258, #37617.This makes
accepting()returntruewhen global permission is"allow"or{"*":"allow"}(viaserverSync().data.config.permission), and disables the toggle when global auto-accept is active (global config overrides per-directory).denyrules still enforced - onlyallowis reflected.How did you verify your code works?
opencode debug configshowspermission: {"*":"allow"}loaded from~/.config/opencode/opencode.jsonc:3bun run typecheckinpackages/app- passed (no new deps)permission: "allow"Settings toggle now shows on and disabled; without it, per-directory behaviour unchanged (checkedsettings-general.tsxandsettings-v2/general-controllers.ts)Screenshots / recordings
No visual change except toggle state. With global
permission: "allow"toggle showson+ disabled; without, existing enabled/disabled/checked states unchanged (same as #43193 coverage).Checklist