{"record":{"id":"b6fc36d293cee96c","repo":"deepseek-ai/deepseek-harness","slug":"result-error-code-result-error-message","errorCode":null,"errorMessage":"${result.error.code}: ${result.error.message}","messagePattern":"\\$\\{result\\.error\\.code\\}: \\$\\{result\\.error\\.message\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/client/ui-conversation/src/client/service.ts","lineNumber":246,"sourceCode":"  /**\n   * Resolve and cache one session-authorized historical image URL.\n   * @param sessionId - owning session authorization scope.\n   * @param attachment - durable image reference.\n   * @returns browser URL valid until its rendered session is released.\n   */\n  resolveImage(sessionId: SessionId, attachment: ImageAttachmentRef): Promise<string> {\n    if (this.disposed) return Promise.reject(new Error('conversation.resolveImage: service is disposed'))\n    const key = `${sessionId}:${attachment.attachmentId}`\n    const cached = this.imageUrls.get(key)\n    if (cached !== undefined) return cached.pending\n    const generation = this.imageGenerations.get(sessionId) ?? 0\n    const session = this.requireSessions().binding(sessionId)?.session\n    if (session === undefined) {\n      return Promise.reject(new Error(`conversation.resolveImage: unknown session \"${sessionId}\"`))\n    }\n    const pending = session.readAttachment(attachment.attachmentId)\n      .then((result) => {\n        if (!result.ok) throw new Error(`${result.error.code}: ${result.error.message}`)\n        if (this.disposed) throw new Error('conversation.resolveImage: service was disposed before loading completed')\n        if ((this.imageGenerations.get(sessionId) ?? 0) !== generation) {\n          throw new Error('historical image scope was released before loading completed')\n        }\n        if (typeof URL.createObjectURL !== 'function') {\n          return `data:${result.value.attachment.mediaType};base64,${bytesToBase64(result.value.data)}`\n        }\n        const bytes = Uint8Array.from(result.value.data)\n        const url = URL.createObjectURL(new Blob([bytes.buffer], { type: result.value.attachment.mediaType }))\n        this.createdImageUrls.add(url)\n        return url\n      })\n      .catch((error: unknown) => {\n        if (this.imageUrls.get(key)?.generation === generation) this.imageUrls.delete(key)\n        throw error\n      })\n    this.imageUrls.set(key, { sessionId, generation, pending })\n    return pending","sourceCodeStart":228,"sourceCodeEnd":264,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/client/ui-conversation/src/client/service.ts#L228-L264","documentation":"resolveImage() loads one historical, session-authorized image via session.readAttachment and caches the resulting object URL. A non-ok readAttachment result throws the bare '<code>: <message>' — note the sibling guards in the same chain carry the conversation.resolveImage prefix (unknown session, disposed service, released generation scope); this arm is the host-side read failure itself.","triggerScenarios":"Rendering an old transcript image whose attachmentId the host no longer serves (pruned session log or retention window), an authorization scope that does not cover the attachment, or a transport error during the read.","commonSituations":"Scrolling deep history past the host's retention; a reconnect landing on a different session generation; the attachment deleted or re-keyed server-side.","solutions":["Retry once after a reconnect for transient transport codes","Treat persistent not-found codes as a broken image and render a placeholder instead of failing the transcript","Verify the attachmentId comes from the current session event stream rather than a stale cache"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"let url: string\ntry {\n  url = await service.resolveImage(sessionId, ref)\n} catch {\n  url = PLACEHOLDER_URL // broken-image affordance instead of a failed transcript\n}","preventionTips":["Cache resolved URLs per session and attachmentId so a dead attachment is probed once","Bind resolution to the live session generation and abandon loads for released scopes"],"tags":["rpc","images","attachments","history"],"backgroundTag":"attachment-not-found","analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}