Skip to content

First run of 0.9.25: Failed to load persisted index: #797

Closed

Description

@alxjzx100
[OTel] Traces initialized: engine=ws://localhost:49134, service=agentmemory
[OTel] Metrics initialized: interval=30000ms
[OTel] Global fetch instrumentation enabled
[OTel] Logs initialized: delay=100ms, batch=1
[OTel] Connected to engine at ws://localhost:49134/otel
[iii] Worker registered with ID: d7233d29-a366-4559-baf3-37dbd3102707
[agentmemory] Failed to load persisted index: TypeError: Cannot read properties of undefined (reading 'v')
    at IndexPersistence.loadManifestData (file:///opt/homebrew/lib/node_modules/@agentmemory/agentmemory/dist/src-fQOMXeCp.mjs:2652:16)
    at IndexPersistence.loadShardedData (file:///opt/homebrew/lib/node_modules/@agentmemory/agentmemory/dist/src-fQOMXeCp.mjs:2630:44)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async IndexPersistence.load (file:///opt/homebrew/lib/node_modules/@agentmemory/agentmemory/dist/src-fQOMXeCp.mjs:2485:20)
    at async main (file:///opt/homebrew/lib/node_modules/@agentmemory/agentmemory/dist/src-fQOMXeCp.mjs:20097:17)
[agentmemory] Viewer: http://localhost:3113

Just for the first run

Activity

  1. IamSAL commented on Jun 3, 2026

    @IamSAL

    Same

  2. chenmijiang commented on Jun 3, 2026

    @chenmijiang

    Same, a new persistent index will be rebuilt after the first error is thrown

  3. rohitg00 commented on Jun 3, 2026

    @rohitg00
    Owner

    Thanks for creating this issue.

  4. rohitg00 commented on Jun 3, 2026

    @rohitg00
    Owner

    Shipped in v0.9.26 (release notes, PR #804).

    Thanks @alxjzx100 for the precise repro + stack trace, and @IamSAL @chenmijiang for confirming.

    Root cause: some iii-state adapters return undefined (not null) for a missing key. The sharded-load path checked manifest.value !== null and passed undefined through to loadManifestData, which then read undefined.v. Fixed by treating both null and undefined (plus non-object values) as 'no manifest' and falling through to the legacy load path. The crash itself was cosmetic — the debounced save rebuilt the index a few seconds later — but the boot-time stack trace was scaring every fresh upgrader.

    Upgrade:

    npm install -g @agentmemory/agentmemory@0.9.26
    

    First-run boot is quiet now.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions