feat(opencode): Add issue-manager agent and related skill #53
No reviewers
Labels
No labels
automerge
bug
dependencies
duplicate
help wanted
invalid
lang
rust
migrations
opencode
question
security
type
documentation
type
enhancement
type
maintenance
type
refactor
vulnerability
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Personal/nixos-configuration!53
Loading…
Reference in a new issue
No description provided.
Delete branch "opencode/agent/issue-manager"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
7e9cd160c92e6b3d1043Review Summary
This PR adds a global
issue-manageragent, an/add-issuecommand, aforgejo-issuesskill with shared conventions, and permission wiring indefault.nixso coding agents get approval-gated issue writes while plan/explore stay read-only. The overall design is thoughtful: permission ordering follows OpenCode's last-match-wins rules (denyforgejo_*first, then re-allow reads), the specialist keeps label-admin tools that coding agents explicitly deny,generalcorrectly re-denies subagents to counteract the global* askrule, and the command/agent prose consistently treats issue content as untrusted and avoids parallel backlogs.Findings worth addressing before merge:
set_labelsfallback is likely unreachable for the specialist. The skill documents a full-label-set replacement viaset_labelswhen incremental removal fails, butissue-manager.mdonly allowsforgejo_add_issue_labels/forgejo_remove_issue_labels. Ifset_labelsis a separate MCP tool (common in Forgejo/Gitea APIs), the catch-alldenyin the agent frontmatter blocks the exact fallback the skill prescribes.Destructive Forgejo operations are unconditionally
allowed onissue-manager. Comment/attachment deletion, label deletion, and especiallyreset_issue_time(wipes all entries, including other users') have no tool-levelaskgate. The agent body scopes this to the user's request, but the only defense against prompt injection via untrusted issue bodies is the system prompt. Consideraskfor delete/reset tools.plan/exploredo not regain their shipped deny posture. Global{action: "*", resource: "*", effect: "ask"}is appended after shipped agent policies and before agent-config rules, so plan's shipped "deny edits except~/.opencode/plan" already resolves toaskfor project files.readOnlyIssuePermissionswas the opportunity to restore aneditdeny (with a plan-file exception); without it, plan can still modify project files with one approval.Minor:
execute: allowinissueSkillPermissionsremoves the global Code Modeaskgate for every agent that receives issue permissions, including read-only plan/explore. Nested tools remain permission-checked, so impact is limited, but confirm this is intentional.Validation note: shell tooling was unavailable in this environment, so
just fmt/nix flake check/ a host build could not be run. Please runjust fmtand a dry build of an OpenCode-enabled host before merging.*🤖 Review by opencode (opencode/mimo-v2.6-flash-free) — verdict: changes
Code review findings from opencode.
@ -0,0 +66,4 @@- {action: forgejo_edit_org_label, resource: '*', effect: allow}- {action: forgejo_delete_org_label, resource: '*', effect: allow}- {action: forgejo_add_issue_labels, resource: '*', effect: allow}- {action: forgejo_remove_issue_labels, resource: '*', effect: allow}@ -0,0 +89,4 @@- {action: forgejo_list_my_tracked_times, resource: '*', effect: allow}- {action: forgejo_add_issue_time, resource: '*', effect: allow}- {action: forgejo_delete_issue_time_entry, resource: '*', effect: allow}- {action: forgejo_reset_issue_time, resource: '*', effect: allow}@ -11,0 +62,4 @@effect = "allow";}{action = "execute";@ -193,1 +280,4 @@effect = "deny";}];plan.permissions = readOnlyIssuePermissions;The review findings were addressed in #61.
set_labelsis anupdate_issuefield in forgejo-mcp 3.3.0, not a separate MCP tool. The skill and agent text now nameupdate_issuewithset_labels; no new permission is required.issue-managerare nowask-gated.planandexplorenow deny edits; onlyplanretains the~/.opencode/plan/**exception.buildandgeneralkeep the existing allow.Validation:
just fmt,nix evalof the desktop OpenCode permissions, and a dry-run Home Manager activation passed. The full desktop build is currently blocked by an unrelatedhyprland-qtutilsremoval.