Skip to content

COPILOT_TOOL_MAP is missing task and web_searchTask policies silently never fire on Copilot #690

Description

@chhhee10

COPILOT_TOOL_MAP in src/hooks/types.ts canonicalises GitHub Copilot's tool names so that policies written against canonical names (Bash, Read, Task, …) fire on Copilot sessions.

Two documented Copilot tools are missing from it: task and web_search.

Why it matters

Unmapped tool names pass through uncanonicalised. So a policy matching toolName === "Task" silently never fires on Copilot — no warning, no error, it simply doesn't run.

For a guardrail tool that's the worst failure mode: the user believes they're protected and they aren't.

Where to fix

Add to COPILOT_TOOL_MAP in src/hooks/types.ts:

task: "Task",
web_search: "WebSearch",

The existing web_fetch: "WebFetch" entry sits right there as a model to follow.

One small judgement call

Copilot also documents an ask_user tool. It has no filesystem or shell reach, so it's arguably benign and needs no entry at all. We genuinely haven't decided — form a view and say which way you went in the PR description. Either answer is fine if it's reasoned.

Done when

  • both entries exist
  • a test in __tests__/hooks/ asserts a Copilot task payload canonicalises to Task — see how the other CLI tool maps are tested for the shape

Reference: Copilot CLI hooks reference

Two lines of source plus a test — a good way to get familiar with how the CLI integrations are wired.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions