{"record":{"id":"845ab53d56852636","repo":"thedotmack/claude-mem","slug":"claude-mem-worker-get-path-returned-respons","errorCode":null,"errorMessage":"[claude-mem] Worker GET ${path} returned ${response.status}","messagePattern":"\\[claude-mem\\] Worker GET (.+?) returned (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/integrations/opencode-plugin/index.ts","lineNumber":136,"sourceCode":"    method: \"POST\",\n    headers: JSON_HEADERS,\n    body: JSON.stringify({\n      ...body,\n      platformSource: normalizePlatformSource(\"opencode\"),\n    }),\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 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 {","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/d8bc9755e74915e5c3b999181e10a67c889bce2a/src/integrations/opencode-plugin/index.ts#L118-L154","documentation":"workerGetText performs a GET against the claude-mem worker and expects an OK response; when response.ok is false it logs this warning with the HTTP status and returns null, signaling callers to treat the data as unavailable.","triggerScenarios":"The worker responds with a non-2xx status to GET `${WORKER_BASE_URL}${path}`: 404 for an unknown route (version mismatch), 500 for a backend failure, 401/403 for auth issues.","commonSituations":"Plugin and worker version mismatch so the requested endpoint no longer exists; worker hitting internal errors (bad DB state); worker restarted with different routes.","solutions":["Check the logged status code and the worker logs for the corresponding request","Update the plugin and worker to matching versions so routes align","Curl the endpoint manually to reproduce and inspect the error body","Restart the worker if it is in a bad state"],"exampleFix":"// before\nconst text = await workerGetText('/api/old-endpoint'); // 404 after worker upgrade\n// after\nconst text = await workerGetText('/api/current-endpoint'); // use current route","handlingStrategy":"retry","validationCode":"const res = await fetch(`${WORKER_BASE_URL}/health`);\nif (!res.ok) console.warn('worker not ready:', res.status);","typeGuard":"function isOk(res: Response): boolean { return res.ok; }","tryCatchPattern":"const res = await fetch(url);\nif (!res.ok) {\n  console.warn(`GET ${path} returned ${res.status}; retrying after backoff`);\n  return null;\n}","preventionTips":["Keep plugin and worker versions in sync","Monitor worker logs for 4xx/5xx responses","Retry transient 5xx with backoff"],"tags":["http","worker","http-status","fetch"],"backgroundTag":"http-error-response","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"}