v5.22.0
OpenClaw in-process plugin integration. OpenClaw is supported via an in-process plugin package (@dat999zx/knowl/plugin and integrations/openclaw) rather than shell hooks. Running inside the OpenClaw gateway evaluates the write gate at before_tool_call in sub-millisecond time (~0.68ms vs ~118ms subprocess) with an explicit matcher filtering write tools (exec, apply_patch, spawn_agent). The write gate carries an internal 5-second deadline and swallows engine errors to uphold OpenClaw's fail-closed host contract without blocking user writes on memory degradation.
Prompt recall is delivered at before_prompt_build returning { prependContext: card } with the fixed orientation card, ensuring prompt prose never becomes a search query. Impact cards are injected before model replay via api.registerAgentToolResultMiddleware directly into result.content (avoiding details which OpenClaw strips before compaction). That middleware matches every tool; only the impact-card lookup is gated on the write tools that can produce one.
Mid-turn cards reach plugin hosts. Hermes and OpenClaw both returned undefined from midTurnContext, and host-lifecycle.ts gates the entire mid-turn slot on that value — so change cards, destructive-command lessons, fleet cards, skill nudges, turn-capture prompts and the drift reminder were all silently dropped on two hosts. Both now park the engine's card in their observer hook (post_tool_call / after_tool_call) and deliver it from the hook that rewrites the tool result. The card arrives one tool call late, which is affordable only because every card in that slot is advisory; the write gate keeps its synchronous fail-closed path. The result middleware now matches every tool rather than only the writers: the drift reminder counts consecutive non-Knowl calls of any kind, so a write-only matcher dropped it during exactly the read-and-shell runs it exists to interrupt. midTurnDeliveryVerified is now true for Hermes: driving the real plugin hooks against the real engine in a real project, the drift reminder arrived on tool call 11 of 14 — the tick DEFAULT_DRIFT_REMINDER_EVERY = 12 predicts. It stays false for OpenClaw, whose delivery has not been observed.
Namespace reads now reach the store that writes reach. The global store is addressed by its known path, but every namespace list was built from project config — and knowl init writes no memory.global block. So in every repository Knowl creates, an atom written with namespace: 'global' was unreadable by the surface that wrote it: knowl query and knowl_query keyword search both missed it, and every id-addressed operation failed on an id search had just printed — knowl supersede and knowl reviewed with "Knowledge item not found", knowl_query --id reporting it did not exist, knowl_timeline answering []. Reported as "Knowl is bad at superseding". withItemNamespace now resolves an id in whichever namespace holds it and runs the caller's entire operation there, write included; both keyword search paths union the global store's known path.
knowl init openclaw merges the plugin entry into openclaw.json (project-scoped or ~/.openclaw/openclaw.json), writing both required permission gates (allowConversationAccess and allowPromptInjection) and explicitly setting timeouts.before_tool_call: 5000 while preserving all surrounding user configuration. It also copies the plugin into ~/.openclaw/knowl-plugin, the way knowl init hermes has always copied its own — previously the command wrote config enabling a plugin OpenClaw had never been told about, reported success, and left a dead install that verify() agreed was configured because it only read the config file. The printed instructions name the two remaining steps and why each is mandatory: the dependency install needs --install-links, because OpenClaw's safety scan refuses a plugin whose node_modules symlink outside the install root and a plain npm install <path> produces exactly that; the registration needs --force (the directory is outside ClawHub trust metadata) and --accept-capabilities (the plugin declares tool-result middleware).