fix: restore recent test regressions and upgrade effect beta (#18158)

This commit is contained in:
Luke Parker
2026-03-19 09:54:01 +10:00
committed by GitHub
parent 81be544981
commit 5d2f8d77f9
11 changed files with 79 additions and 46 deletions

View File

@@ -51,6 +51,13 @@ export namespace FileWatcher {
if (process.platform === "linux") return "inotify"
}
function protecteds(dir: string) {
return Protected.paths().filter((item) => {
const rel = path.relative(dir, item)
return rel !== "" && !rel.startsWith("..") && !path.isAbsolute(rel)
})
}
export const hasNativeBinding = () => !!watcher()
export class Service extends ServiceMap.Service<Service, {}>()("@opencode/FileWatcher") {}
@@ -105,7 +112,7 @@ export namespace FileWatcher {
const cfgIgnores = cfg.watcher?.ignore ?? []
if (yield* Flag.OPENCODE_EXPERIMENTAL_FILEWATCHER) {
yield* subscribe(instance.directory, [...FileIgnore.PATTERNS, ...cfgIgnores, ...Protected.paths()])
yield* subscribe(instance.directory, [...FileIgnore.PATTERNS, ...cfgIgnores, ...protecteds(instance.directory)])
}
if (instance.project.vcs === "git") {

View File

@@ -98,6 +98,7 @@ export namespace Process {
reject(error)
})
})
void exited.catch(() => undefined)
if (opts.abort) {
opts.abort.addEventListener("abort", abort, { once: true })