Convert LoadInput.init to Effect + extract InstanceBootstrap as a Service (#25376)

This commit is contained in:
Kit Langton
2026-05-02 00:02:52 -04:00
committed by GitHub
parent 832c5343ec
commit a2bee5a71a
21 changed files with 223 additions and 153 deletions
+3 -3
View File
@@ -6,7 +6,7 @@ import * as Tool from "./tool"
import path from "path"
import DESCRIPTION from "./bash.txt"
import * as Log from "@opencode-ai/core/util/log"
import { Instance, type InstanceContext } from "../project/instance"
import { containsPath, type InstanceContext } from "../project/instance-context"
import { lazy } from "@/util/lazy"
import { Language, type Node } from "web-tree-sitter"
@@ -386,7 +386,7 @@ export const BashTool = Tool.define(
for (const arg of pathArgs(command, ps)) {
const resolved = yield* argPath(arg, cwd, ps, shell)
log.info("resolved path", { arg, resolved })
if (!resolved || Instance.containsPath(resolved, instance)) continue
if (!resolved || containsPath(resolved, instance)) continue
const dir = (yield* fs.isDir(resolved)) ? resolved : path.dirname(resolved)
scan.dirs.add(dir)
}
@@ -612,7 +612,7 @@ export const BashTool = Tool.define(
Effect.sync(() => tree.delete()),
)
const scan = yield* collect(tree.rootNode, cwd, ps, shell, executeInstance)
if (!Instance.containsPath(cwd, executeInstance)) scan.dirs.add(cwd)
if (!containsPath(cwd, executeInstance)) scan.dirs.add(cwd)
yield* ask(ctx, scan)
}),
)