Skip to content

fix: inactive block decompress + acp_status visibility - #193

Open
ranxianglei wants to merge 5 commits into
masterfrom
2026-07-25_inactive-block-fixes
Open

fix: inactive block decompress + acp_status visibility#193
ranxianglei wants to merge 5 commits into
masterfrom
2026-07-25_inactive-block-fixes

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Summary

Two fixes for inactive (consumed/GC'd/user-decompressed) compression blocks, addressing Gitea #20 feedback:

1. Allow decompress of inactive standalone blocks

resolveBlockTarget in lib/compress/decompress.ts previously rejected any block where activeBlocks.length === 0 with "not active. It may have already been decompressed." — even for standalone inactive blocks that are safe to decompress. The model could see the block's compress call in context but couldn't decompress it.

Fix: Removed the "not active" rejection. Standalone inactive blocks (user-decompressed, GC'd, orphaned) can now be decompressed. The nested-redirect for consumed blocks (inside an active parent) is kept — decompressing a consumed child directly would restore 0 messages since the parent still claims them.

2. Show inactive/consumed blocks in acp_status

scope:"compressed" previously only iterated activeBlockIds, completely hiding consumed/GC'd blocks. The model couldn't discover blocks consumed by secondary compression.

Fix: Now shows all blocks from blocksById with an [inactive] marker on the metadata line (not the topic line, per user feedback). Adds a summary line when inactive blocks are present.

Files

  • lib/compress/decompress.ts — remove "not active" rejection
  • lib/compress/status.ts — show all blocks, add inactive marker
  • tests/acp-status.test.ts — 3 new tests
  • tests/decompress-logic.test.ts — 2 new tests

Verification

  • typecheck: ✅
  • tests: 851 pass (846 existing + 5 new), 0 fail
  • build: ✅

ranxianglei and others added 5 commits July 25, 2026 13:19
Removed the "not active" rejection in resolveBlockTarget. Standalone inactive blocks (user-decompressed, GC'd, orphaned) can now be decompressed. The nested-redirect for consumed blocks (inside an active parent) is kept — decompressing a consumed child directly would restore 0 messages.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Previously scope:compressed only iterated activeBlockIds, hiding consumed/GC'd blocks entirely. Now shows all blocks from blocksById with an [inactive] marker on the metadata line (not the topic). Adds a summary line when inactive blocks are present.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…s refactor)

Dual-agent review (Oracle + General) found that the shared allBlocks variable was passed to both renderCompressedDrilldown (wants all blocks) and renderOverview (wants active only). The overview showed inflated counts and token totals, listed inactive blocks without marker. Now filters to active for the overview path.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Round 2 review findings: (1) toFile on inactive blocks wrote literal placeholder because activeBlocks was empty — now uses targets[0].blocks[0].summary. (2) /acp decompress slash command still had the old 'not active' rejection — applied same fix as the tool.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
7 tests exercising the actual decompress tool (not just helpers): standalone inactive succeeds, consumed redirects, active control, toFile writes summary, fully-inactive chain.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
return
}

await sendIgnoredMessage(

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里为什么要删除

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant