Skip to content

fix: map Copilot task and web_search so Task policies fire - #693

Open
AshSgDe29071999 wants to merge 1 commit into
FailproofAI:mainfrom
AshSgDe29071999:fix/690-copilot-task-websearch
Open

fix: map Copilot task and web_search so Task policies fire#693
AshSgDe29071999 wants to merge 1 commit into
FailproofAI:mainfrom
AshSgDe29071999:fix/690-copilot-task-websearch

Conversation

@AshSgDe29071999

@AshSgDe29071999 AshSgDe29071999 commented Aug 13, 2026

Copy link
Copy Markdown

Summary

Unmapped Copilot tool names pass through raw. A policy written as toolName === \"Task\" therefore never ran on Copilot — no warning, just no enforcement.

Changes

  • taskTask
  • web_searchWebSearch
  • ask_user is not mapped: it has no filesystem or shell reach, so treating it as a benign pass-through is the safer call
  • Tests in copilot-canonicalize.test.ts and the existing COPILOT_TOOL_MAP table in handler.test.ts

Test plan

  • npx vitest run __tests__/hooks/copilot-canonicalize.test.ts

Fixes #690

Summary by CodeRabbit

  • Bug Fixes

    • Improved Copilot tool recognition by correctly canonicalizing task and web_search tool names.
    • Preserved existing behavior for unsupported tools such as ask_user.
  • Tests

    • Added coverage to verify consistent tool-name canonicalization across relevant workflows.

COPILOT_TOOL_MAP missed task and web_search, so policies matching
Task silently never fired on Copilot. ask_user is left unmapped:
it has no filesystem or shell reach.

Fixes FailproofAI#690
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a7f01dca-6a87-4edd-8906-ff1639267730

📥 Commits

Reviewing files that changed from the base of the PR and between e022752 and 3d819ab.

📒 Files selected for processing (3)
  • __tests__/hooks/copilot-canonicalize.test.ts
  • __tests__/hooks/handler.test.ts
  • src/hooks/types.ts

📝 Walkthrough

Walkthrough

The Copilot tool map now canonicalizes task to Task and web_search to WebSearch. Tests verify both mappings. ask_user remains unmapped.

Changes

Copilot tool canonicalization

Layer / File(s) Summary
Tool mapping and validation
src/hooks/types.ts, __tests__/hooks/copilot-canonicalize.test.ts, __tests__/hooks/handler.test.ts
COPILOT_TOOL_MAP maps task to Task and web_search to WebSearch. Tests verify both canonical names. ask_user remains unmapped.

Estimated code review effort: 2 (Simple) | ~5 minutes

Mergeability Score: ⚪ Minimal · up to 3d819

This localized change maps Copilot task and web-search tool names so the intended policies can run; no actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: chhhee10

Poem

A rabbit hops through hooks with care,
Two tool names now map bright and fair.
Task and WebSearch join the trail,
While ask_user stays off the scale.
Tests thump softly: “Mappings prevail!”

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: mapping Copilot task and web_search tools so Task policies can run.
Description check ✅ Passed The description explains the problem, changes, ask_user decision, tests, and linked issue, despite using different headings from the template.
Linked Issues check ✅ Passed The changes add both required mappings, preserve ask_user as unmapped with rationale, and add the requested canonicalization tests for issue #690.
Out of Scope Changes check ✅ Passed All changes are limited to the requested Copilot tool mappings and their tests, with no unrelated code changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

__tests__/hooks/copilot-canonicalize.test.ts

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

__tests__/hooks/handler.test.ts

ESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.

src/hooks/types.ts

ESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant