Repository navigation
Description
AM embedded run aborts memory_search tool calls; classifies as timeout despite model completion
Version
OpenClaw 2026.4.26 (commit be8c246), running on .npm-global/lib/node_modules/openclaw/openclaw.mjs per governance/UPGRADE-SOP-NATIVE.md.
Plugin
active-memory (stock plugin, dist/extensions/active-memory/index.js).
Summary
Active Memory's embedded recall sub-agent has four correlated findings that together break AM functionality on a healthy gateway:
- AM produced
status=timeoutwithsummaryChars=0across 5 sequential trigger runs spanning 2 different models and 2 different timeout budgets. Pass 5 enabledpersistTranscripts: true; the persisted transcript shows everymemory_searchcall from inside the embedded run returned"Aborted"(isError: true). Passes 1-4 produce the same status-line pattern but did not capture transcripts. - The same
memory_searchcall from a non-embedded session works correctly (1.656s, returns hits/empty cleanly, no abort) — isolating the bug to embedded-runner / AM tool bridge / abort propagation, not memory-core globally. - The embedded runner classifies the run as
status=timeouteven when the assistant returns a normalNONEresponse in ~18s, well under the configured 60s budget. - Prior-run
prompt-errorevents leak into the next run's context as injectedcustom:openclaw:prompt-errorevents.
Reproduction
Trent (the AM-eligible agent on this deployment) is on openai-codex/gpt-5.5 session. AM config tested across 5 runs:
| Pass | model | modelFallback | timeoutMs | persistTranscripts | activeModel observed | elapsedMs | status | summaryChars | memory_search results |
|---|---|---|---|---|---|---|---|---|---|
| 1 | (unset) | (unset) | 15000 | false | openai-codex/gpt-5.5 | 41991 | timeout | 0 | not visible |
| 2 | (unset) | ollama-cloud/minimax-m2.5 | 15000 | false | openai-codex/gpt-5.5 | 46790 | timeout | 0 | not visible |
| 3 | ollama-cloud/minimax-m2.5 | ollama-cloud/minimax-m2.5 | 15000 | false | ollama-cloud/minimax-m2.5 | 45676 | timeout | 0 | not visible |
| 4 | ollama-cloud/minimax-m2.5 | ollama-cloud/minimax-m2.5 | 60000 | false | ollama-cloud/minimax-m2.5 | 97994 | timeout | 0 | not visible |
| 5 | ollama-cloud/minimax-m2.5 | ollama-cloud/minimax-m2.5 | 60000 | true | ollama-cloud/minimax-m2.5 | 94199 (plugin status); assistant returned NONE in ~18s (transcript) | timeout | 0 | all "Aborted" |
Pass 5's persisted transcript at ~/.openclaw/plugins/active-memory/transcripts/agents/trent/active-memory/active-memory-mokgeyo1-780d30df.jsonl shows:
19:36:18.009Z session start
19:36:18.851Z model_change → ollama-cloud/minimax-m2.5
19:36:19.091Z prompt-error injected: "active-memory timeout after 60000ms | active-memory timeout after 60000ms"
(bug 4 — stale prompt-error from prior pass leaks into this run)
19:36:19.107Z user message (system prompt + recent context + trigger)
19:36:28.246Z assistant: 9s reasoning, calls memory_search({query: "...", maxResults: 3})
19:36:28.250Z toolResult: {content: [{type:"text",text:"Aborted"}], isError: true}
19:36:29.939Z assistant retries with simpler query → toolResult: "Aborted"
19:36:31.670Z assistant retries again → toolResult: "Aborted"
19:36:36.262Z assistant: returns "NONE" (correct fallback per system prompt instructions)
19:36:36.519Z embedded run: failover decision, reason=timeout, decision=surface_error
(bug 3 — model returned NONE in 18s; classified timeout anyway)
Disambiguation test
From a non-embedded session on the same host/runtime: memory_search invoked directly completed in 1656ms, returned 0 hits, no abort. The same memory tool path is reachable outside the AM embedded run; only the AM embedded path aborts.
Conclusion
The bug is in the embedded runner's tool dispatch / abort propagation path, NOT in memory-core or the recall model. Specifically:
- Whatever signals "abort" to the tool result is firing for every memory_search call within the embedded sub-agent
- The model eventually handles it gracefully by returning NONE (note: it violates the prompt's one-tool-stop instruction by retrying 3x first, but it converges to a valid answer)
- But the embedded runner declares the run a timeout even when the model returned cleanly within budget
System config (relevant excerpts)
{
"plugins.entries.active-memory": {
"enabled": true,
"config": {
"enabled": true,
"agents": ["trent"],
"allowedChatTypes": ["direct"],
"queryMode": "recent",
"promptStyle": "balanced",
"timeoutMs": 60000,
"maxSummaryChars": 220,
"persistTranscripts": true,
"logging": true,
"model": "ollama-cloud/minimax-m2.5",
"modelFallback": "ollama-cloud/minimax-m2.5"
}
}
}tools.allow = [], tools.alsoAllow = []. Provider ollama-cloud configured with minimax-m2.5 allowlisted. Direct memory tool path on this host is responsive (per disambiguation test above) — failure scope is the AM embedded run.
Source pointers
dist/extensions/active-memory/index.js— aroundgetModelRefcandidates list (function definition at line 858, candidates array at lines 865-870 in this build) — chain-resolution model selection. (Related but separate doc/UX bug — see related filing.)dist/extensions/active-memory/index.js— around therunEmbeddedPiAgentinvocation (in this build, transcript path wiring runs roughly lines 893-955).- The
AbortedtoolResult appears to be coming from the embedded runner's abort controller. We did not narrow further — likely needs source-side investigation around the AM tool bridge / sub-agent setup path.
Suggested remediation areas (not authoritative — investigation needed)
- Investigate why memory_search tool dispatch aborts inside embedded runs. Compare embedded vs direct tool dispatch path.
- Embedded-run timeout classification should respect model completion. If the model returns within budget (whether useful content OR
NONE),status=okis the correct classification. - Clear prior-run
prompt-errorevents from the next-run context. Cross-run state leakage of error metadata is unexpected.
Impact
AM is functionally unusable on this deployment until the embedded-runner abort-propagation issue is fixed. All cloud-recall-model tuning and budget tuning are dead-end paths because the model never gets useful tool results regardless of model speed. Documented in 5 sequential test passes with controlled variable changes.
Reporter
islandpreneur007, with diagnostic support from Trent.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Apr 29, 2026
Codex review: this still needs some work.
Summary
Keep open: independent official-release reports and an existing assignee establish maintainer value, while narrower merged repairs do not demonstrate complete resolution.
Reproducibility: Historical release reproductions are substantive, but this read-only review establishes no high-confidence current-main reproduction; the latest HTTP response excerpt does not prove terminal assistant completion.
Next step
Existing assignee osolmaz should correlate a current-main recall trace with tool outcomes, terminal completion, abort source, and cleanup before selecting a focused repair.
Review details
Best possible solution:
Preserve grounded completed recall at its existing owner while accurately distinguishing deadlines, parent cancellation, failed execution, and cleanup outcomes.
Do we have a high-confidence way to reproduce the issue?
Historical release reproductions are substantive, but this read-only review establishes no high-confidence current-main reproduction; the latest HTTP response excerpt does not prove terminal assistant completion.
Is this the best way to solve the issue?
A correlated failing trace should identify the remaining owner defect before changing cancellation semantics, since current source already preserves several completed-result and timeout-partial cases.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning medium; reviewed against f92b9727b6b7.
Label changes
Label changes:
No label changes.
Label justifications:
P2: Optional recall reliability affects context and reply latency, but an urgent current-main regression is not established.impact:session-state: Reported failures suppress recalled context and include stale error metadata appearing in subsequent recall runs.Evidence reviewed
Acceptance criteria:
What I checked:
src/agents/provider-transport-fetch.ts:403, f92b9727b6b7)extensions/active-memory/recall.ts:280, f92b9727b6b7)extensions/active-memory/index.test.ts:1888, f92b9727b6b7)src/agents/agent-tools.abort.ts:107, f92b9727b6b7)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.Reviewed October 27, 2026, 4:05 AM ET / 08:05 UTC.
islandpreneur007 commentedon Apr 29, 2026
Thank you for the source-level pointers (extensions/active-memory/index.ts:2123, 2150, 2279; src/agents/pi-tools.abort.ts:6; src/agents/pi-embedded-runner/run/attempt.ts:722) — those locate the bug for the maintainer cleanly.
Cross-link: the related copy/docs filing is #74587 (modelFallback warning text vs docs at line 440), narrowed in scope after a deeper docs read.
michaelmanly commentedon Apr 29, 2026
From this stack trace, this points to a ai api timeout problem. Running npx ai-doctor could help. It can fix missing timeout guards with safe request timeouts plus timeout and retry protection.
jorgeszabo commentedon Apr 30, 2026
I can confirm this reproduces on OpenClaw
2026.4.27 (cbc2ba0)withactive-memoryonmain, direct chat only, usingopenai-codex/gpt-5.5.Relevant config:
{ "enabled": true, "agents": ["main"], "allowedChatTypes": ["direct"], "queryMode": "message", "promptStyle": "strict", "timeoutMs": 10000, "maxSummaryChars": 220, "persistTranscripts": true, "logging": true, "model": "openai-codex/gpt-5.5" }Observed behavior:
memory_searchfrom the main agent works and returns relevant results.status=timeoutelapsedMs≈10055summaryChars=0timedOut=true,aborted=truememory_searchtool calls returned"Aborted"and the assistant eventually returnedNONE.memory_searchreturned relevant memory results, but the wrapper still hit timeout and aborted before a compact summary was returned. Final assistant stop reason wasaborted/This operation was aborted.So this does not appear to be “no memory found.” Relevant memory exists and direct memory tools work. The failure is in the AM embedded recall path / abort / timeout handling before the summary can be surfaced.
This matches the issue’s diagnosis closely.
M-Lietz commentedon May 5, 2026
Third-party confirmation on OpenClaw 2026.5.4 (
active-memoryplugin, direct chat).We hit this bug consistently when AM inherited the session model. Initial config (mimo via session inheritance, recall used the same):
{ "enabled": true, "agents": ["main"], "allowedChatTypes": ["direct"], "queryMode": "recent", "promptStyle": "balanced", "timeoutMs": 25000, "maxSummaryChars": 150, "persistTranscripts": false, "cacheTtlMs": 60000 }Pre-fix observation (xiaomi/mimo-v2.5-pro inherited): ~50% of recall runs hit the 25s timeout despite the model emitting a complete response — i.e. the embedded runner aborted the
memory_searchtool call and classified the run astimeouteven though the underlying model finished. Matches the original report exactly.Workaround (decoupling AM from the chat model): explicit
config.model="google/gemini-2.5-flash"+ raisedtimeoutMsto 30000.Latencies after the workaround over 6 consecutive runs against the same workspace:
So 4/6 recover when the recall model is fast and small, but 2/6 still come back
status=emptywith no summary even though the gateway log shows the underlying gemini call returned successfully — which lines up with the abort-but-keep-going path described atextensions/active-memory/index.ts:2123,2150,2279. The model finishes, but the recall pipeline returns empty.Net: forcing a fast, dedicated recall model dramatically lowers the user-visible timeout rate, but the underlying tool-call-abort vs. completion-classification mismatch is still observable. Looking forward to whatever lands here.
youyou-agent commentedon Jun 7, 2026
Same issue confirmed on OpenClaw 2026.6.1 (upgraded from 2026.5.12).
Our symptoms differ slightly from the original report — we see extremely fast aborts (25-94ms, not 10-60s timeouts):
timedOut: false, aborted: truefallbackConfigured: falseopenclaw memory search) works fine — confirming the bug is isolated to the embedded runner abort propagation, as the OP described.The abort happens every time during interactive user sessions (18 occurrences today). The same
memory_searchcall from non-embedded context runs normally.We also attempted the
config.modelworkaround but our local models have insufficient context window. We will monitor this issue and the fix in #90739.Environment: Linux/WSL2, Node v22.22.1, DeepSeek V4 Flash, direct chat only.
xdengli commentedon Jun 7, 2026
Additional Evidence (2026-06-07)
Encountering the same pattern with active-memory embedded runs. The model itself is working fine (main session uses it without issues), but the embedded runner aborts prematurely.
Environment
Logs
Key Observations
surface_errorinstead of trying fallback modelsembedded abort settle timed outat 2000ms suggests a race condition between abort signal and settleThis confirms the bug is in the embedded runner's abort propagation path, not in the model provider.
jcarterwil commentedon Jun 9, 2026
Still reproduces on 2026.6.1 — confirming finding #2 (embedded vs non-embedded).
The identical recall run as a standalone
openclaw memory searchreturns in ~4s with relevant hits, while the embedded AM run logsdone status=timeout summaryChars=0/incomplete turn … payloads=0 stopReason=missing. Confirmed across both memory backends (qmd and builtin + OpenAI embeddings) and both models (deepseek-v4-flashandopenai/gpt-5.4-mini), so it's isolated to the embedded-runner / AM tool-bridge path, not memory-core or the model. Also seen via the Codex app-server path (more detail in #86996).islandpreneur007 commentedon Jun 9, 2026
Current-version repro on
2026.6.5-beta.2: still reproduces intermittently.Same agent/model/config produced both successful Active Memory summaries and the #74586 incomplete-turn signature. This is not the separate force-restart collateral case (
codex app-server client closed before turn completed).Journal source:
#74586 abort signature:
Same current runtime also succeeds intermittently:
Explicitly excluded as a separate restart-boundary failure, not this issue:
xdengli commentedon Jun 11, 2026
Reproducing this pattern on OpenClaw 2026.6.5 (5181e4f) — additional evidence from a separate deployment. Reporting as @xdengli.
Confirming this exact pattern is reproducible here. Same shape, different provider. Two consecutive incidents in one minute on
active-memoryplugin (a different agent, nottrent). Persisted transcripts were not enabled, so I only have log-level evidence — no jsonl.Environment
active-memoryplugin enabled,agents: ["product-manager"],queryMode: "recent",timeoutMs: 60000,persistTranscripts: falsexiaomi-token-plan, modelmimo-v2.5-pro(vs. reporter'sollama-cloud/minimax-m2.5)timeoutMs: 2000abort-settle window observed in the embedded runnerIncident 1 — 10:24:42 → 10:24:50 (elapsed 5807ms)
Incident 2 — 10:33:34 → 10:33:37 (elapsed 1826ms, AFTER adding an agent-level fallback)
Things worth flagging beyond the reporter's three findings
aborted=trueANDtimedOut=falsein both incidents. This matches the reporter's "classified as timeout despite model completion" — the embedded runner is firing abort, not timeout. TheAbortErrororiginates at the provider-transport layer (elapsedMs=77and95for the failed model fetch — way below any budget).Adding an agent-level fallback did NOT help. Incident 2 happened ~9 minutes after I configured a fallback model for
product-manager. Theembedded_run_failover_decisionline showsfallbackConfigured=true, but decision is stillsurface_error. This confirms the reporter's hypothesis: the bug is in the embedded runner's abort path, not in provider selection.Fail-fast timing. Incidents 1 and 2 took 5807ms and 1826ms respectively — both well below the 60000ms
timeoutMs. The shorter second incident suggests the abort is not budget-driven; it fires on a different signal (likely the provider's transport-level abort propagating up).Profile id is identical across incidents (
sha256:518d9468172e) — the AM plugin reuses the same profile on each trigger; failure is not correlated with provider rotation.Hypothesis (consistent with reporter): The
AbortErroris being raised by the provider-transport layer (most likely a request-cancellation / connection-reset signal) and propagated up into the embedded runner's abort controller. The 2-secondtimeoutMssettle is then triggering because the embedded runner can't reconcile the in-flight abort with model completion.status=timeoutis the wrong classification —status=abortedorstatus=provider_abortwould be more honest and would unblock the correct fallback path.Happy to enable
persistTranscripts: trueand re-run on a current build if it helps narrow this down.20 remaining items
Suidge commentedon Sep 7, 2026
Additional live reproduction — OpenClaw 2026.9.2 (2026-09-07)
Still reproduces on the current release. This is a fresh field reproduction from a Codex-agent session (native codex app-server, gpt-6-astra) on macOS arm64, OpenClaw
2026.9.2 (3928bad).Symptom: model completes (HTTP 200, SSE stream done) → Active Memory still classifies
status=timeoutand drops the resultGateway log excerpt (
~/Library/Logs/openclaw/gateway.log, timestamps +08:00, sessionagent:agent-codex:discord:direct:557519782434308115):The model call returned HTTP 200 in 6158 ms — under the 8000 ms budget — yet the plugin aborted and reported
status=timeout elapsedMs=8007 summaryChars=0. The summary result is discarded even though the transport completed successfully. This matches finding #2/#3 from the original report (embedded run aborts tool calls / classifies timeout despite model completion).Contributing factor: recall context uses the full prompt envelope, not the bounded query
Same session,
queryMode: "recent"(default caps are recentUserChars=220 / recentAssistantChars=180), yet observedqueryCharsvalues across one afternoon:searchQueryCharsis correctly clamped to 480 (MAX_ACTIVE_MEMORY_SEARCH_QUERY_CHARS), but the recall sub-agent conversation context balloons to 188–317 KB from the assembledevent.promptenvelope — the mechanism already tracked in #88077. A 200–300 KB prompt against an 8 s hook budget times out every single turn; the codex session was effectively wedged (each turn burned a full model call + abort before the main reply could start).Repeated occurrences in the same session: 15:30, 16:51, 16:54, 16:55, 16:58, 17:01, 17:09, 17:18 (all
status=timeout,summaryChars=0, elapsedMs ≈ 8000).Configuration note (not a bug, but it lowers the blast radius)
This deployment had
timeoutMs: 8000set, below the plugin defaultDEFAULT_TIMEOUT_MS = 15000. That is user configurable, but the default also times out at 15 s on a 300 KB envelope. The underlying issues (a) aborting an already-completed transport and (b) unbounded recall context remain regardless of the timeout value.Related
native hook relay foreground invocation not allowedevery ~10 s (45 occurrences 17:00–17:07), consistent with the relay foreground window closing while active-memory keeps attempting mid-relay invokes.Happy to provide full log excerpts or a redacted repro script on request.