Repository navigation
fix: restore real Memory workers in Gateway fixtures - #175353
Conversation
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.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis 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.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete 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 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherGateway 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]
Technical reviewBest 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
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceTests +11. Total +11 across 1 file. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 17, 2026, 4:56 AM ET / 08:56 UTC. |
|
Merged via squash auto-merge.
|
…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.
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
--maxWorkers=1: 3 files, 8 tests, 401.68 seconds total. The reported deletion case passed in 15.137 seconds.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.