fix(hooks): map Copilot task/web_search in COPILOT_TOOL_MAP - #792
fix(hooks): map Copilot task/web_search in COPILOT_TOOL_MAP#792ZxlDragonDoctor wants to merge 1 commit into
Conversation
Without these entries a policy matching toolName === Task or WebSearch silently never fires on Copilot sessions. ask_user is left unmapped (no filesystem or shell reach). Fixes FailproofAI#690
|
Thanks @ZxlDragonDoctor for your contribution to Failproof AI! 🙌 We'd love to discuss your PR and welcome you to our community. Discord: https://discord.befailproof.ai/ |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe Copilot tool map now canonicalizes ChangesCopilot tool canonicalization
Estimated code review effort: 1 (Trivial) | ~5 minutes Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to Copilot task and web_search tools now canonicalize to Task and WebSearch for policy matching, with targeted handler coverage passing. No merge-blocking correctness, security, or availability risk is evidenced. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Warning Some tools did not complete. Review the errors below. 🔧 ESLint
__tests__/hooks/handler.test.tsESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox. src/hooks/types.tsESLint skipped: the matched ESLint configuration already failed (missing-dependency). 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. A rabbit checks the tool-name trail Comment |
Problem
COPILOT_TOOL_MAPinsrc/hooks/types.tsis missing documented Copilot toolstaskandweb_search. Unmapped names pass through uncanonicalised, so a policy matchingtoolName === "Task"(or"WebSearch") silently never fires on Copilot.Solution
task: "Task"andweb_search: "WebSearch"next to the existingweb_fetch: "WebFetch"entry.ask_userunmapped on purpose: it has no filesystem or shell reach, so it is not a guardrail surface. (Issue asked for a reasoned call either way.)__tests__/hooks/handler.test.tsso a Copilottaskpayload canonicalises toTask(andweb_search→WebSearch).Issue alignment
COPILOT_TOOL_MAPis missingtaskandweb_search—Taskpolicies silently never fire on Copilot #690; follows the reporter's suggested map entries and Done-when criteria.ask_user: intentionally unmapped (documented in the map comment and this PR).Testing
node node_modules/vitest/vitest.mjs run __tests__/hooks/handler.test.ts59 passed(includescanonicalizes every Copilot tool name in COPILOT_TOOL_MAPcoveringtask/web_search)__tests__/hooks/copilot-canonicalize.test.ts:8 passedAgent dimension
tool-retrieval — tool-name canonicalisation so policy routing matches the Claude-canonical tool surface across CLIs.
Core value
Copilot users who believe Task policies are protecting them were never protected — this closes that silent gap.
Fixes #690
Summary by CodeRabbit
taskandweb_searchtools using their canonical names.