Feature: allow /compact to be invoked by the agent (programmatic compaction)
- Vorherrschende Sprache
- Shell
- Sterne
- 11.2k
- Forks
- 1.9k
- Ø Merge
- 14 Std. 16 Min.
- Gemergte PRs (30 T.)
- 6
Beschreibung
## 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.
Beitragsleitfaden
Rechercherichtung
Beginne damit, den bestehenden Befehl /compact sowie die Registrierungs- und Berechtigungspfad für zustandsändernde Tools zu finden. Überprüfe, wie das aufrufbare Tool denselben Effekt wie der Benutzerbefehl erzeugen kann, und prüfe anschließend die relevanten CLI-Tests oder Testmuster. Als erledigt gilt die Aufgabe, wenn der Agent die Komprimierung mit derselben Berechtigungsprüfung auslösen kann, ohne eine automatische Komprimierungsrichtlinie hinzuzufügen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- shell
- Bereich
- cli, tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 55/100