Skip to content

Micode agents have no permission config — silenced by root-level permission denies #52

@simplyenak

Description

@simplyenak

Bug

Micode agents (planner, executor, codebase-locator, implementer, reviewer, etc.) define no permission field in their AgentConfig. When a project's opencode.json sets root-level permission denies (e.g. "task": "deny"), all micode agents inherit those denies and become non-functional — they spawn but return empty results because they can't use any tools.

Reproduction

  1. Have a project opencode.json with root permission denies:
{
  "plugin": ["micode"],
  "permission": {
    "task": "deny"
  }
}
  1. Try to use any micode agent via Task tool (planner, executor, codebase-locator, etc.)
  2. Agent spawns, returns empty result, no tool calls made

Root Cause

In src/agents/*.ts, none of the agent configs include a permission block. The AgentConfig type supports:

permission?: {
  edit?: "ask" | "allow" | "deny";
  bash?: ("ask" | "allow" | "deny") | { [key: string]: "ask" | "allow" | "deny" };
  webfetch?: "ask" | "allow" | "deny";
  doom_loop?: "ask" | "allow" | "deny";
  external_directory?: "ask" | "allow" | "deny";
};

When no permission is declared, agents inherit from the project's root config. A root "task": "deny" (or any tool deny) effectively kills all micode agents.

Native OpenCode agents (like build, plan) that users define in their opencode.json under "agent" work fine because they have explicit permission overrides. Micode agents have no such overrides.

Expected Behavior

Micode agents should either:

  1. Declare sensible default permissions in their AgentConfig so they work out-of-the-box regardless of root config, OR
  2. Document that users must add permission overrides in their opencode.json for each micode agent

Option 1 is ideal — each agent should declare the permissions it needs:

  • planner: read: allow, glob: allow, grep: allow, bash: allow (for research)
  • executor: edit: allow, write: allow, bash: allow, task: allow (to spawn implementers)
  • codebase-locator: read: allow, glob: allow, grep: allow
  • implementer: edit: allow, write: allow, read: allow, bash: allow
  • reviewer: read: allow, bash: allow (limited)

Workaround

Add permission overrides in the project's opencode.json:

{
  "agent": {
    "planner": { "permission": { "edit": "allow", "bash": "allow" } },
    "executor": { "permission": { "edit": "allow", "write": "allow", "bash": "allow", "task": "allow" } },
    "codebase-locator": { "permission": { "read": "allow", "glob": "allow", "grep": "allow", "bash": "allow" } },
    "implementer": { "permission": { "edit": "allow", "write": "allow", "read": "allow", "bash": "allow" } },
    "reviewer": { "permission": { "read": "allow", "bash": "allow" } }
  }
}

Environment

  • micode: 0.10.0
  • OpenCode: latest
  • OS: Fedora 43 (Podman toolbox container)

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions