summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDax <[email protected]>2026-02-18 18:09:45 -0500
committerGitHub <[email protected]>2026-02-18 18:09:45 -0500
commitae398539c5de6f0dea245807f9a58c8126acc29f (patch)
treec031633c9b1e57766127961d47da9a20b957865e
parent359360ad86e34db9074d9ef1281682206615d9cc (diff)
downloadopencode-ae398539c5de6f0dea245807f9a58c8126acc29f.tar.gz
opencode-ae398539c5de6f0dea245807f9a58c8126acc29f.zip
refactor: migrate src/session/instruction.ts from Bun.file() to Filesystem module (#14130)
-rw-r--r--packages/opencode/src/session/instruction.ts12
1 files changed, 4 insertions, 8 deletions
diff --git a/packages/opencode/src/session/instruction.ts b/packages/opencode/src/session/instruction.ts
index 6fb2a7aeb..d65ada278 100644
--- a/packages/opencode/src/session/instruction.ts
+++ b/packages/opencode/src/session/instruction.ts
@@ -85,7 +85,7 @@ export namespace InstructionPrompt {
}
for (const file of globalFiles()) {
- if (await Bun.file(file).exists()) {
+ if (await Filesystem.exists(file)) {
paths.add(path.resolve(file))
break
}
@@ -120,9 +120,7 @@ export namespace InstructionPrompt {
const paths = await systemPaths()
const files = Array.from(paths).map(async (p) => {
- const content = await Bun.file(p)
- .text()
- .catch(() => "")
+ const content = await Filesystem.readText(p).catch(() => "")
return content ? "Instructions from: " + p + "\n" + content : ""
})
@@ -164,7 +162,7 @@ export namespace InstructionPrompt {
export async function find(dir: string) {
for (const file of FILES) {
const filepath = path.resolve(path.join(dir, file))
- if (await Bun.file(filepath).exists()) return filepath
+ if (await Filesystem.exists(filepath)) return filepath
}
}
@@ -182,9 +180,7 @@ export namespace InstructionPrompt {
if (found && found !== target && !system.has(found) && !already.has(found) && !isClaimed(messageID, found)) {
claim(messageID, found)
- const content = await Bun.file(found)
- .text()
- .catch(() => undefined)
+ const content = await Filesystem.readText(found).catch(() => undefined)
if (content) {
results.push({ filepath: found, content: "Instructions from: " + found + "\n" + content })
}