summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLuke Parker <[email protected]>2025-11-13 09:47:39 +1000
committerGitHub <[email protected]>2025-11-12 17:47:39 -0600
commit288bc88e40ef69f0c018aa653a04cbb868f7a95b (patch)
tree0bdefca21fa53ee6215f20218c3a105bbcdc3ad2
parent6d36dbf9de5ea75035c7dca41fcfda5e69a6fd05 (diff)
downloadopencode-288bc88e40ef69f0c018aa653a04cbb868f7a95b.tar.gz
opencode-288bc88e40ef69f0c018aa653a04cbb868f7a95b.zip
fix: Tool calling on windows (#4234)
-rw-r--r--packages/opencode/src/storage/storage.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/opencode/src/storage/storage.ts b/packages/opencode/src/storage/storage.ts
index cff7211cc..5d4f63943 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))
})
}