| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
/review |
Sorry, something went wrong.
| return null | ||
| } | ||
|
|
||
| function DialogPermission() { |
There was a problem hiding this comment.
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.
|
|
||
| export function Permission() { | ||
| const dialog = useDialog() | ||
| onMount(() => {}) |
There was a problem hiding this comment.
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.
| import { useTheme } from "../context/theme" | ||
|
|
||
| export function Permission() { | ||
| const dialog = useDialog() |
There was a problem hiding this comment.
Suggestion: The dialog variable is declared but never used in this component. Consider removing it or using it.
Sorry, something went wrong.
| @@ -0,0 +1,53 @@ | |||
| import { onMount } from "solid-js" | |||
| import { useDialog } from "../ui/dialog" | |||
| import { TextAttributes } from "@opentui/core" | |||
There was a problem hiding this comment.
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.
| gap={1} | ||
| paddingLeft={2} | ||
| paddingRight={2} | ||
| onKeyDown={(e) => { |
There was a problem hiding this comment.
Suggestion: There is a console.log statement here that appears to be debug code. Consider removing it before merging.
Sorry, something went wrong.
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.
Removes permission setting from opencode config and adds test root configuration to prevent running tests from project root.
…omalyco#6319) for tool availability and tool execution
| Back | FazBrowse Home | New Git URL |
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:
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):
New Event Structure (PermissionNext.Event):
Key differences:
The reply values are the same: "once", "always", or "reject"
Server Changes
Other Changes