Skip to content

feat: add model-exposed decompress tool for context restoration#8

Open
ranxianglei wants to merge 1 commit into
masterfrom
2026-06-07_model-decompress-tool
Open

feat: add model-exposed decompress tool for context restoration#8
ranxianglei wants to merge 1 commit into
masterfrom
2026-06-07_model-decompress-tool

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Summary

  • Adds a decompress tool exposed to AI models, allowing them to restore previously compressed conversation blocks on demand
  • Extracts shared decompression logic into lib/compress/decompress-logic.ts (8 shared functions), reused by both the model tool and the existing /acp decompress command
  • Includes 36 new tests covering block resolution, state restoration, nested decompression, and error cases
  • Updates system prompt, config defaults, and prompt store to support the new tool alongside compress

Changes

New files:

  • lib/compress/decompress-logic.ts — 8 shared functions for decompression
  • lib/compress/decompress.tscreateDecompressTool() model-exposed tool
  • tests/decompress-logic.test.ts — 36 tests
  • devlog/2026-06-07_model-decompress-tool/ — REQ.md, DESIGN.md, WORKLOG.md

Modified files:

  • index.ts — register decompress tool, add to primary_tools
  • lib/commands/decompress.ts — refactored to use shared logic
  • lib/compress/index.ts — export createDecompressTool
  • lib/config.ts — "decompress" in default protected tools
  • lib/prompts/ — decompress extension in system prompt, store, and base prompt

Closes #7

Adds a decompress tool that lets AI models restore previously compressed conversation blocks, complementing the existing compress tool. Includes shared logic extraction from decompress command, 36 new tests, and devlog documentation.

Closes #7

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
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.

feat: expose decompress tool to AI model

1 participant