#3008·OpenViking

[Bug] Concurrent VLM calls during multi-session memory extraction cause 429 rate-limit errors

Author: wyl1988Created Jul 4, 2026Updated Sep 30, 2026

Bug Description

When multiple sessions commit simultaneously, OV triggers parallel memory extraction for each session. Each extraction spawns 3 concurrent VLM calls (summary + long-term + execution). With multiple sessions committing at once, this produces a burst of VLM API calls that exceeds rate limits.

The vlm.max_concurrent config only controls the semantic queue worker concurrency — it does not throttle memory extraction VLM calls.

Impact

In a multi-agent Hermes deployment with 20 profiles:

  • Multiple sessions commit within seconds of each other
  • Each commit triggers 3 parallel VLM calls
  • VLM API (GLM-4.7) returns 429 rate-limit errors
  • Failed extractions produce .failed.json files
  • Memories are silently lost — the session is marked as processed but extraction failed

Reproduction

  1. Deploy OV with 3+ active sessions
  2. Trigger commits on all sessions simultaneously (e.g., after a batch of conversations)
  3. Observe VLM 429 errors in logs
  4. Check for .failed.json files in the data directory

Workaround Applied

We patched OV source code to add a global asyncio Semaphore(1) around VLM calls in vlm/base.py and openai_vlm.py. This serializes all VLM calls system-wide, preventing rate-limit errors but significantly slowing memory extraction throughput.

The proper fix would be to:

  1. Apply vlm.max_concurrent to memory extraction calls (not just semantic queue)
  2. Add retry-with-backoff for 429 responses
  3. Queue extractions instead of spawning concurrent tasks per session

Environment

  • OpenViking: 0.4.5+
  • VLM: GLM-4.7 (via zai coding endpoint)
  • Multi-agent: 20 Hermes profiles, ~10 active sessions at peak
  • Observed: 6 .failed.json files in a single day before patch