fix(opencode): address issue-manager permission review #61

Merged
martin merged 1 commit from opencode/issue-manager-review-fixes into main 2026-11-12 19:33:12 +00:00
Owner

Follow-up to the review on #53.

Changes

  • Document set_labels as an update_issue field rather than a separate MCP tool (verified against forgejo-mcp 3.3.0).
  • Require approval for destructive Forgejo operations in issue-manager: comment, attachment, and label deletion, time-entry deletion, and issue-time reset.
  • Restore the plan/explore edit deny; only plan may edit ~/.opencode/plan/**.
  • Require approval for Code Mode in read-only agents; build and general keep the existing allow.

Validation

  • just fmt — no changes.
  • nix eval of the desktop OpenCode agent permissions — passed.
  • nix build --dry-run of the desktop Home Manager activation — passed.
  • just build desktop is blocked by an unrelated error: hyprland-qtutils was removed upstream and is still referenced in shared/workstation/modules/hyprland/default.nix.

Refs #53

Follow-up to the review on #53. ## Changes - Document `set_labels` as an `update_issue` field rather than a separate MCP tool (verified against forgejo-mcp 3.3.0). - Require approval for destructive Forgejo operations in `issue-manager`: comment, attachment, and label deletion, time-entry deletion, and issue-time reset. - Restore the plan/explore edit deny; only `plan` may edit `~/.opencode/plan/**`. - Require approval for Code Mode in read-only agents; `build` and `general` keep the existing allow. ## Validation - `just fmt` — no changes. - `nix eval` of the desktop OpenCode agent permissions — passed. - `nix build --dry-run` of the desktop Home Manager activation — passed. - `just build desktop` is blocked by an unrelated error: `hyprland-qtutils` was removed upstream and is still referenced in `shared/workstation/modules/hyprland/default.nix`. Refs #53
fix(opencode): address issue-manager permission review
All checks were successful
ci/woodpecker/pr/pr-review Pipeline was successful
3d491f7e3f
- Document set_labels as an update_issue field rather than a tool
- Ask before destructive Forgejo deletions and time resets
- Restore plan and explore edit denies with a plan-file exception
- Require approval for Code Mode in read-only agents

Refs #53

Co-authored-by: OpenCode <opencode@anoma.ly>
martin force-pushed opencode/issue-manager-review-fixes from 3d491f7e3f
All checks were successful
ci/woodpecker/pr/pr-review Pipeline was successful
to e1309c6d97
All checks were successful
ci/woodpecker/pr/pr-review Pipeline was successful
2026-11-12 19:15:55 +00:00
Compare
Member

Review Summary

What was verified

  • Permission semantics (checked against the OpenCode V2 permissions docs): rules use last-match-wins with global rules before agent rules. The new ordering in default.nix is correct: readOnlyIssuePermissions places forgejo_* deny before the specific read allows (reads win, writes stay denied), and plan.permissions appends edit ~/.opencode/plan/** allow after edit * deny so the plan directory is the only editable path. ~ is expanded for edit resources at config load, so the plan path matches as intended.
  • Code Mode split: moving execute out of issueSkillPermissions into codeModePermission, concatenated only into codingIssuePermissions, correctly keeps execute * allow for build/general while plan/explore fall back to the global * ask — matching SKILL.md's "read-only agents may need to approve Code Mode use." Per the docs, execute only gates Code Mode itself; nested tools still enforce their own rules, so the forgejo deny/allow rules hold for read-only agents under Code Mode.
  • Destructive-op gating in issue-manager.md: all seven deletes/resets (comment, repo/org label, issue/comment attachment, time entry, time reset) are now ask, and since the frontmatter starts with * deny, the later ask rules correctly override it. Coverage matches the prose definition of destructive operations; reversible metadata ops (label add/remove, dependency remove, state change) intentionally remain allow. The prose hunks are consistent with both the permission list and default.nix (issueWriteTools are already ask for coding agents; forgejo_* deny covers read-only agents).
  • set_labels correction is consistent across issue-manager.md and SKILL.md (field of update_issue, not a standalone tool). Tool-name/effect changes rest on the PR's stated verification against forgejo-mcp 3.3.0; I could not independently re-run that check in this environment (shell unavailable), but nothing in the diff contradicts the existing tool naming.
  • No performance concerns; changes are permission lists and documentation only. The diff strictly tightens access except restoring plan's shipped ~/.opencode/plan/** edit exception.

Minor note

One wording nit in the new comment (non-blocking, style only).

Validation described in the PR (just fmt, nix eval, nix build --dry-run) is appropriate for this change; the hyprland-qtutils build blocker is correctly identified as unrelated.


*🤖 Review by opencode (opencode/mimo-v2.6-flash-free) — verdict: approve

# Review Summary ## What was verified - **Permission semantics (checked against the OpenCode V2 permissions docs):** rules use last-match-wins with global rules before agent rules. The new ordering in `default.nix` is correct: `readOnlyIssuePermissions` places `forgejo_* deny` before the specific read allows (reads win, writes stay denied), and `plan.permissions` appends `edit ~/.opencode/plan/** allow` *after* `edit * deny` so the plan directory is the only editable path. `~` is expanded for `edit` resources at config load, so the plan path matches as intended. - **Code Mode split:** moving `execute` out of `issueSkillPermissions` into `codeModePermission`, concatenated only into `codingIssuePermissions`, correctly keeps `execute * allow` for `build`/`general` while `plan`/`explore` fall back to the global `* ask` — matching SKILL.md's "read-only agents may need to approve Code Mode use." Per the docs, `execute` only gates Code Mode itself; nested tools still enforce their own rules, so the forgejo `deny`/`allow` rules hold for read-only agents under Code Mode. - **Destructive-op gating in `issue-manager.md`:** all seven deletes/resets (comment, repo/org label, issue/comment attachment, time entry, time reset) are now `ask`, and since the frontmatter starts with `* deny`, the later `ask` rules correctly override it. Coverage matches the prose definition of destructive operations; reversible metadata ops (label add/remove, dependency remove, state change) intentionally remain `allow`. The prose hunks are consistent with both the permission list and `default.nix` (`issueWriteTools` are already `ask` for coding agents; `forgejo_*` deny covers read-only agents). - **`set_labels` correction** is consistent across `issue-manager.md` and `SKILL.md` (field of `update_issue`, not a standalone tool). Tool-name/effect changes rest on the PR's stated verification against forgejo-mcp 3.3.0; I could not independently re-run that check in this environment (shell unavailable), but nothing in the diff contradicts the existing tool naming. - No performance concerns; changes are permission lists and documentation only. The diff strictly tightens access except restoring plan's shipped `~/.opencode/plan/**` edit exception. ## Minor note One wording nit in the new comment (non-blocking, style only). Validation described in the PR (`just fmt`, `nix eval`, `nix build --dry-run`) is appropriate for this change; the `hyprland-qtutils` build blocker is correctly identified as unrelated. --- *🤖 Review by opencode (opencode/mimo-v2.6-flash-free) — verdict: **approve** <!-- forgejo-opencode-review -->
clank-bot left a comment

Code review findings from opencode.

Code review findings from opencode. <!-- forgejo-opencode-review -->
@ -63,1 +63,4 @@
}
];
# Code Mode reaches the Forgejo MCP tools. Nested tool calls still enforce
# their own permissions, so read-only agents do not receive it.
Member
[style] The causal "so" in "Nested tool calls still enforce their own permissions, so read-only agents do not receive it" is misleading: read-only agents lose Code Mode because `codeModePermission` is only appended to `codingIssuePermissions`, not because nested calls enforce permissions. Consider rewording, e.g. "Nested tool calls enforce their own permissions; `codeModePermission` is only granted to coding agents, so read-only agents fall back to ask."
<!-- forgejo-opencode-review --> [style] The causal "so" in "Nested tool calls still enforce their own permissions, so read-only agents do not receive it" is misleading: read-only agents lose Code Mode because `codeModePermission` is only appended to `codingIssuePermissions`, not because nested calls enforce permissions. Consider rewording, e.g. "Nested tool calls enforce their own permissions; `codeModePermission` is only granted to coding agents, so read-only agents fall back to ask."
martin merged commit abcc8e6e87 into main 2026-11-12 19:33:12 +00:00
martin deleted branch opencode/issue-manager-review-fixes 2026-11-12 19:33:12 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Personal/nixos-configuration!61
No description provided.