-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Incompatible with OpenClaw 2026.4.5: model call never fires after before_prompt_build hook #1283
Description
Bug Report
Environment
- OpenViking plugin: 2026.3.25 (installed via ClawHub)
- OpenClaw: 2026.4.5
- Platform: Linux x86_64, Kali
Symptom
After upgrading OpenClaw from 4.2 → 4.5, the OpenViking context-engine plugin causes the agent pipeline to silently stop. Messages are received, OpenViking auto-recall runs and injects memories, but the model call never happens. The typing indicator times out after 2 minutes with no response.
Slash commands (INTERACTION_CREATE) still work because they bypass the context-engine pipeline.
Works on: OpenClaw 2026.4.2, 2026.4.3
Broken on: OpenClaw 2026.4.5
Root Cause Analysis
OpenViking registers both a before_prompt_build hook (for auto-recall memory injection) and a context-engine (via api.registerContextEngine()).
In OpenClaw 4.5, the execution order changed:
contextEngine.assemble()runs first — assembles and locks the message arraybefore_prompt_buildhook runs second — returns{ prependContext: "..." }
The hook's prependContext return conflicts with the already-assembled message array. The runtime detects this inconsistency and silently aborts — the model API call is never made.
Relevant OpenClaw 4.5 Changes
From the changelog:
assemble()now receives a newpromptfield (PR #50848) — legacy engines get a retry without it, but the retry path may conflict with the hookbefore_prompt_buildhook result merging logic changed (PR #58375) — higher-priority systemPrompt preservation may affect how prependContext is applied
OpenViking Server Status
OpenViking server itself works fine (HTTP 200, rerank completes, memories returned). The issue is purely in the plugin-side hook/context-engine interaction with OpenClaw 4.5's runtime.
Suggested Fix
When OpenViking is registered as a context-engine in OpenClaw 4.5+:
- Move auto-recall memory injection logic from the
before_prompt_buildhook intoassemble() - Skip the
before_prompt_buildhook when context-engine mode is active - This avoids the dual hook + context-engine conflict
Workaround
Setting contextEngine: "legacy" and disabling OpenViking (enabled: false) restores normal operation. Agents respond normally without OpenViking's semantic recall.
Logs
[plugins] openviking: auto-recall failed: Error: openviking: auto-recall search timeout
[plugins] openviking: injecting 3 memories (~54 tokens, budget=1000)
[gateway] openviking: session message POST ...
// No [agent] embedded run or model call logs after this
// 2 minutes later:
typing TTL reached (2m); stopping typing indicator
Metadata
Metadata
Assignees
Labels
Type
Projects
Status