Repository navigation
Conversation
The desktop injected 19 browser permission rules through OPENCODE_CONFIG_CONTENT, which merges after the user's global config. Those rules replaced any ask or deny the user had set, including a wildcard deny. Move them into the cm-browser config hook, which already places its lifecycle defaults before user rules, so the user's last matching rule wins. The values are unchanged: browser_open_history stays ask and every other browser tool is allow. The router also rejected desktop_set_panel whenever an authority object was present. The bridge passes ordinary task authority on every request, so ordinary sessions could never switch panels. Reject only delegated authority, which carries a lease token. The panel handler still checks native task ownership and agent access.
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
This was referenced Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
None. Follows the browser review findings on the injected browser permissions and the
desktop_set_panelrejection.The CookieMonster split carries copies of the removed permission block. They need the same removal when the split lands:
CM-Split-v2:packages/desktop/wpp/legacy-config.mjs, pinned bypackages/desktop/wpp/legacy-config.fixture.ts.CM-Splitwork:packages/desktop/src/main/wpp-integration/provider-config.mjs, pinned bypackages/desktop/wpp/provider-config.fixture.ts.CM-WPP-Bits has no browser permission rules, so this PR has no companion PR.
No file overlap with #72 or #73. Neither changes any of the 6 files in this PR.
Type of change
What does this PR do?
Two fixes in the CM Browser permission path:
Injected permissions replaced user rules.
o1CodeConfigContent()put 19 browser permission rules inOPENCODE_CONFIG_CONTENT. OpenCode merges that config after the user's global config, so these rules replaced the user's own. A user'sbrowser_fill: "ask"becameallow, andbrowser_execute_site_tool: "deny"becameallow. OpenCode applies the last matching rule, so the injected rules also beat a user's wildcard"*": "deny".The rules now live in the cm-browser plugin's
confighook, which already handled the 4 tab lifecycle tools this way. The hook puts its defaults before the user's rules and skips any tool the user has set, so the user's rule wins. The values are unchanged:browser_open_historystaysask, and every other browser tool isallow. The injected config no longer has apermissionblock.desktop_set_panelalways failed.route()inbrowser/router.tsrejectedset_panelwhenever an authority object was present. The bridge passes the ordinary task's authority on every request, so the tool could never switch panels. Only a delegated subagent's authority carries a leasetoken, so the check now rejects only that case. The panel handler inbrowser/tabs.tsstill matches the request to its window's task, and still requires agent access before it shows a browser tab.Behaviour change: a user with a wildcard
askordenyrule, or a single-valuepermissionsetting, now gets that policy for browser tools too. The cm-browser README andAGENTS.mdalready describe this behaviour. Users without such rules see no change.V2 is unaffected.
packages/coredoesn't readOPENCODE_CONFIG_CONTENTand doesn't run V1 pluginconfighooks, so it never saw either the injected rules or the hook defaults.How did you verify your code works?
bun testfrompackages/cm-browser: 105 pass. The plugin test now checks that every bundled browser tool has a default, that onlybrowser_open_historykeepsask, and that the user's exact and wildcard rules stay after the defaults.bun test src/main/browser/ src/main/wpp-bridge/frompackages/desktop: 866 pass. This includes a new router test: an ordinary session'sset_panelrequest reaches the panel handler, and a delegated child's request is rejected withaccess_deniedbefore reaching it.providerConfig.test.tsnow checks that the injected config has nopermissionblock.bun typecheckfrompackages/cm-browser, frompackages/desktop, and from the repo root (32 of 32 packages): pass.packages/cm-browser/test/plugin.test.tswasn't clean ondev; the assertion this PR replaced was the cause.Screenshots / recordings
Not a UI change.
Checklist