Feature: allow /compact to be invoked by the agent (programmatic compaction)
- Ngôn ngữ chính
- Shell
- Star
- 11.2k
- Fork
- 1.9k
- Merge trung bình
- 14 giờ 16 phút
- Pull request đã merge (30 ngày)
- 6
Mô tả
## 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.
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách xác định lệnh /compact hiện có cùng các đường dẫn đăng ký và kiểm soát quyền đối với những công cụ thay đổi trạng thái. Xác minh cách công cụ có thể gọi được tạo ra cùng hiệu ứng như lệnh của người dùng, sau đó kiểm tra các bài kiểm thử CLI liên quan hoặc các mẫu kiểm thử. Hoàn tất nghĩa là agent có thể gọi compact với cùng cổng kiểm soát quyền, mà không thêm chính sách compact tự động.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- shell
- Lĩnh vực
- cli, tooling
- Loại issue
- Tính năng
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 55/100