mirror of https://github.com/openclaw/openclaw.git
Place a sentinel object in the loadedFacadeModules cache before the Jiti sync load begins. Re-entrant calls (caused by circular facade references from constant exports evaluated at module-evaluation time) now receive the sentinel instead of recursing infinitely. Once the real module finishes loading, Object.assign() back-fills the sentinel so any references captured during the circular load phase see the final exports. The Jiti load is wrapped in try/catch: on failure the sentinel is removed from the cache so that subsequent retry attempts re-execute the load instead of silently returning an empty object. The function returns the sentinel (not the raw loaded module) to guarantee a single object identity for all callers, including those that captured a reference during the circular load phase. Also tightens the generic constraint from <T> to <T extends object> so Object.assign() is type-safe, and propagates the constraint to the test-utils callers in bundled-plugin-public-surface.ts. Fixes #57394 |
||
|---|---|---|
| .. | ||
| auth-token-assertions.ts | ||
| bundled-plugin-public-surface.ts | ||
| camera-url-test-helpers.ts | ||
| channel-plugin-test-fixtures.ts | ||
| channel-plugins.test.ts | ||
| channel-plugins.ts | ||
| chunk-test-helpers.ts | ||
| command-runner.ts | ||
| env.test.ts | ||
| env.ts | ||
| exec-assertions.ts | ||
| fetch-mock.ts | ||
| fixture-suite.ts | ||
| frozen-time.ts | ||
| imessage-test-plugin.ts | ||
| internal-hook-event-payload.ts | ||
| mock-http-response.ts | ||
| model-auth-mock.ts | ||
| model-fallback.mock.ts | ||
| npm-spec-install-test-helpers.ts | ||
| plugin-registration.ts | ||
| ports.ts | ||
| provider-usage-fetch.ts | ||
| repo-scan.ts | ||
| runtime-source-guardrail-scan.ts | ||
| secret-file-fixture.ts | ||
| secret-ref-test-vectors.ts | ||
| session-state-cleanup.test.ts | ||
| session-state-cleanup.ts | ||
| symlink-rebind-race.ts | ||
| system-run-prepare-payload.ts | ||
| temp-dir.ts | ||
| temp-home.test.ts | ||
| temp-home.ts | ||
| tracked-temp-dirs.ts | ||
| typed-cases.ts | ||
| vitest-mock-fn.ts | ||
| vitest-module-mocks.ts | ||