github / github/copilot-cli

Plugin skills installed by sessionStart hooks are not available in the current session

Abierto
#1,855 0 comentarios 0 reacciones 0 asignados Ver en GitHub
area:installation area:plugins area:sessions
Lenguaje dominante
Shell
Estrellas
11.2k
Forks
1.9k
Merge medio
14 h 16 min
PR fusionados (30 d)
6

Descripción

# Plugin skills installed by sessionStart hooks are not available in the current session

---

## Description

When a sessionStart hook installs plugins via copilot plugin install, the installed plugin skills are never made available to the current session. /skills reload does not pick them up either.

## Steps to Reproduce

1. Create .github/hooks/hooks.json with a sessionStart hook that installs plugins:
```json
{
"version": 1,
"hooks": {
"sessionStart": [{
"type": "command",
"bash": "copilot plugin marketplace add owner/repo; copilot plugin install my-plugin@my-marketplace",
"cwd": ".",
"timeoutSec": 120
}]
}
}
```
2. Start a new copilot session and send a message
3. Hook logs confirm success: Plugin "my-plugin" installed successfully. Installed 4 skills.
4. Run /skills reload
5. Observe: plugin_skill_count: 0 — no plugin skills are loaded

## Root Cause

- Skills are loaded **eagerly at process startup** (e.g. skills_loaded at 18:36:32)
- sessionStart hooks fire **lazily on the first user message** (e.g. 18:37:24)
- The hook successfully installs plugins and updates config.json (with nabled: true)
- Plugin skill files exist on disk at ~/.copilot/installed-plugins/ with valid SKILL.md files
- But the running CLI process never re-reads the plugin configuration
- /skills reload re-scans project/personal skills but does **not** re-read installed_plugins from config.json

## Expected Behavior

After sessionStart hooks complete, newly installed plugin skills should be available in the current session. At minimum, /skills reload should re-read installed_plugins from config.json.

## Suggested Fix

Either:
1. **Automatically re-scan plugins/skills after sessionStart hooks complete** — hooks exist precisely for session setup like installing plugins
2. **Have /skills reload also re-read installed_plugins from config.json** and load newly added plugin skills
3. **Defer skills loading until after sessionStart hooks have completed** (may impact perceived startup latency)

## Workaround

Start a second session after the first one. Since the plugins are now in config.json, they will be discovered at process startup in subsequent sessions.

## Environment

- Copilot CLI: 0.0.422-1
- OS: Windows 11
- Node.js: v24.11.1

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.