bambu-studio-ai
Bambu Lab 3D printer control and automation. Activate when user mentions: printer status, 3D printing, slice, analyze model, generate 3D, AMS filament, print monitor, Bambu Lab, or any 3D printing task. Full pi...
Token-based context compaction for local models (MLX, llama.cpp, Ollama) that don't report context limits.
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
SkillHub CLI
skillhub install emberdesire/context-compactor打开来源仓库,查看说明和兼容环境后,按来源提供的命令或步骤安装。
将来源链接提供给你的 Agent,让它先读取说明、核对依赖,并向你说明将执行的安装步骤。
Automatic context compaction for OpenClaw when using local models that don't properly report token limits or context overflow errors.
Cloud APIs (Anthropic, OpenAI) report context overflow errors, allowing OpenClaw's built-in compaction to trigger. Local models (MLX, llama.cpp, Ollama) often:
This leaves you with broken conversations when context gets too long.
Context Compactor estimates tokens client-side and proactively summarizes older messages before hitting the model's limit.
┌─────────────────────────────────────────────────────────────┐
│ 1. Message arrives │
│ 2. before_agent_start hook fires │
│ 3. Plugin estimates total context tokens │
│ 4. If over maxTokens: │
│ a. Split into "old" and "recent" messages │
│ b. Summarize old messages (LLM or fallback) │
│ c. Inject summary as compacted context │
│ 5. Agent sees: summary + recent + new message │
└─────────────────────────────────────────────────────────────┘
# One command setup (recommended)
npx jasper-context-compactor setup
# Restart gateway
openclaw gateway restart
The setup command automatically:
~/.openclaw/extensions/context-compactor/
openclaw.json with sensible defaultsAdd to openclaw.json:
{
"plugins": {
"entries": {
"context-compactor": {
"enabled": true,
"config": {
"maxTokens": 8000,
"keepRecentTokens": 2000,
"summaryMaxTokens": 1000,
"charsPerToken": 4
}
}
}
}
}
| Option | Default | Description | |---...
这些信息来自收录时的来源分析,可能滞后;使用前请核对最新来源文件。
Token-based context compaction for OpenClaw with local models (MLX, llama.cpp, Ollama)
Local LLMs don't report context overflow errors like cloud APIs do. When context gets too long, they either:
OpenClaw's built-in compaction relies on error signals that local models don't provide.
Jasper Context Compactor estimates tokens client-side and proactively summarizes older messages before hitting your model's limit. No more broken conversations.
npx jasper-context-compactor setup
The setup will:
openclaw.json to ~/.openclaw/backups/ with restore instructionsThe setup automatically detects these providers (primary or fallback):
ollama in name or :11434 in baseUrlThen restart OpenClaw:
openclaw gateway restart
🔒 Everything runs 100% locally. Nothing is sent to external servers.
The setup only reads your local openclaw.json file (with your permission) to detect your model and suggest appropriate limits.
# Context Compactor
Automatic context compaction for OpenClaw when using local models that don't properly report token limits or context overflow errors.
## The Problem
Cloud APIs (Anthropic, OpenAI) report context overflow errors, allowing OpenClaw's built-in compaction to trigger. Local models (MLX, llama.cpp, Ollama) often:
- Silently truncate context
- Return garbage when context is exceeded
- Don't report accurate token counts
This leaves you with broken conversations when context gets too long.
## The Solution
Context Compactor estimates tokens client-side and proactively summarizes older messages before hitting the model's limit.
## How It Works
```
┌─────────────────────────────────────────────────────────────┐
│ 1. Message arrives │
│ 2. before_agent_start hook fires │
│ 3. Plugin estimates total context tokens │
│ 4. If over maxTokens: │
│ a. Split into "old" and "recent" messages │
│ b. Summarize old messages (LLM or fallback) │
│ c. Inject summary as compacted context │
│ 5. Agent sees: summary + recent + new message │
└─────────────────────────────────────────────────────────────┘
```
## Installation
```bash
# One command setup (recommended)
npx jasper-context-compactor setup
# Restart gateway
openclaw gateway restart
```
The setup command automatically:
- Copies plugin files to `~/.openclaw/extensions/context-compactor/`
- Adds plugin config to `openclaw.json` with sensible defaults
## Configuration
Add to `openclaw.json`:
```json
{
"plugins": {
"entries": {
"context-compactor": {
"enabled": true,
"config": {
"maxTokens": 8000,
"keepRecentTokens": 2000,
"summaryMaxTokens": 1000,
"charsPerToken": 4
}
}
}
}
}
```
### Options
| Option | Default | Description |
|---...# Jasper Context Compactor > Token-based context compaction for OpenClaw with local models (MLX, llama.cpp, Ollama) ## The Problem Local LLMs don't report context overflow errors like cloud APIs do. When context gets too long, they either: - Silently truncate your conversation - Return garbage output - Crash without explanation OpenClaw's built-in compaction relies on error signals that local models don't provide. ## The Solution Jasper Context Compactor estimates tokens client-side and proactively summarizes older messages before hitting your model's limit. No more broken conversations. ## Quick Start ```bash npx jasper-context-compactor setup ``` **The setup will:** 1. ✅ **Back up your config** — Saves `openclaw.json` to `~/.openclaw/backups/` with restore instructions 2. ✅ **Ask permission** — Won't read your config without consent 3. ✅ **Detect local models** — Automatically identifies Ollama, llama.cpp, MLX, LM Studio providers 4. ✅ **Suggest token limits** — Based on your model's contextWindow from config 5. ✅ **Let you customize** — Enter your own values if auto-detection doesn't match 6. ✅ **Update config safely** — Adds the plugin with your chosen settings ### Supported Local Providers The setup automatically detects these providers (primary or fallback): - **Ollama** — Any provider with `ollama` in name or `:11434` in baseUrl - **llama.cpp** — llamacpp provider - **MLX** — mlx provider - **LM Studio** — lmstudio provider - **friend-gpu** — Custom GPU servers - **OpenRouter** — When routing to local models - **Local network** — Any provider with localhost, 127.0.0.1, or Tailscale IP in baseUrl Then restart OpenClaw: ```bash openclaw gateway restart ``` ## Privacy 🔒 **Everything runs 100% locally.** Nothing is sent to external servers. The setup only reads your local `openclaw.json` file (with your permission) to detect your model and suggest appropriate limits. ## How It Works 1. Before each message, estimates total context tokens...
Bambu Lab 3D printer control and automation. Activate when user mentions: printer status, 3D printing, slice, analyze model, generate 3D, AMS filament, print monitor, Bambu Lab, or any 3D printing task. Full pi...
Search and hire real humans for tasks — photography, delivery, research, and more
Generative Engine Optimization (GEO) for AI search visibility. Optimize content to appear in ChatGPT, Perplexity, Claude, and Google AI Overviews. Use when optimizing websites, pages, or content for LLM discove...
Reusable skill templates for OpenClaw AI agents. Templates for API integration, data processing, web scraping, CLI tools, and file processing.