Repository navigation
fix(memory): memory search no longer pages Sentry while the index is still building - #288
Conversation
…still building A "missing" index identity (no catalog built yet -- the ordinary state for the first moments of a new session/workspace) was treated the same as a "mismatched" one (a real, operator-actionable config drift): resolvePausedMemoryIndexIdentityReason paused memory_search for both, returning a disabled/error result with a misleading "built with a different embedding provider" explanation. That bare error field was enough for the host's generic tool-result classifier to flag it as a real exception, with no sentry-monitor carve-out catching it (the same noisy-tool-result class already fixed for web_fetch 403/404/429 in #282) -- paging OPENCLAW-FLEET-X4 on every cold-start race, 166 events across 7 customer hosts over 44 days. Narrow resolvePausedMemoryIndexIdentityReason to only pause on "mismatched". "missing" now falls through to the normal search flow, where it also gets a real chance at tools.ts's own forced-retry-sync block (previously unreachable for this case, since the early return happened first). Fixes: ENG-21227 / OPENCLAW-FLEET-X4 Co-Authored-By: Claude Sonnet 5 <[email protected]>
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Per cubic-dev-ai review feedback: keep the comment focused on the missing-vs-mismatched behavior and its false-unavailable-result consequence, not ticket/incident lore.
There was a problem hiding this comment.
Code Review: Approve
Approve covers 52a38f06e5607d49437a216bbff0901b55be1c8a specifically (cleanly rebased on origin/boon @ 15bfdb55058).
Evidence & Verification Summary
-
Root Cause & Invariant Fix (
extensions/memory-core/src/tools.ts):resolvePausedMemoryIndexIdentityReasonnow pauses search strictly on"mismatched".- A
"missing"index identity (normal cold-start state prior to initial catalog completion) no longer triggers early return with{ disabled: true, error: ... }and the misleading"different embedding provider"message that previously flagged as an unhandled tool exception in Sentry (OPENCLAW-FLEET-X4/ENG-21227). - The fallback error message is cleanly updated to
"memory index identity is mismatched".
-
Self-Healing Flow:
- Allowing
"missing"to proceed through search means it reaches the existing forced-retry-sync block (activeMemory.manager.sync({ reason: "search", force: true })) intools.tson empty results, giving cold starts an immediate in-band opportunity to self-heal. - If still empty, it returns clean
results: []withoutdisabledorerrormetadata.
- Allowing
-
Test Coverage (
extensions/memory-core/src/tools.test.ts):- Added test
"treats a missing index identity as an ordinary empty result, not a paused error"asserting:details.resultsequals[]details.disabledisundefineddetails.errorisundefinedsearchCalls === 2andgetMemorySyncMockCalls() === 1(proving forced-retry-sync is reached)
- Existing
"mismatched"test remains intact and passes, verifying that mismatched embedding provider configs still pause cleanly.
- Added test
-
Review Threads:
- Verified via GraphQL: 0 unresolved threads. The single feedback thread from
cubic-dev-aion source comment lore was addressed in52a38f06.
- Verified via GraphQL: 0 unresolved threads. The single feedback thread from
-
CI & Sanity:
- All 75 GitHub Actions checks passing on head commit
52a38f06e5607d49437a216bbff0901b55be1c8a.
- All 75 GitHub Actions checks passing on head commit
Post-merge e2e verification (no mocks on manager internals)Ran against the actual merged code on Steps:
Fix behaves as intended end-to-end, on real infrastructure. Scratch test file was not committed (throwaway worktree, removed after verification). |
Cut the fork release that ships the six commits on boon since v2026.6.34-boon.7: - #292 (ENG-21407): resolve relative media/PDF paths against the agent workspace in pdf, image_generate, video_generate, and music_generate, instead of the gateway process cwd; delete the image tool's duplicate inline resolution now that the loader owns it canonically. - #289 (ENG-21228): let image, pdf, image_generate, video_generate, and music_generate read agent-rendered files outside the default roots (e.g. /tmp crops) when the agent is permitted host reads outside its workspace, matching the outbound MEDIA: path; a blocked path now returns a denied tool result instead of a raw error that paged Sentry. - #293 (ENG-21406): raise the image tool's default vision timeout 60s -> 150s (above boon-llm-gateway's 120s fallback-chain budget), share one deadline across setup and the provider request, and return a graceful timeout status instead of letting the raw error end the turn; mirrored in the Codex dynamic-tool watchdog; sentry-monitor downgrades image timeouts to a warning. - #291: sentry-monitor no longer pages on ordinary non-zero exec exit codes; only shell lookup failures (126/127) stay exceptions, now fingerprinted per missing binary. Runtime Docker image adds unzip. - #288 (ENG-21227): memory_search no longer pauses/pages Sentry while the index is still building ("missing" identity); only a real "mismatched" embedding provider pauses it. - #294 (ENG-21405, test-only): regression coverage confirming the cron delivery-target guard already rejects a directory-less channel's unknown target end to end; root cause for the live Sentry errors was a stale anychat-boon-web plugin install, not a core gap. Bump root package.json and npm-shrinkwrap.json, all 136 plugin manifests, and the version field in every extension's npm-shrinkwrap.json via pnpm plugins:sync, hand-patched the same way as boon.7 (the npm-shrinkwrap generator still can't regenerate cleanly on this fork: pre-existing, unrelated @sentry/node nested @opentelemetry/resources / sdk-trace-base registry-resolution drift, reproduced again on this base). Verified via test/package-manager-config.test.ts (12/12) and the full release-preflight check suite (plugin versions, inventory, base config schema, bundled channel config metadata, config docs baseline, plugin SDK exports/API baseline/surface budget, root dependency ownership) -- all green except the known shrinkwrap generator drift. Add the 2026.6.34-boon.8 CHANGELOG.md section and the generated extensions/matrix/CHANGELOG.md entry. No config schema, plugin-SDK surface, or plugin source/dependency change in slack/msteams/diagnostics-prometheus; this is a gateway-only roll (bundled-plugin source changes in codex, memory-core, and sentry-monitor ship inside the gateway tarball). Targeted tests for all three touched extensions plus the codex dynamic-tool-execution suite: 1075/1075 passing. Co-authored-by: Claude Sonnet 5 <[email protected]>
What Problem This Solves
Fixes an issue where the agent's
memory_searchtool would tell users memory recall was unavailable — with an inaccurate "built with a different embedding provider" explanation — during the first moments of a new session, before its memory index had finished building for the first time. The same condition paged OPENCLAW-FLEET-X4 to Sentry as an unhandled exception on every occurrence: 166 events across 7 customer hosts over 44 days (dominated by the busiest host, which hit it repeatedly, not just once).Why This Change Was Made
resolvePausedMemoryIndexIdentityReasontreated a"missing"index identity (no catalog built yet — the ordinary, self-healing state right after a new session starts) identically to a"mismatched"one (a real, operator-actionable case: an index built against a since-changed provider/model/scope). Both returned the same harddisabled/errortool result. That bareerrorfield alone was enough for the host's generic tool-result classifier to flag it as a real exception — the same class of noisy-but-not-broken tool result already fixed forweb_fetch403/404/429 in #282 — with no equivalent carve-out yet for this case.This change narrows the pause to
"mismatched"only."missing"now falls through to the ordinary search flow, which also means it reachestools.ts's own forced-retry-sync block — previously unreachable for this case, since the old code returned before ever getting there — giving it a real chance to self-heal within the same call, not just via the independent session-start background sync.Scope / known follow-ups (not blocking): this fixes the
memory_searchagent tool specifically. The deeper root cause —manager.search()'s cold-start self-heal checks "does any content exist," not "is the index identity valid" — is untouched, andcli.runtime.ts's directmanager.search()call (theopenclaw memory searchCLI command) has no equivalent gating before or after this change. Tracking as a separate, lower-risk-budget follow-up rather than widening this PR. Also noting a narrow residual case found in review: the now-reachable forced retry-sync can throw a cross-process lock-contention error (manager-reindex-lock.ts) if something else (e.g. a concurrent CLI reindex) holds the reindex lock at the same moment — a different, much lower-frequency trigger of the same "unavailable" result shape than the one being fixed here.User Impact
Agents no longer tell customers memory is "paused" with an incorrect reason during normal cold-start timing. On-call no longer gets paged for this non-issue.
Evidence
extensions/memory-core/src/tools.test.ts— "treats a missing index identity as an ordinary empty result, not a paused error" — asserts nodisabled/errorfields, and that the forced-retry-sync is now reached (previously unreachable for this status)."mismatched"test ("returns unavailable metadata when the index identity is paused") passes unchanged — confirms that path is untouched.extensions/memory-coresuite: 943/943 passing, 63 files, no regressions.manager.search()method against a "content exists, catalog missing" state and confirmed its cold-start self-heal is skipped in that exact condition (separate from this PR's fix, explains why "missing" occurs despite existing self-heal layers).🤖 Generated with Claude Code
Summary by cubic
Fixes
memory_searchtreating a not-yet-built memory index as a hard error, which paged Sentry on every cold start (166 events across 7 hosts over 44 days).A "missing" index identity — the ordinary state in the first moments of a new session before the background sync finishes building the catalog — was collapsed with a genuinely actionable "mismatched" identity (index built for a different provider/model/scope). Both returned the same disabled/error tool result, and that bare
errorfield was enough for the host's tool-result classifier to flag it as an unhandled exception. "missing" now falls through to the normal search flow, which also reaches the existing forced-retry-sync block — previously unreachable from this path — so the index gets a chance to self-heal within the same call. Searching now returns an ordinary empty result during cold start instead of a misleading "built with a different embedding provider" error.Bug Fixes
memory_search; "missing" proceeds with normal search and retry-sync.disabled/errorfields, and that retry-sync is now reached; the "mismatched" path's existing test passes unchanged.Written for commit 52a38f0. Summary will update on new commits.