Description
Using the object/pattern syntax for the webfetch permission in opencode.jsonc causes the server to crash on startup with "Unexpected server error" for config.providers, provider.list, app.agents, and config.get. I had been looking to see if I could provide a curated list of URLs (domains) that would be allowed while requiring a prompt for everything else.
Config that crashes (even with just a wildcard):
Simple string value works fine:
The permissions docs state:
For most permissions, you can use an object to apply different actions based
on the tool input.
and show object syntax examples for bash and edit. It is unclear whether webfetch is expected to support object syntax or not. If it is, this is a bug;
if not, the docs should clarify which permissions support pattern matching.
Plugins
none
OpenCode version
1.15.10
Steps to reproduce
-
Add "webfetch": { "*": "ask" } to the permission section of
opencode.jsonc
-
Run opencode
-
Observe:
Error: 4 of 5 requests failed: Unexpected server error. Check server logs for details.
Affected startup requests: config.providers, provider.list, app.agents, config.get
at vO (B:/~BUN/root/chunk-dk74dn3y.js:470:117)
at <anonymous> (B:/~BUN/root/chunk-dk74dn3y.js:470:5550)
at processTicksAndRejections (native:7:39)
Expected: Server starts normally and prompts on webfetch calls for URLs matching the patterns, OR docs explicitly state object syntax is not supported for this permission.
Screenshot and/or share link
No response
Operating System
Windows 11
Terminal
Windows Terminal
Description
Using the object/pattern syntax for the
webfetchpermission inopencode.jsonccauses the server to crash on startup with"Unexpected server error"forconfig.providers,provider.list,app.agents, andconfig.get. I had been looking to see if I could provide a curated list of URLs (domains) that would be allowed while requiring a prompt for everything else.Config that crashes (even with just a wildcard):
{ "permission": { "webfetch": { "*": "ask" } } }Simple string value works fine:
{ "permission": { "webfetch": "ask" } }The permissions docs state:
and show object syntax examples for
bashandedit. It is unclear whetherwebfetchis expected to support object syntax or not. If it is, this is a bug;if not, the docs should clarify which permissions support pattern matching.
Plugins
none
OpenCode version
1.15.10
Steps to reproduce
Add
"webfetch": { "*": "ask" }to thepermissionsection ofopencode.jsoncRun
opencodeObserve:
Expected: Server starts normally and prompts on webfetch calls for URLs matching the patterns, OR docs explicitly state object syntax is not supported for this permission.
Screenshot and/or share link
No response
Operating System
Windows 11
Terminal
Windows Terminal