github / github/copilot-cli

list_agents returns empty while background agents are still visibly running in UI

Ouverte
#3,514 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
area:agents area:context-memory area:tools
Langage dominant
Shell
Étoiles
11.2k
Forks
1.9k
Merge moyen
14 h 16 min
PR mergées (30 j)
6

Description

## Bug: `list_agents` shows no agents while tasks are still active in UI

### Description
When multiple background agents are launched during a session, calling `list_agents` returns `` even though the user can see 7 active agents in the Copilot CLI tasks UI. The assistant incorrectly concludes "no agents running" and calls `task_complete`, while agents are still executing in the background.

### Steps to Reproduce
1. Start a Copilot CLI session
2. During a complex review task, background agents are launched (e.g., `explore` agents for parallel codebase investigation)
3. After the main analysis completes, call `list_agents`
4. `list_agents` returns ``
5. Meanwhile, the user sees 7 active tasks in the UI task list

### Expected Behavior
`list_agents` should return all currently running background agents, matching what the user sees in the UI.

### Actual Behavior
`list_agents` returns empty (``) while the UI shows 7 active agents still running. The assistant has no way to detect or stop these orphaned agents.

### Impact
- Assistant cannot detect running agents → cannot stop them
- Assistant incorrectly reports "no agents running" to the user
- Orphaned agents consume resources silently
- User has to manually identify and stop stale agents
- Breaks the HITL trust model — assistant says one thing, UI shows another

### Environment
- Copilot CLI version: 1.0.54
- Model: Claude Opus 4.6
- OS: macOS (Darwin)

### Additional Context
The agents were likely launched in a previous checkpoint/compaction cycle. After context compaction, the agent IDs may have been lost from the conversation context, making them invisible to `list_agents` but still running in the runtime.

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Start by reproducing the issue in a Copilot CLI session with multiple background agents, then compare list_agents with the visible UI task list after the main analysis completes. Done means list_agents reports all currently running agents and provides enough information to stop them, including agents launched before context compaction.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
shell
Domaine
cli
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
Calme
Clarté
Plutôt claire
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.