Skip to content

fix(memory): spawn embedding worker from launched node - #99563

Closed
welfo-beo wants to merge 1 commit into
openclaw:mainfrom
welfo-beo:contrib/small-pr
Closed

welfo-beo wants to merge 1 commit into
openclaw:mainfrom
welfo-beo:contrib/small-pr

Conversation

@welfo-beo

Copy link
Copy Markdown
Contributor

Summary

  • spawn local embedding workers with the launched Node executable (process.argv[0]) instead of the resolved process.execPath
  • cover the deleted-execPath case so worker startup keeps working after a Homebrew Node upgrade removes the old Cellar path

Test plan

  • node scripts/run-vitest.mjs packages/memory-host-sdk/src/host/embeddings.test.ts -- --reporter=dot --maxWorkers=1 --testTimeout=10000 --teardownTimeout=5000
  • git diff --check

@openclaw-barnacle openclaw-barnacle Bot added size: XS triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 3, 2026
@clawsweeper

clawsweeper Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 3, 2026, 10:07 AM ET / 14:07 UTC.

Summary
The PR passes process.argv[0] as the local embedding worker fork execPath and adds a regression test for a deleted process.execPath.

PR surface: Source +1, Tests +44. Total +45 across 2 files.

Reproducibility: yes. at source level. Current main omits execPath at the local worker fork call, and Node's fork implementation defaults that executable to process.execPath, matching the stale Homebrew Cellar ENOENT report.

Review metrics: 1 noteworthy metric.

  • Worker executable source: 1 fork call changed. The diff changes the availability-critical worker process-launch executable, and the selected source determines whether Homebrew upgrade recovery works.

Stored data model
Persistent data-model change detected: serialized state: packages/memory-host-sdk/src/host/embeddings.test.ts, vector/embedding metadata: packages/memory-host-sdk/src/host/embeddings-worker.ts, vector/embedding metadata: packages/memory-host-sdk/src/host/embeddings.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #99183
Summary: This PR is a candidate fix for the canonical local embedding worker stale Homebrew Node executable issue, with several sibling candidate PRs still open or closed unmerged.

Members:

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

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🧂 unranked krab
Result: blocked until real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Replace process.argv[0] with a proven stable executable resolver or retry path at the worker fork boundary.
  • Update the regression test so it fails under the real Node argv/execPath stale-path semantics on current main.
  • [P1] Add redacted macOS Homebrew Gateway terminal output, logs, live output, or a linked artifact showing a fresh local embedding worker succeeds after the old Cellar executable is unavailable.

Proof guidance:

  • [P1] Needs real behavior proof before merge: No after-fix real setup proof is present; the contributor should add redacted macOS/Homebrew Gateway terminal output, logs, live output, or a linked artifact and update the PR body for re-review.

Risk before merge

  • [P1] Merging as-is can leave the stale Homebrew Cellar worker fork failure unresolved because process.argv[0] is not the stable launch symlink the PR assumes.
  • [P1] The PR body does not include after-fix real setup proof from a macOS/Homebrew Gateway or equivalent runtime log showing fresh worker recovery.
  • [P1] Several sibling PRs target the same canonical issue, so maintainers should converge on one corrected, proof-positive worker-startup path before landing.

Maintainer options:

  1. Replace argv[0] with a real stable executable (recommended)
    Update the worker fork and regression test to use a proven stable Homebrew/PATH executable or retry path, then add target real behavior proof before merge.
  2. Pause behind the canonical candidate decision
    If maintainers prefer another open candidate for the same canonical issue, pause this branch until one proof-positive implementation is selected or merged.

Next step before merge

  • [P1] Human review is needed because the branch has blocking correctness findings, missing contributor real-behavior proof, and overlapping sibling candidates for the same canonical issue.

Security
Cleared: No concrete security or supply-chain concern was found; the diff changes local worker process spawning and tests without dependencies, workflows, secrets, lockfiles, permissions, or third-party code sources.

Review findings

  • [P1] Resolve a stable worker executable before forking — packages/memory-host-sdk/src/host/embeddings-worker.ts:237
  • [P2] Simulate the stale argv path in the regression test — packages/memory-host-sdk/src/host/embeddings.test.ts:578-583
Review details

Best possible solution:

Land one canonical memory-host-sdk worker fix that resolves a valid stable Homebrew/PATH executable before fork or retries with one, updates the regression test to match Node argv semantics, and includes redacted real runtime proof.

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

Yes, at source level. Current main omits execPath at the local worker fork call, and Node's fork implementation defaults that executable to process.execPath, matching the stale Homebrew Cellar ENOENT report.

