Feature: allow /compact to be invoked by the agent (programmatic compaction)
- Linguagem predominante
- Shell
- Estrelas
- 11.2k
- Forks
- 1.9k
- Merge médio
- 14h 16min
- PRs com merge (30d)
- 6
Descrição
## 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.
Guia de contribuição
Direção de pesquisa
Comece localizando o comando /compact existente e os caminhos de registro e controle de permissões para ferramentas que alteram o estado. Verifique como a ferramenta invocável pode produzir o mesmo efeito que o comando do usuário e, em seguida, confira os testes relevantes de CLI ou os padrões de teste. O trabalho estará concluído quando o agente puder invocar a compactação com o mesmo controle de permissões, sem adicionar uma política de compactação automática.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- shell
- Domínio
- cli, tooling
- Tipo de issue
- Funcionalidade
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Status de atividade
- Pouca atividade
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 55/100