fix: failed tests

This commit is contained in:
Xiaohan-Tian
2026-05-15 12:30:12 -07:00
parent ac2d924711
commit f5a1ef5b94
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -262,6 +262,6 @@ export class SystemPrompts {
* Clear the cached template (useful for development/testing) * Clear the cached template (useful for development/testing)
*/ */
static clearCache(): void { static clearCache(): void {
this.cachedTemplate = null; this.cachedTemplates.clear();
} }
} }
+2 -1
View File
@@ -123,13 +123,14 @@ export class OpfsModelCache {
const finalWritable = await finalHandle.createWritable(); const finalWritable = await finalHandle.createWritable();
try { try {
const tempFile = await tempHandle.getFile(); const tempFile = await tempHandle.getFile();
const tempBuffer = await tempFile.arrayBuffer();
console.log('[opfsModelCache] Temp file ready for finalize copy.', { console.log('[opfsModelCache] Temp file ready for finalize copy.', {
filename, filename,
tempFilename, tempFilename,
tempSize: tempFile.size, tempSize: tempFile.size,
expectedSize: sizeValue, expectedSize: sizeValue,
}); });
await finalWritable.write(tempFile); await finalWritable.write(tempBuffer);
await finalWritable.close(); await finalWritable.close();
} catch (error) { } catch (error) {
await finalWritable.abort(); await finalWritable.abort();