You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stubbed / Simulated Code in OpenClaw Memory System
This document catalogs every piece of production code that is stubbed, simulated,
or uses a placeholder/fallback instead of a real implementation. For each entry:
Real Elastic Weight Consolidation on a neural network
Behavior
When torch is unavailable or no model is attached via set_model(), _learn_simulated() is called. It assigns heuristic "Fisher values" (importance * 10.0) and computes a fake EWC loss from importance scores. No gradient computation, no real parameter regularization.
To Make Real
Install torch, instantiate a real torch.nn.Module, call ewc_engine.set_model(model). The _learn_real() / _compute_fisher_real() / _ewc_loss_real() methods (lines 78-102) contain the genuine Fisher-information implementation — they are not stubs themselves, they are simply unreachable without a model.
2. Chronos — Dynamic LoRA (Virtual Adapters)
File
chronos/dynamic_lora.py
Lines
19-64 (entire class)
What's Stubbed
Real LoRA (Low-Rank Adaptation) weight matrices
Behavior
DynamicLoRA maintains a dictionary mapping adapter_id → importance_score. It tracks allocations and evictions purely by importance thresholds — no actual low-rank matrices are created, no model weights are modified. merge() simply clears the dict.
To Make Real
Integrate with a LoRA training framework (e.g. PEFT / Unsloth / Axolotl). Replace self._adapters dict with actual LoraLayer objects and implement weight manipulation in allocate() / merge().
LLM-powered content analysis and importance scoring
Behavior
Uses keyword matching (regex patterns for Chinese: 重要, 决定, 记住, 喜欢, 不喜欢, 因为, 所以, etc.) and text-length heuristics to estimate importance and extract structured fields. No NLP model or LLM is invoked. _extract_facts() just returns each sentence as a "fact".
To Make Real
Call an LLM (via llm_client.generate()) with a prompt asking for structured extraction of facts, preferences, emotions, causal links, and an importance score.
4. Memora — LoRA Distiller (Training Placeholder)
File
memora/distiller.py
Lines
50-59 (start_training())
What's Stubbed
Actual LoRA fine-tuning
Behavior
start_training() calls prepare_dataset() (which does real JSONL generation from digest files), then logs the training parameters and returns True without performing any training. Line 57: # TODO: 对接 Axolotl / Unsloth.
To Make Real
Integrate with Axolotl, Unsloth, or HuggingFace PEFT to consume the generated JSONL dataset and produce LoRA weights.
5. Memora — MockEmbedder (Hash-based Fallback)
File
memora/embedder.py
Lines
9-25 (MockEmbedder class)
What's Stubbed
Semantic text embedding
Behavior
Produces deterministic pseudo-random vectors seeded by the MD5 hash of input text. Vectors are normalized to unit length. These do not capture semantic meaning — cosine similarity between "king" and "queen" is random.
Active When
The SentenceTransformerEmbedder fails to load (model not cached, sentence_transformers not installed, etc.) and shared_embedder is not set by the Memory Server. When the Memory Server is running and the real model loads, MockEmbedder is NOT used.
To Make Real
Already real when SentenceTransformer("nomic-ai/nomic-embed-text-v1.5") loads successfully. The _create_embedder() chain: shared_embedder → SentenceTransformer → MockEmbedder.
6. MSA — MockEmbedder (Same Pattern)
File
msa/encoder.py
Lines
18-36 (MockEmbedder class)
What's Stubbed
Same as above — semantic embedding for MSA's chunk encoder
Behavior
Identical hash-based mock as Memora's. Used as fallback when the real model is unavailable.
To Make Real
Same as Memora — runs real model when Memory Server provides the shared embedder.
7. Memora — vLLM URL (Unused)RESOLVED
Removed in v0.0.7. The dead vllm_url config field was deleted from config.py and config.yaml. LLM inference uses llm_client.py (xAI Grok API).
8. Memora — ZFS Integration (Disabled)
File
memora/zfs_integration.py
Lines
1-50 (entire file)
What's Stubbed
ZFS snapshot-based backup
Behavior
ZFSIntegration exists with working check_zfs_available() and create_snapshot() methods, but enabled defaults to False and dataset defaults to None. The config field use_zfs_snapshot is false in config.yaml. No code path enables it.
To Make Real
Set enabled = True, assign dataset to an actual ZFS dataset name, and add an integration point (e.g., call zfs.create_snapshot() after digest).
Now uses llm_client.generate() for intelligent query reformulation.
Falls back to string concatenation when LLM is unavailable.
11. Chronos — Personality Profile (LLM-dependent)
File
chronos/consolidator.py
Lines
94-140 (_generate_personality_profile())
What's Stubbed
N/A — this is real code
Behavior
When llm_client is available and has an API key, this generates a real YAML personality profile using xAI Grok. When the LLM is unavailable, it silently skips and returns False.
Note
Not a stub per se, but the feature is conditionally active. Without XAI_API_KEY, this function is effectively disabled.
12. Memory Server — main() Daemon Mode
File
memory_server.py
Lines
286-336
Coverage
0% (untested)
Reason
Contains os.fork() for daemonization and HTTPServer.serve_forever() — both require process-level operations that can't be meaningfully unit-tested. Tested via integration (launchd).