bytedance/deer-flow · error · MemoryManagerError

{message} (session={session_id})

Error message

{message} (session={session_id})

What it means

_handle_write_error() builds the detail message '{message} (session={session_id})' around an underlying capture exception. When memory.backend_config.failure_policy.write is 'raise', it re-raises as MemoryManagerError chained from the original exception; with the default 'log_and_drop' it logs at ERROR with the traceback instead and the conversation turn proceeds. The {message} placeholder itself comes from the capture step (e.g. OpenVikingPartialWriteError handling).

Source

Thrown at backend/packages/harness/deerflow/agents/memory/backends/openviking/openviking_manager.py:540

        finally:
            try:
                temp_path.unlink(missing_ok=True)
            except OSError:
                logger.debug(
                    "Failed to remove OpenViking cursor temp file: %s",
                    temp_path,
                    exc_info=True,
                )

    def _handle_write_error(
        self,
        exc: Exception,
        message: str,
        session_id: str,
    ) -> None:
        detail = f"{message} (session={session_id})"
        if self._config.write_failure_policy == "raise":
            raise MemoryManagerError(detail) from exc
        logger.error(detail, exc_info=True)


def _load_official_integration() -> dict[str, Any]:
    try:
        from langchain_openviking import (
            OpenVikingCommitPolicy,
            OpenVikingPartialWriteError,
            OpenVikingRetriever,
            OpenVikingSessionRecorder,
            has_request_actor_peer_support,
        )
        from langchain_openviking.actor_peer import use_actor_peer
    except ImportError as exc:
        raise ImportError("The OpenViking memory backend requires langchain-openviking==0.1.0. Install DeerFlow backend dependencies and retry.") from exc
    if not has_request_actor_peer_support():
        raise ImportError("The installed OpenViking SDK lacks request-scoped actor-peer support. Install openviking-sdk>=0.1.6,<0.2 and retry.")
    return {

View on GitHub (pinned to 1dd6ba1acb)

Solutions

  1. Check the chained original exception (raise ... from exc) and Gateway logs — the root cause is transport/service-side, not this wrapper
  2. Verify the OpenViking service health and base_url/api_key, then retry the conversation turn; the cursor ensures already-captured messages are not replayed
  3. If capture failures should not break turns, set memory.backend_config.failure_policy.write: log_and_drop

Example fix

# before (config.yaml): capture failures abort turns
memory:
  backend_config:
    failure_policy:
      write: raise

# after: log and continue
memory:
  backend_config:
    failure_policy:
      write: log_and_drop
Defensive patterns

Strategy: try-catch

Try / catch

from deerflow.agents.memory.manager import MemoryManagerError
try:
    manager.add(thread_id, messages, user_id=user)
except MemoryManagerError as exc:
    logger.error("OpenViking capture failed: %s", exc, exc_info=exc.__cause__)
    # cursor state is preserved; retrying the turn is safe (no duplicate replay)

Prevention

When it happens

Trigger: Any exception during _capture_locked/recorder commit — OpenViking service 5xx, network timeout, OpenVikingPartialWriteError — on a session where write_failure_policy='raise'. The raised MemoryManagerError carries the session_id for correlation.

Common situations: OpenViking outage mid-conversation while running with write: raise to make capture failures visible; the default config only logs, so operators typically first see this as an ERROR log line with the same text.

Related errors


AI-assisted analysis of bytedance/deer-flow@1dd6ba1acb (2026-08-14). Data as JSON: /api/errors/ad16770bc522d69a. Report an issue: GitHub.