thedotmack/claude-mem · warning

[claude-mem] Worker GET

Error message

[claude-mem] Worker GET ${path} returned ${response.status}

What it means

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.

Solutions

  1. Check the logged status code and the worker logs for the corresponding request
  2. Update the plugin and worker to matching versions so routes align
  3. Curl the endpoint manually to reproduce and inspect the error body
  4. Restart the worker if it is in a bad state

Example fix

// before
const text = await workerGetText('/api/old-endpoint'); // 404 after worker upgrade
// after
const text = await workerGetText('/api/current-endpoint'); // use current route
Defensive patterns

Strategy: retry

Validate before calling

const res = await fetch(`${WORKER_BASE_URL}/health`);
if (!res.ok) console.warn('worker not ready:', res.status);

Type guard

function isOk(res: Response): boolean { return res.ok; }

Try / catch

const res = await fetch(url);
if (!res.ok) {
  console.warn(`GET ${path} returned ${res.status}; retrying after backoff`);
  return null;
}

Prevention

When it happens

Trigger: 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.

Common situations: Plugin and worker version mismatch so the requested endpoint no longer exists; worker hitting internal errors (bad DB state); worker restarted with different routes.

Understand the failure class

Background: "API error: {status}" and "HTTP 401/403/404/429/5xx" errors: non-2xx HTTP responses explained — this error's family across 27 libraries.

Related errors


AI-assisted analysis of thedotmack/claude-mem@d8bc9755e7 (2026-09-17). Data as JSON: /api/errors/845ab53d56852636. Report an issue: GitHub.

Appendix: source

Thrown at src/integrations/opencode-plugin/index.ts:136

    method: "POST",
    headers: JSON_HEADERS,
    body: JSON.stringify({
      ...body,
      platformSource: normalizePlatformSource("opencode"),
    }),
  }).catch((error: unknown) => {
    const message = error instanceof Error ? error.message : String(error);
    if (!message.includes("ECONNREFUSED")) {
      console.warn(`[claude-mem] Worker POST ${path} failed: ${message}`);
    }
  });
}

async function workerGetText(path: string): Promise<string | null> {
  try {
    const response = await fetch(`${WORKER_BASE_URL}${path}`, { headers: JSON_HEADERS });
    if (!response.ok) {
      console.warn(`[claude-mem] Worker GET ${path} returned ${response.status}`);
      return null;
    }
    return await response.text();
  } catch (error: unknown) {
    const message = error instanceof Error ? error.message : String(error);
    if (!message.includes("ECONNREFUSED")) {
      console.warn(`[claude-mem] Worker GET ${path} failed: ${message}`);
    }
    return null;
  }
}

const contentSessionIdsByOpenCodeSessionId = new Map<string, string>();
const initializedSessionIds = new Set<string>();

const MAX_SESSION_MAP_ENTRIES = 1000;

function getOrCreateContentSessionId(openCodeSessionId: string): string {

View on GitHub (pinned to d8bc9755e7)