crates/hx-core/src/compact.rs cuts every transcript item to 800 chars before summarizing, caps the summary at 4096 tokens, and keeps only KEEP_MESSAGES = 6 verbatim. The summary request has its own system prompt, so it is an uncached read of the history once per compaction. Truncating each item blindly can drop the file path or the error line at the end of a long tool result.
Change (do this only if sessions show the agent forgetting facts after compaction)
When shortening an item, keep the first ~400 chars plus the last ~400 chars, or lines matching file paths / error / FAILED, instead of the first 800 only.
Verify
Test in compact.rs: an item with an error line at its end must still contain that line in transcript. Check on a real long session that the summary names the files touched.
Do not change this without evidence of lost facts.
## Problem (low confidence, conditional)
`crates/hx-core/src/compact.rs` cuts every transcript item to 800 chars before summarizing, caps the summary at 4096 tokens, and keeps only `KEEP_MESSAGES = 6` verbatim. The summary request has its own system prompt, so it is an uncached read of the history once per compaction. Truncating each item blindly can drop the file path or the error line at the end of a long tool result.
## Change (do this only if sessions show the agent forgetting facts after compaction)
When shortening an item, keep the first ~400 chars plus the last ~400 chars, or lines matching file paths / `error` / `FAILED`, instead of the first 800 only.
## Verify
Test in `compact.rs`: an item with an error line at its end must still contain that line in `transcript`. Check on a real long session that the summary names the files touched.
Do not change this without evidence of lost facts.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem (low confidence, conditional)
crates/hx-core/src/compact.rscuts every transcript item to 800 chars before summarizing, caps the summary at 4096 tokens, and keeps onlyKEEP_MESSAGES = 6verbatim. The summary request has its own system prompt, so it is an uncached read of the history once per compaction. Truncating each item blindly can drop the file path or the error line at the end of a long tool result.Change (do this only if sessions show the agent forgetting facts after compaction)
When shortening an item, keep the first ~400 chars plus the last ~400 chars, or lines matching file paths /
error/FAILED, instead of the first 800 only.Verify
Test in
compact.rs: an item with an error line at its end must still contain that line intranscript. Check on a real long session that the summary names the files touched.Do not change this without evidence of lost facts.