GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Permission rework by thdxr · Pull Request #6319 · anomalyco/opencode

Conversation

@thdxr

@thdxr thdxr commented Dec 28, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Summary

This is a major change that overhauls the permissions system in OpenCode.

Tools Merged into Permission

The tools configuration has been deprecated and merged into the permission field. Previously, you could enable/disable tools like this:

{
  "tools": {
    "bash": true,
    "edit": false
  }
}

Now, this should be configured using permission:

{
  "permission": {
    "bash": "allow",
    "edit": "deny"
  }
}

The old tools config is still supported for backwards compatibility and will be automatically migrated to the permission system.

Granular Permissions with Object Syntax

Permissions now support granular control using an object syntax with pattern matching. When you specify a permission as an object, you can set different rules for different patterns:

{
  "permission": {
    "bash": {
      "npm *": "allow",
      "git *": "allow",
      "rm *": "deny",
      "*": "ask"
    },
    "edit": {
      "*.md": "allow",
      "*.ts": "ask",
      "*": "deny"
    }
  }
}

Each key in the object is a glob pattern that matches against the tool's input, and the value is the action to take:

  • "allow" - automatically approve
  • "deny" - automatically reject
  • "ask" - prompt the user for approval

You can also set a blanket permission using a simple string:

{
  "permission": {
    "bash": "allow",
    "edit": "ask"
  }
}

Or set all permissions at once:

{
  "permission": "allow"
}

Breaking Changes for SDK Users

The permission events have changed significantly. The new PermissionNext module (permission/next.ts) has a different event structure compared to the old Permission module (permission/index.ts):

Old Event Structure (Permission.Event):

  • Updated: { id, type, pattern, sessionID, messageID, callID, message, metadata, time }
  • Replied: { sessionID, permissionID, response }

New Event Structure (PermissionNext.Event):

  • Asked: { id, sessionID, permission, patterns, metadata, always, tool: { messageID, callID } }
  • Replied: { sessionID, requestID, reply }

Key differences:

  • Event name changed from permission.updated to permission.asked
  • type renamed to permission
  • pattern is now patterns (array of strings)
  • message field removed
  • response renamed to reply
  • permissionID renamed to requestID
  • New always field contains patterns that would be approved for future requests if user selects "always"

The reply values are the same: "once", "always", or "reject"

Server Changes

  • New endpoint: POST /permission/:requestID/reply for responding to permission requests
  • Old endpoint POST /session/:sessionID/permissions/:permissionID is now deprecated
  • GET /permission now returns PermissionNext.Request[] instead of Permission.Info[]
  • Added CORS whitelist support via server.cors config option
  • Added Content-Type headers for proxied static assets
  • mDNS service name now includes port for uniqueness

Other Changes

  • Agent tools field is deprecated - use permission instead
  • Agent maxSteps is deprecated - use steps instead
  • Unknown agent properties are now collected into options
  • Mode and plugin globs no longer search subdirectories (simplified to top-level only)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cravenceiling, aryasaatvik, GabeDuarteM, and tamasbelinszky reacted with rocket emoji Eric-Guo and GabeDuarteM reacted with eyes emoji
All reactions
  • 🚀 4 reactions
  • 👀 2 reactions
@thdxr
thdxr force-pushed the permission-rework branch 7 times, most recently from 2964abd to 591cbd4 Compare December 31, 2025 23:16
@thdxr

thdxr commented Dec 31, 2025

Copy link
Copy Markdown
Member Author

@copilot review this bitch

connorads reacted with laugh emoji Copilot, mickyyy68, and klenkiven reacted with eyes emoji
All reactions
  • 😄 1 reaction
  • 👀 3 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Copilot AI commented Dec 31, 2025

Copy link
Copy Markdown
Contributor

@thdxr I've opened a new pull request, #6554, to work on those changes. Once the pull request is ready, I'll request review from you.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Copilot AI mentioned this pull request Dec 31, 2025
Refactor permission system with context-aware requests and auto-resolution #6554
Closed
@thdxr

thdxr commented Jan 1, 2026

Copy link
Copy Markdown
Member Author

/review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

github-actions[bot]
github-actions Bot reviewed Jan 1, 2026
View reviewed changes
Comment thread packages/opencode/src/cli/cmd/tui/component/dialog-permission.tsx Outdated
return null
}

function DialogPermission() {

@github-actions github-actions Bot Jan 1, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: This DialogPermission component is defined but never used or exported. Consider either completing and using it, or removing it to keep the codebase clean.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
github-actions[bot]
github-actions Bot reviewed Jan 1, 2026
View reviewed changes
Comment thread packages/opencode/src/cli/cmd/tui/component/dialog-permission.tsx Outdated

export function Permission() {
const dialog = useDialog()
onMount(() => {})

@github-actions github-actions Bot Jan 1, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: The Permission component has an empty onMount callback that does nothing. This could be removed unless there are plans to add functionality later.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
github-actions[bot]
github-actions Bot reviewed Jan 1, 2026
View reviewed changes
Comment thread packages/opencode/src/cli/cmd/tui/component/dialog-permission.tsx Outdated
import { useTheme } from "../context/theme"

export function Permission() {
const dialog = useDialog()

@github-actions github-actions Bot Jan 1, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: The dialog variable is declared but never used in this component. Consider removing it or using it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
github-actions[bot]
github-actions Bot reviewed Jan 1, 2026
View reviewed changes
Comment thread packages/opencode/src/cli/cmd/tui/component/dialog-permission.tsx Outdated
@@ -0,0 +1,53 @@
import { onMount } from "solid-js"
import { useDialog } from "../ui/dialog"
import { TextAttributes } from "@opentui/core"

@github-actions github-actions Bot Jan 1, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: The TextAttributes import is unused in this file (only used in the unused DialogPermission component). Consider removing it along with the cleanup of unused code.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
github-actions[bot]
github-actions Bot reviewed Jan 1, 2026
View reviewed changes
Comment thread packages/opencode/src/cli/cmd/tui/component/dialog-permission.tsx Outdated
gap={1}
paddingLeft={2}
paddingRight={2}
onKeyDown={(e) => {

@github-actions github-actions Bot Jan 1, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: There is a console.log statement here that appears to be debug code. Consider removing it before merging.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@thdxr
thdxr force-pushed the permission-rework branch 3 times, most recently from 96b1106 to 6c21fd1 Compare January 1, 2026 21:49
thdxr added 11 commits January 1, 2026 16:49
@thdxr
feat: add command-aware permission request system for granular tool a…
f24683e
…pproval
@thdxr
sync
8ca4343
@thdxr
sync
aeca805
@thdxr
scrolly
421d89b
@thdxr
fix
32c3fcb
@thdxr
sync
f77e1d9
@thdxr
sync
c5d1a51
@thdxr
sync
a7f920d
@thdxr
fix
91e710a
@thdxr
core: migrate permission system to new PermissionNext API
f31006b
Replaces legacy Permission.respond with PermissionNext.reply for better async handling and updates server endpoints to use the new permission system. Improves error handling in session processor to work with both old and new permission rejection types.
@thdxr
core: update project configuration files
8d8f544
Removes permission setting from opencode config and adds test root configuration to prevent running tests from project root.
Eric-Guo added a commit to Eric-Guo/opencode that referenced this pull request Jan 10, 2026
@Eric-Guo
Updated the debug agent command to use the new permission ruleset (an…
77e445e
…omalyco#6319) for tool availability and tool execution
@benceferdinandy-signifyd benceferdinandy-signifyd mentioned this pull request Jan 12, 2026
Regression: Permission prompt keyboard shortcuts (enter/a/d) removed in Permission rework #7954
Closed
This was referenced Jan 13, 2026
fix(task): respect agent task permission for nested sub-agents #8111
Merged
Task tool permission override no longer works for nested sub-agents #8114
Closed
@github-actions github-actions Bot mentioned this pull request Jan 21, 2026
Nested Permissions in Agent Markdown #9755
Closed
@thoughtentity thoughtentity mentioned this pull request Feb 16, 2026
Subagents can't use 'todowrite' tool #12938
Closed
@kitlangton kitlangton mentioned this pull request Mar 15, 2026
chore(permission): delete legacy permission module #17534
Merged
2 tasks done
@adrianlzt adrianlzt mentioned this pull request Mar 26, 2026
<directories> section in the system prompt is disabled #19263
Closed
@kilo-code-bot kilo-code-bot Bot mentioned this pull request Apr 9, 2026
fix: block subagents from spawning subagents Kilo-Org/kilocode#7056
Merged
@coderabbitai coderabbitai Bot mentioned this pull request Apr 26, 2026
feat: define EventCore stream design patterns jwilger/union_square-archive-20260705#194
Merged
@bingkxu bingkxu mentioned this pull request May 9, 2026
fix(run): remove sessionID filter for permission.asked to fix subagent permission hang #26427
Closed
@coderabbitai coderabbitai Bot mentioned this pull request Jun 22, 2026
chore(044/045): ecossistema OpenCode + investigação de débitos + BL-033 gitignore FarenRavirar/artificio#85
Merged
@coderabbitai coderabbitai Bot mentioned this pull request Jun 30, 2026
feat(chat): add agent mode and reasoning level controls oomol-lab/wanta#77
Merged
@coderabbitai coderabbitai Bot mentioned this pull request Jul 18, 2026
feat(game): implement design system POC with styled game screen antoinezanardi/goat-it-web-game#50
Merged
@IbrahimKhan12 IbrahimKhan12 mentioned this pull request Jul 29, 2026
fix(opencode): exclude denied MCP tools from provider requests #38060
Closed
3 of 6 tasks
This was referenced Aug 2, 2026
feat: add OpenCode support baleen37/skills#746
Closed
refactor(game): extract page states into dedicated components with transitions antoinezanardi/goat-it-web-game#114
Merged
@kitlangton kitlangton mentioned this pull request Aug 12, 2026
feat(server): web-standard fetch handler entry #41896
Merged
@kiliantgs kiliantgs mentioned this pull request Aug 13, 2026
[Feature]: add todo support for v2 #42421
Closed
@coderabbitai coderabbitai Bot mentioned this pull request Aug 23, 2026
feat(providers): bridge OpenCode V2 native tools coleam00/Archon#2761
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@github-actions github-actions[bot] github-actions[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@thdxr @aspiers @actions-user @adamdotdevin
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.