The open source coding agent.
TypeScript
fix: Tool calling on windows (#4234)
Luke Parker288bc88e40ef
diff --git a/packages/opencode/src/storage/storage.ts b/packages/opencode/src/storage/storage.tsindex cff7211ccb0..5d4f639431d 100644--- a/packages/opencode/src/storage/storage.ts+++ b/packages/opencode/src/storage/storage.ts@@ -170,7 +170,8 @@ export namespace Storage {const target = path.join(dir, ...key) + ".json"return withErrorHandling(async () => {using _ = await Lock.read(target)- return Bun.file(target).json() as Promise<T>+ const result = await Bun.file(target).json()+ return result as T})}@@ -178,7 +179,7 @@ export namespace Storage {const dir = await state().then((x) => x.dir)const target = path.join(dir, ...key) + ".json"return withErrorHandling(async () => {- using _ = await Lock.write("storage")+ using _ = await Lock.write(target)const content = await Bun.file(target).json()fn(content)await Bun.write(target, JSON.stringify(content, null, 2))@@ -190,7 +191,7 @@ export namespace Storage {const dir = await state().then((x) => x.dir)const target = path.join(dir, ...key) + ".json"return withErrorHandling(async () => {- using _ = await Lock.write("storage")+ using _ = await Lock.write(target)await Bun.write(target, JSON.stringify(content, null, 2))})}