Skip to content

bug(index): plan permission mode missing from PermissionModeEnum; tests assert wrong tool names #4

Description

@apex-skyner

Problems

1. Missing plan permission mode

The dev-agent-routing skill (and the plugin README) document permission_mode: "plan" for plan-approval workflows, but the current PermissionModeEnum only accepts "bypassPermissions" and "default". Passing plan causes a schema validation error.

// current
const PermissionModeEnum = Type.Union([
  Type.Literal('bypassPermissions'),
  Type.Literal('default'),
]);

Should also include Type.Literal('plan') and pass --permission-mode plan to Claude Code.

2. Stale/broken test fixture

src/index.test.ts asserts:

expect(getToolPluginMetadata(entry)?.tools.map((tool) => tool.name)).toEqual(["echo"]);

But the plugin exports 7 tools: agent_launch, agent_output, agent_respond, agent_sessions, agent_kill, agent_merge, agent_pr. The test is completely wrong and always fails.

3. Missing worktree_pr_target_repo parameter

The dev-agent-routing skill calls:

agent_launch(
  ...
  worktree_pr_target_repo: '<owner>/<repo>'  # for fork workflows
)

This parameter is not declared in the plugin schema so it is silently ignored.

Fix

  • Add plan to PermissionModeEnum and handle it with --permission-mode plan in arg building
  • Fix the test to assert the correct 7-tool list
  • Add worktree_pr_target_repo optional string parameter to agent_launch

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions