Skip to content

fix(memory): preserve managed local service startup budget - #143276

Closed
RileyJJY wants to merge 2 commits into
openclaw:mainfrom
RileyJJY:sunlit/fix/issue-143169
Closed

RileyJJY wants to merge 2 commits into
openclaw:mainfrom
RileyJJY:sunlit/fix/issue-143169

Conversation

@RileyJJY

@RileyJJY RileyJJY commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Resolves two deadline regressions in memory_search: cold managed local embedding startup could be cancelled by the search budget, and corpus=all could let a paused primary budget also extend the wiki supplement budget.

Why This Change Was Made

The tool and runtime now resolve one stable adapter per host acquisition callback, so manager cache identity is shared across runtime → tool → runtime transitions while different hosts remain isolated. Readiness-only pause/resume is carried by the provider target boundary; post-readiness reconciliation, ordinary manager acquisition, and registry waits remain inside each search's 15-second deadline. Primary memory and wiki searches keep independent budgets, both still linked to immediate caller cancellation.

User Impact

Cold managed local embedding services can finish startup within their configured readiness window. A slow primary startup no longer extends wiki retrieval, reconciliation cannot consume an unbounded readiness exemption, and runtime/tool consumers do not replace a healthy manager merely because they crossed a plugin boundary.

Evidence

  • Exact-head (e7ba92a51eddde86722077565357bd91c1d5f575) production-module-boundary proof using the real createMemoryRuntime and createMemorySearchTool consumers, with the same host callback across runtime → tool → runtime:
runtime → tool → runtime: one adapter identity was preserved
different host callbacks: adapter identities remained isolated
negative-control: caller cancellation preserved
  • Memory extension validation: node scripts/run-vitest.mjs run --config test/vitest/vitest.extension-memory.config.ts extensions/memory-core/src/runtime-provider.test.ts extensions/memory-core/src/tools.test.ts extensions/memory-core/src/memory-corpus.test.ts extensions/memory-core/src/tools.budget.test.ts extensions/memory-core/src/tools.real-manager.test.ts (5 files, 84 tests passed), including the real manager cold-start path and the runtime/tool identity sequence.
  • Provider readiness boundary: node scripts/run-vitest.mjs run --config test/vitest/vitest.plugins.config.ts src/plugins/openai-compatible-embedding-provider.test.ts (35 tests passed), including pause/resume around readiness and slow reconciliation outside the exemption.
  • Targeted preflight: format, changed-file lint, owning-project types, focused tests, identity, merge compatibility, dependency, and PR-body checks passed.
  • git diff --check.
  • Canonical precedents: merged PR fix(memory): respect QMD timeout for memory_search #95757 keeps timeout ownership at the backend phase boundary while preserving immediate caller cancellation; PR fix(memory): avoid repeated local provider initialization across registrations #142417 preserves callback identity across manager reuse.
Production boundary proof source
const acquireLocalService = async () => ({ release() {} });
const runtime = createMemoryRuntime({ acquireLocalService });
await runtime.getMemorySearchManager({ cfg, agentId: "main" });
await createMemorySearchTool({ config: cfg, acquireLocalService })?.execute("identity", {
  query: "runtime tool runtime",
});
await runtime.getMemorySearchManager({ cfg, agentId: "main" });
// The saved exact-head test asserts all three manager callbacks share identity.
console.log({ adapterIdentity: "preserved", callerAbort: "preserved" });

AI-assisted: built with Codex

@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 9, 2026
@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the context here. I did a careful shell check against current main, and this is already implemented.

The requested cold-start and independent wiki-budget behavior is already implemented and shipped in v2026.9.4. The remaining callback adapter preserves an identity that main already passes through unchanged, so it does not establish a distinct remaining fix.

I found the merged PR that appears to have closed this: #143590: fix(memory): keep managed local-service readiness on its own budget during memory_search.

Root-cause cluster
Relationship: superseded
Canonical: #143590
Summary: The merged repair covers the reported readiness and wiki-deadline behavior.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

So I’m closing this as already implemented rather than keeping a duplicate issue open.

Review details

Best possible solution:

Retain the shipped readiness-owner implementation and use the existing registration-identity work for any separately demonstrated callback-reuse defect.

Do we have a high-confidence way to reproduce the issue?

No remaining current-main failure was established: source, existing regression coverage, and the merged repair address the reported cold-start and wiki-budget scenarios.

Is this the best way to solve the issue?

No additional implementation is needed for the stated behavior; the shipped phase-boundary repair provides it, and direct callback forwarding already preserves the identity exercised by this branch.

Security review:

Security review cleared: The introduced diff adds no concrete authorization, credential, persistence, dependency, or supply-chain concern.

AGENTS.md: found and applied where relevant.

What I checked:

Likely related people:

  • wangmiao0668000666: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Codex review notes: model internal, reasoning medium; reviewed against 9f035223edb7; fix evidence: merged PR #143590, release v2026.9.4, commit 874b2ce292f4.

@RileyJJY
RileyJJY force-pushed the sunlit/fix/issue-143169 branch from 2871dca to 4e5dfe1 Compare September 9, 2026 20:21
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Sep 9, 2026
@RileyJJY
RileyJJY force-pushed the sunlit/fix/issue-143169 branch from 4e5dfe1 to 3b91461 Compare September 10, 2026 03:23
@RileyJJY
RileyJJY force-pushed the sunlit/fix/issue-143169 branch from 3b91461 to b521348 Compare September 10, 2026 15:10
@RileyJJY

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@clawsweeper

clawsweeper Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 11, 2026
@RileyJJY RileyJJY closed this Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: memory-core Extension: memory-core P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant