Skip to content

fix: restore real Memory workers in Gateway fixtures - #175353

Merged
steipete merged 1 commit into
mainfrom
fix3-memory-fixture-artifacts
Oct 17, 2026
Merged

steipete merged 1 commit into
mainfrom
fix3-memory-fixture-artifacts

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes the Gateway agent-deletion and Memory shutdown tests failing to start their real Memory file worker after #175157 moved directory observation into that worker.

User Impact

No production behavior changes. The tests continue to exercise real Memory workers, agent deletion, survivor managers, custody, and shutdown with every existing assertion intact.

Why This Change Was Made

The shared fixture imports the real Memory runtime directly while the Gateway harness disables bundled discovery. Its new worker inherits that disabled environment and cannot resolve memory-core/worker-api.js. Prepare discovery in the shared fixture with the same validated source artifact root used by the imported runtime. This also avoids picking an unrelated older built API. Existing Vitest environment cleanup restores the overrides; production discovery and disable policy stay unchanged.

The complete fix is confined to one shared fixture: 12 additions and one deletion, with no new production state or test mock. Merely clearing the discovery overrides selected stale local built artifacts and failed; the final source-root fix passed with those older artifacts still present.

Evidence

  • Unchanged current-main baseline reproduced the missing worker API in the reported external-state deletion case.
  • All three fixture consumers pass through the native Gateway test configs with --maxWorkers=1: 3 files, 8 tests, 401.68 seconds total. The reported deletion case passed in 15.137 seconds.
  • Targeted Gateway-server and Gateway-methods test types, normal and boundary lint, formatting, diff whitespace, and the unchanged mock-export guard pass.
  • Independent P0–P2 autoreview: scoped-clean. No assertions, timeouts, retries, skips, or production code changed. No CI dispatch or rerun.

Published as a PR after two direct-main pushes lost concurrent main-update races. The patch is unchanged after rebasing; hosted PR CI is the broad proof.

The real Memory fixture imports its runtime directly into Vitest, while the
Gateway test environment disables bundled discovery. After #175157 moved
local file observation into the existing Memory worker, that worker could
not resolve memory-core/worker-api.js and agent deletion failed.

Prepare discovery at the shared fixture owner. Clear the disable override
and select the same validated source public-artifact tree as its runtime
import, so a prepared worker cannot borrow an unrelated older dist API.
The existing Vitest environment cleanup restores both scoped overrides.
Keep the real worker and every deletion, survivor-manager, custody and
shutdown assertion. Production discovery and disable policy are unchanged.

The unchanged current-main product proof reproduced the missing public
surface: one case passed and one failed (211.32s wrapper).

Final proof: all three shared-fixture consumer files pass 8/8 through the
native Gateway configs with --maxWorkers=1 (401.68s wrapper, 387.56s Vitest;
52% transformation). The formerly failing external-state deletion takes
15.137s. Source artifact resolution is exercised with older built artifacts
still present; no rebuild or deletion was used to make it pass.

Gateway-server and Gateway-methods test types (10.4s/10.2s), lint, boundary
lint, formatting, git diff --check, and P0-P2 autoreview pass. The mock-export
guard passes without changing its baseline. No retries, skips, timeouts,
production code, or CI dispatches/reruns were added.
@clawsweeper

clawsweeper Bot commented Oct 17, 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.

@steipete
steipete marked this pull request as ready for review October 17, 2026 08:41
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-17T08:43:54.877156Z 7ada592 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XS labels Oct 17, 2026
@steipete
steipete enabled auto-merge (squash) October 17, 2026 08:50
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 17, 2026
@clawsweeper

clawsweeper Bot commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR enables source-artifact discovery in the shared Gateway Memory fixture so its real worker can load the matching Memory API.

Example: The agent-deletion integration test opens a real Memory manager with bundled plugin discovery disabled.

  • Before: The worker cannot resolve memory-core/worker-api.js.
  • After: The worker discovers the source Memory API used by the fixture runtime.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, source-supported fixture repair with reported consumer coverage; validation remains harness-based and hosted CI is pending.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored test-fixture repair has no changed shipped behavior; supplied validation reports all existing consumers passing with real workers, but was not independently executed during this review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Gateway lifecycle regression tests fail during real Memory worker initialization, preventing their intended deletion and shutdown checks.
Reason: The maintainer-authored repair restores existing coverage without mocks, relaxed assertions, or a new product contract.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it repairs a concrete test-fixture failure still present on current main. The change preserves real workers and existing assertions, and I found no actionable defects.

Priority: P2
Reviewed head: 7ada592b3ef8fbda725c579d7ecadcf46cda9b7a

Before merge

None.

Findings

