{"record":{"id":"b3e8ba8cc25f8f74","repo":"TencentCloud/TencentDB-Agent-Memory","slug":"offload-client-ingestl15-returned-response-sta","errorCode":null,"errorMessage":"[offload-client] ingestL15 returned ${response.status}","messagePattern":"\\[offload-client\\] ingestL15 returned (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"MemoryCore/src/offload-client/offload-api-client.ts","lineNumber":110,"sourceCode":"    };\n    if (recentMessages && recentMessages.length > 0) payload.recent_messages = recentMessages;\n    const body = JSON.stringify(payload);\n\n    try {\n      const controller = new AbortController();\n      const timer = setTimeout(() => controller.abort(), this.config.ingestTimeoutMs);\n\n      const response = await fetch(url, {\n        method: \"POST\",\n        headers: this.buildHeaders(),\n        body,\n        signal: controller.signal,\n      });\n\n      clearTimeout(timer);\n\n      if (!response.ok) {\n        this.logger.warn(`[offload-client] ingestL15 returned ${response.status}`);\n      }\n    } catch (err) {\n      this.logger.warn(`[offload-client] ingestL15 failed: ${err}`);\n    }\n  }\n\n  /**\n   * Synchronous compaction call. Returns compressed messages + report.\n   * Returns null on timeout/failure (caller should keep original messages).\n   */\n  async compaction(req: {\n    sessionId: string;\n    messages: any[];\n    ratio: number;\n    contextWindow: number;\n    totalTokens: number;\n    messageTokens?: number[];\n  }): Promise<CompactionResult | null> {","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/3efcd317b84146d6a08518ac0f7ee7c8a8d200ec/MemoryCore/src/offload-client/offload-api-client.ts#L92-L128","documentation":"OffloadApiClient.ingestL15 is a fire-and-forget call that POSTs prompt + recent messages to the Offload Server v2 /v2/offload/ingest endpoint to trigger the L1.5 task-judgment path. It never throws; when the server responds with a non-2xx status the client only logs this warning so the agent conversation can continue without memory offload. The warning means the server was reached (an HTTP response came back) but rejected or failed the request.","triggerScenarios":"ingestL15() is called and fetch() completes but response.ok is false — e.g. the server returns 401/403 for a bad or missing apiKey, 404 because serverUrl points at a wrong path or older server version without /v2/offload/ingest, 413 for an oversized prompt/recentMessages payload, or 5xx from a server-side error. Also triggered when the AbortController fires (ingestTimeoutMs exceeded), though that path logs the catch-branch message instead.","commonSituations":"Offload server not yet deployed or running an older API version; misconfigured serverUrl (wrong port or trailing path); stale or rotated API key / service ID (X-TDAI-Service-Id) after environment changes; server restarted or overloaded returning 502/503; very long prompts pushing the payload past server limits.","solutions":["Check the logged status code: 401/403 → fix OffloadClientConfig.apiKey and serviceId; 404 → verify serverUrl points to the Offload Server v2 root; 5xx → inspect server logs.","Call checkHealth() first (GET /v2/offload/health) to confirm the server is reachable and the URL is correct.","Verify the Offload Server is v2 and running at the configured serverUrl (curl the health endpoint manually).","If the payload may be large, trim prompt/recentMessages before calling ingestL15.","This is non-fatal by design — if offload is optional, you can safely ignore the warning and rely on local memory."],"exampleFix":"// before: fire-and-forget with no status surfaced to caller\nawait client.ingestL15(sessionId, prompt);\n// after: guard with a health check and log configuration context\nif (!(await client.checkHealth())) {\n  logger.warn(\"offload server unreachable, skipping L1.5 ingest\");\n} else {\n  await client.ingestL15(sessionId, prompt);\n}","handlingStrategy":"fallback","validationCode":"const health = await client.checkHealth();\nif (!health) logger.warn(\"offload server unreachable — L1.5 ingest will be skipped\");","typeGuard":null,"tryCatchPattern":"try {\n  await client.ingestL15(sessionId, prompt);\n} catch (err) {\n  // should not throw, but guard anyway\n  logger.warn(`ingestL15 skipped: ${err}`);\n}","preventionTips":["Run checkHealth() at plugin startup and gate offload calls on it.","Keep apiKey/serviceId in sync with the server via config validation on boot.","Pin serverUrl to the Offload Server v2 base URL and verify with a curl of /v2/offload/health after deploys.","Treat L1.5 ingest as best-effort; never let memory telemetry block the agent loop."],"tags":["http","network","fire-and-forget","offload-server"],"backgroundTag":"http-non-2xx-response","analyzedSha":"3efcd317b84146d6a08518ac0f7ee7c8a8d200ec","analyzedAt":"2026-09-01T05:44:22.276Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}