Skip to content

memory index --force fails with 'fetch failed' on large workspace (1400+ .md files) #56427

Description

@runrelay

Bug Report

Description

openclaw memory index --force consistently fails with Memory index failed (main): fetch failed on a workspace with 1400+ .md files. After 2 failures, batch mode is permanently disabled (Batch: disabled (failures 0/2)), making re-indexing impossible without restarting gateway.

Environment

  • OpenClaw version: 2026.3.24
  • OS: macOS 26.3 (arm64)
  • Node: v25.8.1
  • Memory plugin: memory-core (stock, loaded)
  • Embedding provider: openai / text-embedding-3-small
  • OpenAI tier: Tier 3

Steps to Reproduce

  1. Have a workspace with 1400+ .md files in memory/
  2. Run openclaw memory index --force --verbose
  3. Observe 100-200+ [memory] embeddings: batch start lines
  4. Process fails with Memory index failed (main): fetch failed

Expected Behavior

Indexing completes successfully with proper retry/backoff on rate limits.

Actual Behavior

  • Indexer fires all batches in parallel (no concurrency limit)
  • One batch fails (rate limit or timeout)
  • Entire transaction rolls back
  • Batch: disabled (failures 0/2) — batch mode disabled permanently until gateway restart
  • Subsequent runs fail immediately

Logs

[memory] sync: indexing memory files
[memory] embeddings: batch start   (x200+)
[memory] embeddings rate limited; retrying in 574ms
Memory index failed (main): fetch failed
[memory] sync failed (session-start): TypeError: fetch failed
[memory] sync failed (search): TypeError: fetch failed

Workarounds Tried

  • Reducing workspace size (moved sessions/, backups/, _nonmd/ out of memory/) — no effect
  • Clearing sqlite store — no effect
  • Waiting for rate limits to reset — no effect
  • Increasing OpenAI tier — no effect

Suggested Fix

  1. Add concurrency limit to embedding batch processing (e.g. max 5 parallel batches)
  2. Proper exponential backoff on 429/rate-limit responses
  3. Do NOT disable batch mode globally after N failures — retry per-batch instead
  4. Persist partial index progress so failed runs can resume

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions