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
When an installed plugin's .claude-plugin/plugin.json declares commands as an array of objects (instead of the spec-required array of path strings), Copilot CLI crashes on every prompt with a minified, undebuggable error:
Execution failed: TypeError: a.replace is not a function
Surfaced to the user as Skills: error loading — TypeError: a.replace is not a function. The CLI is unusable until the offending plugin is uninstalled or its manifest is hand-patched. Users have no way to know which plugin or field is responsible.
Debug log shows the error originates during tool initialization:
[DEBUG] Failed to initialize tools for validation: TypeError: a.replace is not a function
[DEBUG] Failed to initialize tools for validation: TypeError: a.replace is not a function
[DEBUG] session.error event received: errorType=query, message=Execution failed: TypeError: a.replace is not a function
No plugin name, no field name, no file path, no stack trace.
Observe Execution failed: TypeError: a.replace is not a function and exit code 1.
Expected behavior
Two things, in priority order:
Don't crash the whole session because of one malformed plugin field. Skip the bad commands entry, log a warning, and continue loading the rest of the plugin (skills, agents, hooks).
Produce an actionable error. Something like:
[warn] gangsta: invalid plugin.json: "commands" must be an array of strings
(path strings), got array of objects. Field ignored.
At minimum: the plugin name, the file path, and the offending field.
This is consistent with the policy already adopted in #951 / #1631 (silently or gracefully tolerating unknown / spec-divergent fields rather than blowing up the whole session).
Additional context
Reproduced on Linux, Node v24.15.0, Copilot CLI 1.0.44.
Bisected: removing the commands field from the plugin's .claude-plugin/plugin.json (or rewriting it as ["commands/heist.md", ...] per the Claude Code plugin manifest spec) fully resolves the crash.
Likely culprit: the schema validator iterates commands and calls .replace(...) on each entry assuming string; a type guard and a clearer error message would prevent the crash.
Describe the bug
When an installed plugin's
.claude-plugin/plugin.jsondeclarescommandsas an array of objects (instead of the spec-required array of path strings), Copilot CLI crashes on every prompt with a minified, undebuggable error:Surfaced to the user as
Skills: error loading — TypeError: a.replace is not a function. The CLI is unusable until the offending plugin is uninstalled or its manifest is hand-patched. Users have no way to know which plugin or field is responsible.Debug log shows the error originates during tool initialization:
No plugin name, no field name, no file path, no stack trace.
Affected version
1.0.44
Steps to reproduce the behavior
plugin.jsondeclarescommandsas objects (e.g.kucherenko/gangstav1.1.0 — see plugin.json: "commands" must be an array of path strings — current object form crashes Copilot CLI with "a.replace is not a function" kucherenko/gangsta#42):copilot -p "hello" --allow-all-toolsExecution failed: TypeError: a.replace is not a functionand exit code 1.Expected behavior
Two things, in priority order:
commandsentry, log a warning, and continue loading the rest of the plugin (skills, agents, hooks).This is consistent with the policy already adopted in #951 / #1631 (silently or gracefully tolerating unknown / spec-divergent fields rather than blowing up the whole session).
Additional context
commandsfield from the plugin's.claude-plugin/plugin.json(or rewriting it as["commands/heist.md", ...]per the Claude Code plugin manifest spec) fully resolves the crash.commandsand calls.replace(...)on each entry assuming string; a type guard and a clearer error message would prevent the crash.