Compaction has no visual feedback — /compact and auto-compaction appear to hang
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- cli
Hướng nghiên cứu
Start by tracing the TUI handling for the harness's compaction_start and compaction_done events, then follow the manual /compact entry point and the automatic compaction path. Done means both paths show an in-progress indication, a completion result using the available token data, and a neutral finished or failure message when result data is absent.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Compaction runs with no visual feedback. Every stage of it is already recorded on disk — the compaction_start / compaction_done events fire, the transcript gets a compaction entry, and the session meta.json gets cumulative stats — but the TUI renders nothing while it runs and nothing when it finishes.
Because compaction is a summarization model call over the whole context, it is not instant (this session compacted 446,626 tokens). With no indicator, the session looks hung for the duration, and after it returns there is no way to tell it happened, how much was reclaimed, or that /compact did anything at all.
This affects both paths: manual /compact and automatic compaction near the context limit.
Expected Behavior
- While compacting: some visible indication that work is in progress — a status/spinner line, ideally with the token count being summarized, so the session doesn't read as frozen.
- When finished: a feed line reporting the result, e.g. tokens before → after and tokens saved.
/compactis an explicit user action, so it should always confirm what it did. - On failure/cancel: a visible message rather than a silent no-op.
The data needed for all of this is already produced by the harness (see evidence below) — this looks like a rendering gap rather than a missing-instrumentation problem.
Actual Behavior
- No progress indicator during compaction. The TUI is unchanged while the summarization call is in flight.
- No completion line. Nothing reports tokens saved, before/after counts, or event count.
/compactproduces no visible result, so there is no way to distinguish "compacted successfully" from "ignored my command".
Steps to reproduce the issue
- Start a session and build up a large context (or let it approach the limit).
- Run
/compact(or wait for automatic compaction to trigger). - Observe: nothing renders while compaction runs.
- Observe: nothing renders when it completes — no token counts, no confirmation.
Command Code Version
1.65.2
Operating System
macOS
Terminal/IDE
Ghostty
Shell
zsh
Session file (optional)
Not attached — the affected session contains private data (personal bookmarks and account context) and the template notes it holds the whole session. Happy to provide a redacted extract, or a minimal reproduction session, on request.
Fix prompt (optional)
Compaction currently renders nothing. Surface it in the feed. The harness already emits compaction_start and compaction_done (the latter with tokensSaved, only when > 0), and the session meta.json already carries {count, tokensSaved, lastTokensSaved, lastCompactedAt} — so this is a rendering change, not new instrumentation. On compaction_start, render a status/spinner line indicating history is being summarized. On compaction_done, replace it with a completed line showing tokens saved and the running session total. Make sure the manual /compact path renders the same result so the command visibly confirms what it did. If tokensSaved is 0 or the event doesn't arrive, fall back to a neutral "compaction finished" line rather than leaving the spinner up.
Additional context
Compaction is frequent and does substantial work, all of it invisible. Aggregated across the 10 sessions on this machine that have compacted:
| Metric | Value |
|---|---|
| Sessions with compaction | 10 |
| Total compaction events | 33 |
| Total tokens reclaimed | 16,665,573 |
Largest single session: 9 events, 5,423,527 tokens reclaimed.
Affected session (this one):
// ~/.commandcode/projects/<project>/6672a74d-….meta.json
"compaction": {
"count": 1,
"tokensSaved": 351429,
"lastTokensSaved": 351429,
"lastCompactedAt": "2026-09-25T02:38:11.873Z"
}
That compaction saved 351,429 tokens (446,626 before → ≈95,197 after). The user-visible result of that was nothing.
The transcript records it as a first-class entry:
// <session>.jsonl — entry type "compaction"
{
"type": "compaction",
"id": "002d875a",
"parentId": "8e7d9c82",
"timestamp": "2026-09-25T02:38:11.871Z",
"firstKeptEntryId": "bbf7600d",
"tokensBefore": 446626
}
Entry-type counts in that transcript: message 429, session 1, compaction 1.
The events the harness emits (from the mods API reference):
compaction_start/compaction_done| compaction mod |tokensSaved(done, only when > 0)(
subagent_start/subagent_stopare SubagentStart/Stop;compaction_start/compaction_doneare Pre/PostCompact;noticeis Notification.)
So compaction_start and compaction_done are both available and compaction_done already carries tokensSaved.
Related gap — script hooks cannot see compaction. The documented hook events are PreToolUse, PostToolUse, Stop, and SessionStart. There is no PreCompact/PostCompact for settings.json hooks (the mods API has them, script hooks do not). That means users who want their own compaction indicator or log currently have no hook-level way to do it, which makes the built-in rendering the only route. Worth considering as a follow-up.
Note on the docs: product-help.md cites the project as https://github.com/commandcode/command-code, which 404s (the commandcode org has 0 public repos). The live repo is CommandCodeAI/command-code. Minor, but it is where the in-product /feedback flow points users.
- Ngôn ngữ chính
- Không có dữ liệu ngôn ngữ
- Star
- 4k
- Fork
- 357
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của CommandCodeAI/command-code
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
CommandCodeAI/command-code#933 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
CommandCodeAI/command-code#855 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
CommandCodeAI/command-code#841 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
CommandCodeAI/command-code#655 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
CommandCodeAI/command-code#608 ·
Tất cả issue của CommandCodeAI/command-code
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
objectionary/eolang.sty#167 ·
-
documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
githubnext/gh-aw-workshop#3968 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
triage/confirmed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
agentscope-ai/agentscope#2987 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 90/100
HexRaysSA/ida-hcli#368 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
chore tests
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày