fix(plugin): restore permission merge order precedence#2806
Merged
code-yeongyu merged 1 commit intodevfrom Mar 24, 2026
Merged
Conversation
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <[email protected]>
There was a problem hiding this comment.
1 issue found across 2 files
Confidence score: 3/5
- There is a concrete regression risk in
src/plugin-handlers/tool-config-handler.ts: settingtask: "deny"after spreading user config will override any OpenCode SDK-compatible user-providedtaskvalue. - Because this issue is severity 7/10 with high confidence (10/10) and directly affects user configuration behavior, this carries moderate merge risk rather than a minor housekeeping concern.
- Pay close attention to
src/plugin-handlers/tool-config-handler.ts- merge order currently forcestaskand can break expected OpenCode compatibility.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/plugin-handlers/tool-config-handler.ts">
<violation number="1" location="src/plugin-handlers/tool-config-handler.ts:121">
P1: Custom agent: **Opencode Compatibility**
Placing `task: "deny"` after the user configuration spread completely overwrites any OpenCode SDK-compatible user settings for `task`.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Comment on lines
+121
to
122
| ...(params.config.permission as Record<string, unknown>), | ||
| task: "deny", |
There was a problem hiding this comment.
P1: Custom agent: Opencode Compatibility
Placing task: "deny" after the user configuration spread completely overwrites any OpenCode SDK-compatible user settings for task.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/plugin-handlers/tool-config-handler.ts, line 121:
<comment>Placing `task: "deny"` after the user configuration spread completely overwrites any OpenCode SDK-compatible user settings for `task`.</comment>
<file context>
@@ -116,9 +116,9 @@ export function applyToolConfig(params: {
- ...(params.config.permission as Record<string, unknown>),
webfetch: "allow",
external_directory: "allow",
+ ...(params.config.permission as Record<string, unknown>),
task: "deny",
};
</file context>
Suggested change
| ...(params.config.permission as Record<string, unknown>), | |
| task: "deny", | |
| task: "deny", | |
| ...(params.config.permission as Record<string, unknown>), |
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.
Problem
In
tool-config-handler.ts, OmO permissions were placed first in the merge order, meaningwebfetch: "allow"andexternal_directory: "allow"overrode any explicit user/OpenCodedenysettings. This widened access silently.Fix
Review
All 5 review-work lanes passed (goal, QA, code quality, security, context mining).
Tests passed, typecheck passed, build passed.
Summary by cubic
Fixes permission merge order so explicit user/OpenCode
denyvalues override OmO defaultallowforwebfetchandexternal_directory, preventing silent permission widening.tool-config-handler.ts: OmO defaults → OpenCode defaults → user overrides; keepstask: "deny".tool-config-handler.test.tsto ensure explicitdenyis preserved and defaults apply when unset.Written for commit 0b614b7. Summary will update on new commits.