None.

Agent review details

How this fits together

Gateway lifecycle tests construct a real Memory runtime through a shared fixture; that runtime starts a worker which independently resolves its bundled plugin API.

flowchart TD
  A[Gateway lifecycle tests] --> B[Shared Memory fixture]
  B --> C[Source artifact discovery]
  B --> D[Real Memory runtime]
  D --> E[Memory file worker]
  E --> C
  C --> F[Memory worker API]
Loading

Technical review

Best possible solution:

Land the shared-fixture discovery repair once the existing merge gates permit it.

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

Source inspection establishes the disabled-discovery path into the real worker, and the author reports a matching baseline failure; this read-only review ran no tests.

Is this the best way to solve the issue?

Preparing discovery at the shared fixture owner is a narrow repair that reuses existing source-artifact resolution and preserves production discovery policy.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 9acdc3c8aa2f.

Provenance checked

  • Real Memory lifecycle fixture keeps the original intent (b5134de: The fixture supported real Memory lifecycle testing during plugin reload and retirement work; later deletion and shutdown changes retained that purpose.)
  • Fixture environment capture keeps the original intent (83f4c29: The fixture captured its environment for plugin-owned state during accepted Memory work and shutdown; the patch prepares matching worker discovery before that capture.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Focused introduced change: The pinned introduction diff changes only fixture imports and discovery environment preparation before capturing the environment; it changes no production code or assertions. (src/gateway/server-close.memory.test-support.ts:37, 7ada592b3ef8)
  • Matching source artifacts: Both relative runtime imports and the added worker lookup use resolveBundledPluginPublicModulePath, which selects the source extensions tree rather than an older built artifact. (src/test-utils/bundled-plugin-public-surface.ts:93, 7ada592b3ef8)
  • Independent worker discovery: The real worker loads memory-core/worker-api.js through bundled public-surface discovery; the local watcher creates that worker without overriding its inherited environment. (src/worker/memory-worker-entry.ts:20, 7ada592b3ef8)
  • Environment restoration: Shared Vitest configuration enables unstubEnvs, supporting restoration of the two fixture-scoped environment overrides between tests. (test/vitest/vitest.shared.config.ts:148, 7ada592b3ef8)
  • Current-main necessity: Fetched main retains the original fixture without discovery preparation, so the central repair is not already implemented there. (src/gateway/server-close.memory.test-support.ts:33, 9acdc3c8aa2f)
  • Reported validation and current gates: The complete PR body and commit message report baseline failure followed by all eight existing consumer tests passing with stale built artifacts still present. Live checks show PostgreSQL conformance still running and the aggregate gate pending; no failing code check was observed. (7ada592b3ef8)

PR surface

Tests +11. Total +11 across 1 file. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 12 1 +11
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 12 1 +11

Labels

Label changes:

  • add P2: The fixture failure blocks meaningful Gateway deletion and shutdown coverage, with no demonstrated production behavior change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: The fixture failure blocks meaningful Gateway deletion and shutdown coverage, with no demonstrated production behavior change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 17, 2026, 4:56 AM ET / 08:56 UTC.

@steipete
steipete merged commit fe84346 into main Oct 17, 2026
203 of 205 checks passed
@steipete
steipete deleted the fix3-memory-fixture-artifacts branch October 17, 2026 09:12
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 18, 2026
…penclaw#175353)

The real Memory fixture imports its runtime directly into Vitest, while the
Gateway test environment disables bundled discovery. After openclaw#175157 moved
local file observation into the existing Memory worker, that worker could
not resolve memory-core/worker-api.js and agent deletion failed.

Prepare discovery at the shared fixture owner. Clear the disable override
and select the same validated source public-artifact tree as its runtime
import, so a prepared worker cannot borrow an unrelated older dist API.
The existing Vitest environment cleanup restores both scoped overrides.
Keep the real worker and every deletion, survivor-manager, custody and
shutdown assertion. Production discovery and disable policy are unchanged.

The unchanged current-main product proof reproduced the missing public
surface: one case passed and one failed (211.32s wrapper).

Final proof: all three shared-fixture consumer files pass 8/8 through the
native Gateway configs with --maxWorkers=1 (401.68s wrapper, 387.56s Vitest;
52% transformation). The formerly failing external-state deletion takes
15.137s. Source artifact resolution is exercised with older built artifacts
still present; no rebuild or deletion was used to make it pass.

Gateway-server and Gateway-methods test types (10.4s/10.2s), lint, boundary
lint, formatting, git diff --check, and P0-P2 autoreview pass. The mock-export
guard passes without changing its baseline. No retries, skips, timeouts,
production code, or CI dispatches/reruns were added.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant