Tags: aiming-lab/MetaClaw
Tags
Release v0.4.1: incremental memory ingestion
Memory layer now supports buffered per-turn ingestion so extraction runs
every N turns (default 5) instead of only at session end, shrinking the
mid-session memory blackout window and removing the O(N^2) cost of
re-sending full history on every turn.
Core changes:
metaclaw/memory/manager.py
- Factor ingest_session_turns into _extract_turns_to_units,
_build_working_summary_unit, and _persist_units.
- Add buffer_turn (auto-flushes at flush_every) and flush_session
(emits working_summary and clears per-session state only when
final=True). Per-session state is kept in dicts keyed by
session_id so the multi-turn context survives across flush
boundaries and absolute turn indices are preserved.
- Thread flush_every through __init__ and from_config*.
metaclaw/config.py
- Add memory_flush_every (default 5).
openclaw-metaclaw-memory/sidecar
- config.py: add flush_every and forward it as memory_flush_every.
- server.py: add POST /buffer_turn and POST /flush_session endpoints
with matching request/response models.
openclaw-metaclaw-memory/src
- types.ts: add BufferTurnResponse, FlushSessionResponse.
- client.ts: add bufferTurn and flushSession methods.
- hooks/auto-capture.ts: track per-session turn count in a
module-level Map so agent_end (which fires per turn with a full
history snapshot) only forwards the new delta via bufferTurn.
Hook session_end to call flushSession with final=true and drop
the tracker.
metaclaw/api_server.py, proxy
- Route /v1/memory/buffer_turn and /v1/memory/flush_session through
the proxy so benchmark and plugin clients can reach the new
endpoints.
Benchmark:
- Add --buffer-turns flag and buffer_memory_run.py runner.
- Add METACLAW_BENCH_INPUT env override to all runner scripts.
- Save experiment results and add comparison report command.
- Drop the legacy report-ratio command.
Docs:
- News entries for v0.4.1 in README.md and all language variants.
- Bump version to 0.4.1 in pyproject.toml.
feat: add Hermes Agent support, fix memory plugin rawMessage, configu… …rable context window Hermes Agent (claw_type: hermes) - Add _configure_hermes() adapter: injects a metaclaw entry into ~/.hermes/config.yaml custom_providers, sets model.provider to custom:metaclaw, and runs `hermes gateway restart`. Respects HERMES_HOME. - Propagates context_window to Hermes per-model context_length entry. - Register hermes in _ADAPTERS / CLAW_TYPES; update README and config.py. Fix: OpenClaw memory plugins rawMessage undefined (Hindsight, mem0, etc.) - Root cause: openclaw-completions API path does not populate event.rawMessage in before_prompt_build hooks; anthropic-messages does. - Switch _configure_openclaw from api:openai-completions to api:anthropic-messages pointing at MetaClaw's existing /v1/messages endpoint (baseUrl without /v1 — OpenClaw appends /v1/messages itself). - Extend _anthropic_to_openai_body to fully convert Anthropic tool_use / tool_result content blocks and tool definitions (input_schema) to OpenAI format so OpenClaw tool calls (bash, file ops) continue to work. - Extend _openai_to_anthropic_response to emit tool_use content blocks and set stop_reason:tool_use when tool calls are present. - Extend _stream_anthropic_response to emit content_block_start/delta/stop SSE events for tool_use blocks alongside text blocks. Configurable context window (fixes hardcoded 20k/32k caps) - Add context_window: int = 0 to MetaClawConfig. 0 = auto: 200000 in skills_only mode (no RL seq-len constraint), 32768 in rl/madmax mode. Set explicitly to match the upstream model's actual context window. - max_context_tokens = 0 now disables prompt truncation entirely (existing `if max_prompt > 0` guard already handles this correctly). Recommended for skills_only mode with large-context cloud models. - Both _configure_openclaw and _configure_hermes resolve contextWindow / context_length from cfg.context_window using the same auto logic. - Bump version to 0.3.2. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>