You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Re-land canvas-apps sync reminder hook, fixed for Claude Code
Re-applies the hook from microsoft#320, which was reverted in microsoft#327 because it broke
Claude Code. The hook logic (inject-sync-reminder.cs) is restored byte-for-byte;
only the registration wiring changed.
Two defects in microsoft#320, either one fatal:
1. `"hooks": "hooks/hooks.json"` in .claude-plugin/plugin.json. Claude Code
rejects the path unless it is `./`-relative, failing installation with
`Validation errors: hooks: Invalid input`. Even written as
`"./hooks/hooks.json"` it is redundant — Claude auto-discovers the file, then
reports the explicit reference as a duplicate hook source and disables the
plugin's MCP servers. model-apps and power-pages ship working hooks with no
`hooks` field at all.
2. `userPromptTransformed` in hooks/hooks.json. Claude Code reads that file and
rejects unrecognized event names, silently discarding the whole file and
disabling the plugin's canvas-authoring MCP server:
[ERROR] Failed to load hooks for canvas-apps
[DEBUG] Plugin not available for MCP - error type: hook-load-failed
Registration now uses the two documented plugin hook formats, so each host reads
only the events it supports:
Claude Code | hooks/hooks.json (Claude format) | UserPromptSubmit
Copilot CLI | hooks.json at plugin root (Copilot) | userPromptTransformed
Two events are required because the hosts share no usable one: Copilot accepts
UserPromptSubmit as an alias for userPromptSubmitted, but that event has no
output processing, so the reminder would be generated and silently discarded.
Both manifests stay byte-identical mirrors, so the legacy compatibility check is
unaffected.
Also re-applies microsoft#320's removal of the deprecated generate-canvas-app skill,
which the revert restored, and corrects the AGENTS.md claim that Claude Code
"ignores the Copilot-only event and continues loading UserPromptSubmit" — the
behaviour that caused this outage.
Verified on Claude Code 2.1.220 and Copilot CLI 1.0.76-1: plugin installs and
loads (status enabled, MCP intact) and the reminder reaches the model in both
hosts. All four repository validation scripts pass.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
0 commit comments