← all repositories
voocel/openclaw-mini

A 430k-line agent monster, shrunk to study size

A readable TypeScript dissection of how a 430,000-line production agent handles memory, context pressure, and proactive wake-ups.

696 stars TypeScript AgentsLearning
openclaw-mini
Not currently ranked — collecting fresh signals.
star history

What it does OpenClaw Mini is a minimal, educational reconstruction of the OpenClaw agent kernel, mapping the full stack into four readable layers meant to teach system-level design rather than ship a compatible clone. It covers the core loop, session persistence, context management, long-term memory, skills, a WebSocket RPC gateway, and production-grade guards.

The interesting bit The project treats context window pressure as a cascading emergency: first prune old tool results, then compress ancient history into summaries, and—crucially—run a “memory flush” round before compression so the model can squirrel away durable facts before they are lost to summarization. It also replaces the naive while tool_calls loop with a double-layer event stream that handles follow-ups, steering, and streaming output without blocking the caller.

Key highlights

  • Double-layer agent loop (outer follow-up + inner tool/steering) pushed through a typed EventStream with 20 event variants
  • Session persistence via JSONL with dual-write caching, deferred disk writes, and crash-resistant line-by-line recovery
  • Three-stage context triage: pruning → compaction with adaptive chunking → bootstrap file loading with head/tail truncation
  • Long-term memory via keyword relevance search, plus a pre-compaction flush that preserves critical details before lossy summarization
  • WebSocket RPC gateway with ACK-then-stream framing, exponential backoff reconnection, heartbeat monitoring, and backpressure
  • Production guards including session-key namespacing, tool-policy tiers (allow/deny/none), and a command queue that serializes per-session while keeping global lanes parallel

Caveats

  • Memory search is simplified to keyword matching without vector semantics or time decay, unlike the full OpenClaw implementation
  • The README explicitly warns this is not API-compatible with OpenClaw and omits many channels, providers, plugins, and production safeguards

Verdict Read this if you are building an agent framework and want to see how session keys, context pruning, and proactive heartbeats fit together. Skip it if you need a drop-in OpenClaw alternative or a finished SaaS backend.

Frequently asked

What is voocel/openclaw-mini?
A readable TypeScript dissection of how a 430,000-line production agent handles memory, context pressure, and proactive wake-ups.
Is openclaw-mini open source?
Yes — voocel/openclaw-mini is open source, released under the MIT license.
What language is openclaw-mini written in?
voocel/openclaw-mini is primarily written in TypeScript.
How popular is openclaw-mini?
voocel/openclaw-mini has 696 stars on GitHub.
Where can I find openclaw-mini?
voocel/openclaw-mini is on GitHub at https://github.com/voocel/openclaw-mini.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.