Skip to content

webfetch permission with object syntax crashes server on startup #29041

@ballsop

Description

@ballsop

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):

{
  "permission": {
    "webfetch": {
      "*": "ask"
    }
  }
}

Simple string value works fine:

{
  "permission": {
    "webfetch": "ask"
  }
}

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

  1. Add "webfetch": { "*": "ask" } to the permission section of
    opencode.jsonc

  2. Run opencode

  3. 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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions