{"record":{"id":"b6f4215b9d6118d0","repo":"thedotmack/claude-mem","slug":"claude-mem-worker-get-path-failed-message","errorCode":null,"errorMessage":"[claude-mem] Worker GET ${path} failed: ${message}","messagePattern":"\\[claude-mem\\] Worker GET (.+?) failed: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/integrations/opencode-plugin/index.ts","lineNumber":143,"sourceCode":"    const message = error instanceof Error ? error.message : String(error);\n    if (!message.includes(\"ECONNREFUSED\")) {\n      console.warn(`[claude-mem] Worker POST ${path} failed: ${message}`);\n    }\n  });\n}\n\nasync function workerGetText(path: string): Promise<string | null> {\n  try {\n    const response = await fetch(`${WORKER_BASE_URL}${path}`, { headers: JSON_HEADERS });\n    if (!response.ok) {\n      console.warn(`[claude-mem] Worker GET ${path} returned ${response.status}`);\n      return null;\n    }\n    return await response.text();\n  } catch (error: unknown) {\n    const message = error instanceof Error ? error.message : String(error);\n    if (!message.includes(\"ECONNREFUSED\")) {\n      console.warn(`[claude-mem] Worker GET ${path} failed: ${message}`);\n    }\n    return null;\n  }\n}\n\nconst contentSessionIdsByOpenCodeSessionId = new Map<string, string>();\nconst initializedSessionIds = new Set<string>();\n\nconst MAX_SESSION_MAP_ENTRIES = 1000;\n\nfunction getOrCreateContentSessionId(openCodeSessionId: string): string {\n  if (!contentSessionIdsByOpenCodeSessionId.has(openCodeSessionId)) {\n    while (contentSessionIdsByOpenCodeSessionId.size >= MAX_SESSION_MAP_ENTRIES) {\n      const oldestKey = contentSessionIdsByOpenCodeSessionId.keys().next().value;\n      if (oldestKey !== undefined) {\n        contentSessionIdsByOpenCodeSessionId.delete(oldestKey);\n        initializedSessionIds.delete(oldestKey);\n      } else {","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/d8bc9755e74915e5c3b999181e10a67c889bce2a/src/integrations/opencode-plugin/index.ts#L125-L161","documentation":"workerGetText catches fetch rejections when GETting the claude-mem worker and logs this warning unless the error is ECONNREFUSED (worker not running, treated as normal). It returns null so callers fall back gracefully.","triggerScenarios":"The fetch call itself throws with a non-ECONNREFUSED error: DNS resolution failure, TLS handshake error, network timeout/abort, or a malformed URL causing fetch to reject.","commonSituations":"WORKER_BASE_URL hostname unresolvable; HTTPS configured against an HTTP-only worker (TLS error); transient network drop; firewall blocking the connection in an unexpected way (not plain refusal).","solutions":["Verify the worker is running and reachable at WORKER_BASE_URL","Check WORKER_BASE_URL scheme (http vs https) matches the worker's listener","Read the logged message for the specific network error and fix accordingly","Confirm DNS/proxy settings in the environment running the plugin"],"exampleFix":"// before\nconst WORKER_BASE_URL = \"https://127.0.0.1:37777\"; // TLS error: worker is plain HTTP\n// after\nconst WORKER_BASE_URL = \"http://127.0.0.1:37777\";","handlingStrategy":"fallback","validationCode":"try { new URL(`${WORKER_BASE_URL}${path}`); } catch { console.warn('invalid worker URL'); }","typeGuard":"function isFetchError(e: unknown): e is TypeError {\n  return e instanceof TypeError;\n}","tryCatchPattern":"try {\n  const text = await workerGetText(path);\n  if (text === null) {\n    // fall back to cached/local data\n  }\n} catch (e) {\n  console.warn('worker unreachable', e);\n}","preventionTips":["Match http/https scheme to the worker's actual listener","Ensure DNS/proxy settings are correct in the runtime environment","Design callers to tolerate null (worker optional)"],"tags":["http","worker","network","fetch"],"backgroundTag":"network-request-failed","analyzedSha":"d8bc9755e74915e5c3b999181e10a67c889bce2a","analyzedAt":"2026-09-17T16:40:26.182Z","contentChangedAt":"2026-09-17T16:40:26.182Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}