github / github/copilot-cli

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

オープン
#3,916 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
area:agents area:context-memory
主要言語
Shell
スター
11.2k
フォーク
1.9k
平均マージ
14時間 16分
マージ済み PR(30日)
6

説明

## 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.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、既存の /compact コマンドと、状態を変更するツールの登録および権限ゲートの経路を見つけます。呼び出し可能なツールがユーザーコマンドと同じ効果を生成できる仕組みを確認し、関連する CLI テストまたはテストパターンを確認します。エージェントが同じ権限ゲートでコンパクションを呼び出せ、かつ自動コンパクションポリシーを追加していなければ完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
shell
領域
cli, tooling
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
55/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。