{"record":{"id":"a45888342182f2f3","repo":"bytedance/deer-flow","slug":"agents-api-enabled","errorCode":"agents_api.enabled","errorMessage":"err.detail","messagePattern":"err\\.detail","errorType":"exception","errorClass":"AgentsApiDisabledError","httpStatus":null,"severity":"error","filePath":"frontend/src/core/agents/api.ts","lineNumber":61,"sourceCode":"  return data.agents;\n}\n\nexport async function getAgent(name: string): Promise<Agent> {\n  const res = await fetch(`${getBackendBaseURL()}/api/agents/${name}`);\n  if (!res.ok) throw new Error(`Agent '${name}' not found`);\n  return res.json() as Promise<Agent>;\n}\n\nexport async function createAgent(request: CreateAgentRequest): Promise<Agent> {\n  const res = await fetch(`${getBackendBaseURL()}/api/agents`, {\n    method: \"POST\",\n    headers: { \"Content-Type\": \"application/json\" },\n    body: JSON.stringify(request),\n  });\n  if (!res.ok) {\n    const err = (await res.json().catch(() => ({}))) as { detail?: string };\n    if (isAgentsApiDisabledDetail(err.detail)) {\n      throw new AgentsApiDisabledError(err.detail!);\n    }\n    throw new Error(err.detail ?? `Failed to create agent: ${res.statusText}`);\n  }\n  return res.json() as Promise<Agent>;\n}\n\nexport async function updateAgent(\n  name: string,\n  request: UpdateAgentRequest,\n): Promise<Agent> {\n  const res = await fetch(`${getBackendBaseURL()}/api/agents/${name}`, {\n    method: \"PUT\",\n    headers: { \"Content-Type\": \"application/json\" },\n    body: JSON.stringify(request),\n  });\n  if (!res.ok) {\n    const err = (await res.json().catch(() => ({}))) as { detail?: string };\n    throw new Error(err.detail ?? `Failed to update agent: ${res.statusText}`);","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/bytedance/deer-flow/blob/1dd6ba1acb03700589994b0366c5d1c7d05e2eff/frontend/src/core/agents/api.ts#L43-L79","documentation":"Wrapped MemoryManagerError raised by Mem0Manager._read_or_fallback when a memory read raises Mem0APIError and the configured read_policy is not fail_open. The underlying cause (network failure, timeout, 4xx/5xx from the mem0 service) is chained via 'from e' and its text is embedded in the message.","triggerScenarios":"Any memory read path (searching memories for the current thread) while the mem0 service is unreachable, returns an error status, or times out, combined with read_policy: raise. With read_policy: fail_open the same failure only logs a warning and returns the fallback value instead.","commonSituations":"mem0 cloud incident or expired API key surfacing as 401; local mem0 container restarting mid-conversation; timeout_seconds too small for slow searches; operator chose read_policy: raise to make memory mandatory and then the network blips.","solutions":["Inspect the chained Mem0APIError text and fix the underlying cause (reachability, API key, service health).","If the agent should keep answering without memory during outages, set read_policy: fail_open so reads degrade to a logged fallback.","Increase timeout_seconds if the chained error indicates a timeout."],"exampleFix":"# before\nbackend_config:\n  read_policy: raise\n\n# after\nbackend_config:\n  read_policy: fail_open  # log warning, continue without memory","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"from deerflow.agents.memory.backends.mem0.mem0_manager import MemoryManagerError\n\ntry:\n    memories = manager.search(thread_id, query)\nexcept MemoryManagerError as e:\n    if 'mem0 read failed' in str(e):\n        logger.warning('memory unavailable, proceeding without it: %s', e)\n        memories = []\n    else:\n        raise","preventionTips":["Choose read_policy: fail_open unless memory is strictly required for correctness; it converts this error into a logged fallback.","Monitor mem0 reachability with a health probe so outages are visible before user-visible degradation.","Set timeout_seconds to a realistic value relative to your mem0 latency."],"tags":["mem0","runtime","network","failure-policy","memory"],"backgroundTag":null,"analyzedSha":"1dd6ba1acb03700589994b0366c5d1c7d05e2eff","analyzedAt":"2026-08-14T21:20:34.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}