Is this the best way to solve the issue?

No. The owner area is right, but process.argv[0] is not the stable launched path the PR assumes; the safer fix is a stable executable resolver or retry path with a regression test that models Node's real argv behavior.

Full review comments:

  • [P1] Resolve a stable worker executable before forking — packages/memory-host-sdk/src/host/embeddings-worker.ts:237
    Node's fork default already uses process.execPath, and this runtime shows process.argv[0] equal to process.execPath while the original launch token is in process.argv0. Passing process.argv[0] can still spawn the deleted Cellar binary in the reported scenario.
    Confidence: 0.94
  • [P2] Simulate the stale argv path in the regression test — packages/memory-host-sdk/src/host/embeddings.test.ts:578-583
    This test only changes process.execPath; process.argv[0] remains the still-valid runner binary, so it passes without modeling the real stale worker executable path. Make the test fail on current main and prove the stable-path recovery branch.
    Confidence: 0.9

Overall correctness: patch is incorrect
Overall confidence: 0.92

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against aabe44f63822.

Label changes

Label justifications:

  • P2: This PR targets a normal-priority local semantic-memory availability bug after Homebrew Node upgrades with limited blast radius.
  • merge-risk: 🚨 availability: The diff changes local embedding worker process startup, and the current implementation can still leave fresh workers unavailable after the reported stale executable failure.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🧂 unranked krab.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: No after-fix real setup proof is present; the contributor should add redacted macOS/Homebrew Gateway terminal output, logs, live output, or a linked artifact and update the PR body for re-review.
Evidence reviewed

PR surface:

Source +1, Tests +44. Total +45 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 0 +1
Tests 1 44 0 +44
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 45 0 +45

What I checked:

  • Root policy read: Root AGENTS.md was read fully and applied for the deep PR review, dependency-contract, proof, and process-boundary checks. (AGENTS.md:1, aabe44f63822)
  • Current main worker fork: Current main still calls fork(this.scriptPath, [], { execArgv, serialization, stdio }) without an explicit execPath, matching the source-level stale process.execPath failure mechanism. (packages/memory-host-sdk/src/host/embeddings-worker.ts:236, aabe44f63822)
  • PR production change: The only production change sets execPath: process.argv[0] at the local embedding worker fork call. (packages/memory-host-sdk/src/host/embeddings-worker.ts:237, 6f94b81462e8)
  • Node fork contract: Local Node 24.18.0 source shows child_process.fork defaults options.execPath to process.execPath and then calls spawn(options.execPath, args, options).
  • Node argv behavior check: The reviewed Node runtime reports process.argv[0] equal to process.execPath, while process.argv0 separately preserves the original launch token, so process.argv[0] is not the stable symlink source claimed by the PR.
  • Regression test gap: The new test mutates only process.execPath; process.argv[0] remains the still-valid runner binary, so the test can pass without modeling the real stale executable path. (packages/memory-host-sdk/src/host/embeddings.test.ts:578, 6f94b81462e8)

Likely related people:

  • osolmaz: Authored the merged local embedding worker safety work that introduced the worker sidecar and failure-handling surface touched by this PR. (role: feature history owner; confidence: high; commits: 7ff29a9e6df6, 8f3095944c89, 2fdc7f4b5c47; files: packages/memory-host-sdk/src/host/embeddings-worker.ts, packages/memory-host-sdk/src/host/embeddings.test.ts, extensions/memory-core/src/memory/manager-local-worker-errors.ts)
  • scoootscooob: Authored the merged Homebrew Cellar-to-stable-symlink resolver pattern used by daemon runtime path selection. (role: adjacent resolver introducer; confidence: high; commits: 8950c595818a, 94e4a8712f93, f8136bd408bb; files: src/infra/stable-node-path.ts, src/daemon/runtime-paths.ts)
  • zssggle-rgb: Authored a merged ACPX stale executable fallback in a separate process-launch surface relevant to the fix shape. (role: adjacent fallback contributor; confidence: medium; commits: 187d3ed05307, 712e51c9cd4e; files: extensions/acpx/src/runtime-internals/process.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Jul 3, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Jul 18, 2026
@clawsweeper

clawsweeper Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix(memory): spawn embedding worker from launched node This is item 1/1 in the current shard. Shard 14/22.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@openclaw-barnacle

Copy link
Copy Markdown

Closing due to inactivity.
If you believe this PR should be revived, post in #clawtributors on Discord to talk to a maintainer.
That channel is the escape hatch for high-quality PRs that get auto-closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS stale Marked as stale due to inactivity status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant