Skip to content

chore(release): v0.9.26 hotfix - first-run load crash (#797) - #804

Merged
rohitg00 merged 1 commit into
mainfrom
fix/797-load-manifest-undefined
Jun 3, 2026
Merged

chore(release): v0.9.26 hotfix - first-run load crash (#797)#804
rohitg00 merged 1 commit into
mainfrom
fix/797-load-manifest-undefined

Conversation

@rohitg00

@rohitg00 rohitg00 commented Jun 3, 2026

Copy link
Copy Markdown
Owner

Hotfix on top of v0.9.25. Closes #797.

Problem

First boot after upgrading to v0.9.25 threw:

[agentmemory] Failed to load persisted index: TypeError: Cannot read properties of undefined (reading 'v')
    at IndexPersistence.loadManifestData
    at IndexPersistence.loadShardedData

Root cause

loadShardedData checked manifest.value !== null before forwarding to loadManifestData. Some iii-state adapters return undefined (not null) for a missing key, so undefined !== null was true and loadManifestData(undefined, ...) immediately read undefined.v.

Self-healing: the next debounced save rebuilt a fresh manifest, so ongoing operation continued — but the crash scared every fresh upgrader (reported by 3 users in #797 within 7 hours).

Fix

Treat null + undefined + non-object values as 'no manifest' and fall through to the legacy load path. Shape check stays so a malformed-but-present row still fails closed.

Tests

Two regression cases in test/index-persistence.test.ts:

  • kv.get returning undefined → clean { bm25: null, vector: null } load, no throw.
  • kv.get returning a string (wrong shape) → manifest path doesn't crash.

Full suite: 125 files / 1381 tests pass.

Summary by CodeRabbit

  • Bug Fixes

    • Fixed a first-boot crash that occurred in specific storage configurations when manifest data was missing or returned in unexpected formats.
  • Chores

    • Version bump to 0.9.26 across package manifests and exports.
    • Updated changelog and test coverage.

First boot after upgrading to v0.9.25 threw
'TypeError: Cannot read properties of undefined (reading v)' from
IndexPersistence.loadManifestData. Some iii-state adapters return
undefined (not null) for a missing key. The load path checked
manifest.value !== null and forwarded undefined to loadManifestData,
which then read undefined.v.

Self-healing: the next debounced save rebuilt a fresh manifest, so
operation continued after the warning — but the error scared every
fresh upgrader.

Fix: treat null + undefined + non-object values as 'no manifest' and
fall through to the legacy load path. Two regression tests:

  - kv.get returning undefined surfaces as a clean { bm25: null,
    vector: null } load, no throw.
  - kv.get returning a string (wrong shape) does not crash the
    manifest path.

Files bumped (9):
  package.json, plugin/.claude-plugin/plugin.json, plugin/plugin.json,
  plugin/.codex-plugin/plugin.json, src/version.ts, src/types.ts,
  src/functions/export-import.ts, test/export-import.test.ts,
  packages/mcp/package.json

125 test files / 1381 tests pass.

Closes #797.
@vercel

vercel Bot commented Jun 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agentmemory Ready Ready Preview, Comment Jun 3, 2026 9:15am

Request Review

@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 04de15b2-6bb7-4140-8ae6-06c2c52db645

📥 Commits

Reviewing files that changed from the base of the PR and between d442fee and 5185584.

📒 Files selected for processing (12)
  • CHANGELOG.md
  • package.json
  • packages/mcp/package.json
  • plugin/.claude-plugin/plugin.json
  • plugin/.codex-plugin/plugin.json
  • plugin/plugin.json
  • src/functions/export-import.ts
  • src/state/index-persistence.ts
  • src/types.ts
  • src/version.ts
  • test/export-import.test.ts
  • test/index-persistence.test.ts

📝 Walkthrough

Walkthrough

This patch release (0.9.26) fixes a critical first-boot crash in the index persistence layer where loadShardedData crashes when storage adapters return undefined instead of null for missing manifests. The fix adds null/undefined guards before manifest parsing. Export compatibility, version constants, and all package manifests are updated to match the new release version, with regression tests confirming the crash is prevented.

Changes

v0.9.26 Release: Undefined Manifest Handling & Version Bump

Layer / File(s) Summary
Undefined manifest handling fix and regression tests
src/state/index-persistence.ts, test/index-persistence.test.ts
loadShardedData() now checks that manifest values are non-null objects before parsing; both undefined and null are treated as "no manifest," falling back to the legacy key path. Two new regression tests (#797) verify load() handles undefined manifests and malformed values without crashing.
Export version compatibility updates
src/types.ts, src/functions/export-import.ts, test/export-import.test.ts
ExportData.version type union and mem::import supported versions list extended to include "0.9.26"; existing export test assertion updated to expect the new version.
Version constant and release manifests
src/version.ts, package.json, packages/mcp/package.json, plugin/plugin.json, plugin/.claude-plugin/plugin.json, plugin/.codex-plugin/plugin.json
VERSION constant and all package/plugin manifests bumped from 0.9.25 to 0.9.26.
Release documentation
CHANGELOG.md
New [0.9.26] section documents the first-boot crash fix, noting the undefined/null equivalence treatment, legacy path fallback, self-healing via next save, and regression test coverage.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • rohitg00/agentmemory#792: v0.9.25 release PR that established the same export/import version compatibility and manifest versioning pattern this patch extends.
  • rohitg00/agentmemory#659: Earlier version bump that extended src/functions/export-import.ts supported versions and ExportData.version type using the same pattern applied here.

🐰 A manifest undefined, a crash that caught the eye,
We guard with null-checks now and teach the loader why.
Version bumps and tests galore, from root to plugin fold,
Self-healing saves, regression guards—a patch release bold! ✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/797-load-manifest-undefined

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@rohitg00
rohitg00 merged commit 7446bde into main Jun 3, 2026
6 of 7 checks passed
healdigital pushed a commit to healdigital/agentmemory that referenced this pull request Jul 27, 2026
…ohitg00#804)

First boot after upgrading to v0.9.25 threw
'TypeError: Cannot read properties of undefined (reading v)' from
IndexPersistence.loadManifestData. Some iii-state adapters return
undefined (not null) for a missing key. The load path checked
manifest.value !== null and forwarded undefined to loadManifestData,
which then read undefined.v.

Self-healing: the next debounced save rebuilt a fresh manifest, so
operation continued after the warning — but the error scared every
fresh upgrader.

Fix: treat null + undefined + non-object values as 'no manifest' and
fall through to the legacy load path. Two regression tests:

  - kv.get returning undefined surfaces as a clean { bm25: null,
    vector: null } load, no throw.
  - kv.get returning a string (wrong shape) does not crash the
    manifest path.

Files bumped (9):
  package.json, plugin/.claude-plugin/plugin.json, plugin/plugin.json,
  plugin/.codex-plugin/plugin.json, src/version.ts, src/types.ts,
  src/functions/export-import.ts, test/export-import.test.ts,
  packages/mcp/package.json

125 test files / 1381 tests pass.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

First run of 0.9.25: Failed to load persisted index:

1 participant