fix(core): skip fff for aggregate locations (#36437)

This commit is contained in:
Kit Langton 2026-07-11 13:47:41 -04:00 committed by GitHub
parent 00ab94c44f
commit c7ceccf869
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -230,6 +230,13 @@ export const fffLayer = Layer.effect(
}),
)
const layer = Layer.unwrap(Effect.sync(() => (Flag.OPENCODE_DISABLE_FFF || !Fff.available() ? ripgrepLayer : fffLayer)))
const layer = Layer.unwrap(
Effect.gen(function* () {
if (Flag.OPENCODE_DISABLE_FFF || !Fff.available()) return ripgrepLayer
const location = yield* Location.Service
// Non-VCS locations can contain many repositories, so avoid eagerly content-indexing the entire aggregate tree.
return location.vcs ? fffLayer : ripgrepLayer
}),
)
export const node = makeLocationNode({ service: Service, layer, deps: [FSUtil.node, Location.node, Ripgrep.node] })