Repository navigation
fix: disable FFF background scans in managed OpenCode engines - #298
Merged
Merged
Conversation
Signed-off-by: Johann Machemer <[email protected]>
johannmachemer
force-pushed
the
codex/disable-fff-background-reads
branch
from
October 20, 2026 07:36
238b157 to
bbf1831
Compare
johannmachemer
enabled auto-merge (squash)
October 20, 2026 07:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
An ordinary chat can make the bundled OpenCode engine read project files while FFF initializes, even when the agent calls no tools. On OneDrive this can trigger unwanted downloads.
Set
OPENCODE_DISABLE_FFF=truefor LegalWork-managed engines: desktop/embedded server, standalone server, host orchestrator, and container orchestrator. Keep the reported execution environment consistent with the child process.Why
FFF is an optional backend for OpenCode's filesystem-search service. Filename/folder suggestions retain its existing ripgrep + fuzzy-search fallback. The agent's built-in
globandgreptools already use ripgrep directly; explicitreadalso works without FFF.Issue
Related upstream reports: FFF automatically downloading OneDrive files, OpenCode scanning OneDrive at startup.
Scope
glob,grep, andreadcalls.Out of scope
Explicit agent content reads/searches, Git snapshots, and LegalWork's separate document-content search/sync can still read files. Externally managed OpenCode servers are outside this launch policy.
Testing
Ran
Set
LEGALWORK_TEST_OPENCODE_BINto the bundled OpenCode 1.18.29 executable for engine tests.pnpm --filter legalwork-server exec bun test src/managed-opencode.test.ts src/managed-opencode.search.e2e.test.ts src/embedded.test.ts— 7 passed, 33 assertions.pnpm exec bun test --preload ./apps/server/test-preload.ts --timeout 180000 apps/server/src/scheduled-tasks/engine.test.ts apps/server/src/managed-opencode.search.e2e.test.ts— 2 passed, 109 assertions.pnpm --filter legalwork-server exec node node_modules/typescript/bin/tsc -p tsconfig.json --noEmit— passed.pnpm --filter legalwork-orchestrator exec node node_modules/typescript/bin/tsc -p tsconfig.typecheck.json— passed.git diff --check— passed.Result
The process regression failed before the fix: the child inherited
OPENCODE_DISABLE_FFF=false. It passes after the fix and verifies the execution details report the effective value.Native read tracing with synthetic fixtures:
The trace is not exhaustive for native child-process grep reads; no zero-read claim is made for content search.
CI status
Pending GitHub checks at PR creation. Local checks above passed.
Manual verification
OPENCODE_DISABLE_FFF=true.@followed by a filename or folder name; suggestions should still appear.Evidence
The native read trace and engine integration checks above cover background file access. No UI video/screenshot was captured because the behavior is background I/O. Windows OneDrive placeholder hydration has not been tested; the reproduced fix is removal of FFF's automatic content reads on macOS.
Risk
Filename ranking/performance may differ with the fallback. Existing engine processes need a restart for the launch policy to take effect.
Rollback
Revert this commit to restore FFF initialization.
Contribution rights
DCO sign-off included. No third-party source code copied and no new dependencies added.