Feature: allow /compact to be invoked by the agent (programmatic compaction)
- Lingua principale
- Shell
- Stelle
- 11.2k
- Fork
- 1.9k
- Merge medio
- 14h 16m
- PR unite (30g)
- 6
Descrizione
## 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.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia individuando il comando /compact esistente e i percorsi di registrazione e controllo delle autorizzazioni per gli strumenti che modificano lo stato. Verifica come lo strumento invocabile possa produrre lo stesso effetto del comando dell’utente, quindi controlla i test CLI pertinenti o i relativi pattern di test. Il lavoro è completato quando l’agente può invocare la compattazione con lo stesso controllo delle autorizzazioni, senza aggiungere una policy di compattazione automatica.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- shell
- Ambito
- cli, tooling
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 55/100