github / github/copilot-cli

copilot plugin install does not load joinSession() extensions from installed-plugins/

未关闭
#3,023 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
area:plugins
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

### Describe the bug

Plugins cannot package or distribute Copilot CLI \xtension.mjs\ / \joinSession()\ extensions. The official plugin schema (\plugin.json\) does not include an \xtensions\ field, and \copilot plugin install\ stores files under \installed-plugins/\ which does not appear to participate in extension discovery.

Extensions are only discovered from \~/.copilot/extensions//extension.mjs\ and \.github/extensions//extension.mjs\, per the SDK docs.

This means plugin authors who build \joinSession()\ extensions (with tools, hooks, lifecycle events) cannot distribute them through the plugin system — users must manually copy files to the extensions directory.

### Affected version

1.0.37 (also tested on 1.0.26)

### Steps to reproduce the behavior

1. Create a plugin with a \plugin.json\ and an \xtension.mjs\ that exports \joinSession()\ from \@github/copilot-sdk/extension\
2. Install via \copilot plugin install /\
3. Plugin installs successfully — files copied to \~/.copilot/installed-plugins/\
4. Start a new Copilot CLI session (restart terminal)
5. Tools registered by the extension do not appear
6. Hooks (e.g., \onSessionStart\) do not fire

### Expected behavior

Either:
- \copilot plugin install\ should discover and load \xtension.mjs\ from installed plugins, OR
- The \plugin.json\ schema should support an \xtensions\ field for declaring extensions, OR
- The docs should clarify that extensions are not distributable via the plugin system

### Additional context

- OS: Windows 11, also tested on macOS
- Shell: PowerShell 7, zsh
- Workaround: Manually copy extension to \~/.copilot/extensions//extension.mjs\

**Real-world example:** [copilot-brag-sheet](https://github.com/microsoft/copilot-brag-sheet) is a \joinSession()\ extension that auto-tracks coding sessions into a structured work log. It registers tools (\save_to_brag_sheet\, \
eview_brag_sheet\, \generate_work_log\) and hooks (\onSessionStart\, \onPostToolUse\, \onSessionEnd\). Currently users must install manually because the plugin system can't distribute it.

**Context:** This was flagged by an awesome-copilot maintainer during skill PR review: https://github.com/github/awesome-copilot/pull/1428

贡献指南

打开贡献指南

调研方向

首先比较 plugin.json schema 以及文档中记录的位于 ~/.copilot/extensions/ 和 .github/extensions/ 下的扩展发现路径。使用导出 joinSession() 的 extension.mjs 重现安装过程,然后跟踪 ~/.copilot/installed-plugins/ 中的文件是否会被考虑;当受支持的分发行为已实现,或限制已得到明确记录时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
shell
领域
cli, tooling
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。