feat(session): add compact action to session control tool
- 主要言語
- Rust
- スター
- 2.3k
- フォーク
- 231
- 平均マージ
- 2時間 46分
- マージ済み PR(30日)
- 577
説明
## Summary
Add the `compact` action to the session control tool family so a caller can compact a session context to reduce its token footprint and surface the applied compaction statistics (tokens/ratio/summary).
## Plan
- Thread `ContextCompactionOutcome` through the manual compaction task so the finished outcome is returned instead of being discarded.
- Add `compact_session_with_outcome` returning `BitFunResult`; `compact_session_manually` delegates to it for the Desktop compatibility API.
- Extend `SessionControlAction` with a `Compact` variant and its `as_str` mapping.
- Allow compacting the caller's own session (the sole self-mutation exception) while keeping owner/creator/ancestor authorization inline.
- Wire the `Compact` dispatch to the compact engine and return the applied stats.
- Extend the tool input schema/description and add compact validation tests.
AI-assisted output. Test extent: **已测 (tested)**.
コントリビューションガイド
調査の方向性
Locate the manual compaction task and ContextCompactionOutcome flow first, then trace SessionControlAction, its string mapping, authorization checks, dispatch, and the tool input schema. Extend the compact path so the applied tokens, ratio, and summary are returned, and run the compact validation tests to confirm self-compaction and owner/creator/ancestor authorization behavior.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- rust
- 領域
- backend-api-design, tooling
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 活発
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 68/100