github / github/copilot-cli

Feature: allow /compact to be invoked by the agent (programmatic compaction)

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

Description

## Summary
`/compact` is currently a user-only slash command. The agent itself should be able to invoke compaction when it detects it's running short on context or when a long task naturally hits a phase boundary.

## Use cases
- Multi-phase workflows (e.g. plan → implement → review pipelines) where the agent knows when a phase is complete and the prior context can be safely summarized.
- Long-running autonomous sessions where the user isn't present to trigger `/compact` manually.
- Skill / plugin authors who want to script a compaction step at a known-safe boundary.

## Proposal
Expose `/compact` as a callable tool (e.g. `compact_context`) so the agent can invoke it programmatically, with the same effect as the user typing the slash command. Permission-gate it the same way other state-changing tools are gated.

## Out of scope
Auto-compaction policy (when to fire, what to summarize) is separate; this issue is only about exposing the existing capability to the agent.

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par localiser la commande /compact existante ainsi que les chemins d’enregistrement et de contrôle des permissions pour les outils qui modifient l’état. Vérifiez comment l’outil appelable peut produire le même effet que la commande utilisateur, puis examinez les tests CLI pertinents ou les modèles de test. Le travail est considéré comme terminé lorsque l’agent peut invoquer la compaction avec le même contrôle des permissions, sans ajouter de politique de compaction automatique.

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

Évaluation

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

Recevez les nouvelles issues par e-mail

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