mirror of
https://github.com/thedotmack/claude-mem.git
synced 2026-09-20 04:23:02 +08:00
4da9ffc68c
* fix: rebuild plugin bundles so committed artifacts match manifest 13.24.0 The 13.24.0 release commit (85ccd626) bumped the manifests and CHANGELOG but never re-ran the build, so plugin/scripts/*.cjs kept the 13.23.1 bytes last produced by89ca057a. The Claude Code marketplace installs straight from this repo (.claude-plugin/marketplace.json -> "source": "./plugin"), so every marketplace user on 13.24.0 has been executing 13.23.1 code. ensureWorkerRunning() compares the resolved plugin version (13.24.0, taken from the plugin cache directory name) against the worker's baked-in __DEFAULT_PACKAGE_VERSION__ (13.23.1, reported by /api/health). The mismatch SIGKILLs the worker and respawns the same stale file on every hook event, with no state that survives the hook process to bound it -- an unbounded kill/respawn loop that takes the in-flight observer generator down with it, so no observations get written. This is a genuine `npm run build`, not a version-string patch. The bundles were stale in code, not merely in the constant: src/ moved 704 insertions across 12 files since 13.23.1, including the observer's <skip_summary reason="noise" /> protocol change, the new manual-session module, and the platform_source plumbing in SessionStore and MemoryRoutes. No version bump: the manifests were already correct at 13.24.0. It is the artifacts that were wrong. Fixes #3857 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Bshprs1vjut2XmaGTRESqX * fix(tests): restore module mocks so worker-spawner stubs stop leaking bun runs the whole suite in one process and mock.module is process-global and sticky, so stubs installed by one test file stay installed for every file loaded after it. tests/services/worker-spawner.test.ts mocked src/services/infrastructure/{ProcessManager,HealthMonitor}.js and never restored them. tests/infrastructure/{health-monitor,process-manager}.test.ts import the same symbols through the src/services/infrastructure/index.js barrel, so they silently exercised those stubs instead of the real code: isPortInUse returned false without touching net.createServer, waitForHealth returned false without fetching, getPlatformTimeout skipped the Windows doubling, cleanStalePidFile always reported 'dead', and spawnDaemon never returned undefined. waitForPortFree stayed real but resolved through the stubbed isPortInUse binding, inverting its timeout case. This is order-dependent, not new: bun walks test files in filesystem order, and a fresh CI checkout loads worker-spawner (59) well before health-monitor (169) and process-manager (172), while many local checkouts load tests/infrastructure first and pass. That ordering is what surfaced 19 failures in Actions run 33939805959. Snapshot the real namespaces eagerly, before the mock.module calls, and reinstall them in afterAll. The snapshot must be eager: `import * as x` yields a live namespace object that bun re-points when the module is mocked, so spreading it inside afterAll copies the stubs back in. That is exactly the latent bug in tests/cli/handlers/context-session-start.test.ts, whose restore was re-installing its own hook-settings, oauth-token, project-name and worker-utils stubs; fixed here the same way. Tests only. No source, plugin bundle, or version changes — the committed artifacts still match manifest 13.24.0. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LcjsK6QqeBcYXbJ8gqBsea --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>