From f5a1ef5b9447ac7afe3d3f77df513f4cd59c7dd0 Mon Sep 17 00:00:00 2001 From: Xiaohan-Tian Date: Fri, 15 May 2026 12:30:12 -0700 Subject: [PATCH] fix: failed tests --- src/agent/core/SystemPrompts.ts | 2 +- src/util/opfsModelCache.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/agent/core/SystemPrompts.ts b/src/agent/core/SystemPrompts.ts index 9f4e80d..ad292da 100644 --- a/src/agent/core/SystemPrompts.ts +++ b/src/agent/core/SystemPrompts.ts @@ -262,6 +262,6 @@ export class SystemPrompts { * Clear the cached template (useful for development/testing) */ static clearCache(): void { - this.cachedTemplate = null; + this.cachedTemplates.clear(); } } diff --git a/src/util/opfsModelCache.ts b/src/util/opfsModelCache.ts index 6d37198..1b6202e 100644 --- a/src/util/opfsModelCache.ts +++ b/src/util/opfsModelCache.ts @@ -123,13 +123,14 @@ export class OpfsModelCache { const finalWritable = await finalHandle.createWritable(); try { const tempFile = await tempHandle.getFile(); + const tempBuffer = await tempFile.arrayBuffer(); console.log('[opfsModelCache] Temp file ready for finalize copy.', { filename, tempFilename, tempSize: tempFile.size, expectedSize: sizeValue, }); - await finalWritable.write(tempFile); + await finalWritable.write(tempBuffer); await finalWritable.close(); } catch (error) { await finalWritable.abort();