zai-org / zai-org/feedback

[Suggestion / Feature] Ship a Headroom token-compression plugin inside ZCode

Open
#143 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

priority: P2
Dominant language
No language data
Stars
22
Forks
1
PR merge metrics
No merged PRs in 30d

Description

[Suggestion / Feature] Ship a Headroom token-compression plugin inside ZCode

Verified context:
Headroom (https://github.com/headroomlabs-ai/headroom, Apache 2.0, ~59k stars) is an open-source context-compression layer for AI agents. It compresses tool outputs, logs, JSON, RAG chunks, and conversation history before they reach the LLM — 60–95% fewer tokens for JSON/data, 15–20% for coding agents, with equivalent answers.

Headroom already supports ZCode as a first-class integration. Its docs state:

  • headroom wrap zcode → "starts proxy and prints base URLs for ZCode settings"
  • It installs as a plugin (e.g. the OpenClaw path is described as "installs as ContextEngine plugin")
  • Two drop-in paths need near-zero ZCode code changes: proxy mode (headroom proxy --port 8787) and MCP server (headroom_compress / headroom_retrieve / headroom_stats).

Proposal:
Bundle Headroom as an optional built-in compression plugin inside ZCode — users toggle it on/off in settings, ZCode points its agent traffic at the Headroom proxy/MCP, and live token savings show in the ZCode UI (Headroom already ships a stats dashboard).

Why this matters for ZCode / Max Plan:
During GLM-5.2 saturation (the [1305] overload loop), context bloat makes every turn more expensive and more likely to hit limits. A compression plugin would:

  1. Cut per-turn token burn, lowering the chance a session trips Fair Usage / rate limits.
  2. Stretch effective capacity per Max Plan user without adding servers.
  3. Keep answers equivalent (compression is reversible / content-aware).

Why this matters: Cutting effective token cost per turn reduces both user friction and infrastructure load at once. A built-in compression plugin beats silent context growth.

Regards,
Roman

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading Headroom's ZCode integration documentation and comparing the proposed proxy mode with the MCP server path. Identify how ZCode settings, agent traffic, and UI statistics would need to expose an optional plugin; done means users can toggle compression, route traffic through Headroom, and view token savings.

Written by the indexing model from the issue text.

Assessment

Domain
ai-infra-agents
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.