Repository navigation
Conversation
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Fixes anomalyco#16610 Related anomalyco#26842 Related anomalyco#23190 The file watcher initialization could fail in ways that made the entire TUI unresponsive or crash: - Effect.promise did not catch synchronous throws from @parcel/watcher's subscribe() call; Effect.tryPromise does - The .git watcher setup ran inside the main layer body, so any failure (git.dir timeout, subscribe timeout) killed the entire watcher service including the experimental root watcher; it is now isolated in its own forkScoped with an independent catchCause - The @parcel/watcher callback's error parameter was silently ignored; it is now logged - Unsubscribe errors during cleanup could cause unhandled rejections; they are now suppressed - The outer catchCause log message now includes the directory and explains the consequence (watcher disabled) Reproduction: OpenCode 1.17.8 / Bun 1.3.14 in a Linux dev container with overlayfs crashes with exit code 132 (SIGILL) and Bun panic 'Segmentation fault at address 0x0' when run inside a Git repo. OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER=true avoids the crash.
sailod
force-pushed
the
fix/file-watcher-startup-fallback
branch
from
June 18, 2026 15:20
74f0231 to
b0d6ef6
Compare
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Author
|
Closing this PR — after deeper investigation into We're systematically reproducing the crash to isolate the exact failure point and will open a new PR with the correct fix once the root cause is confirmed. |
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.
Issue for this PR
Closes #16610
Related #26842, #23190
Type of change
What does this PR do?
The file watcher initialization could fail in ways that made the entire TUI crash or hang. This PR makes the watcher non-fatal — if watcher setup fails, OpenCode logs a warning and continues running without file watching.
Changes in
packages/core/src/filesystem/watcher.ts:Effect.promise→Effect.tryPromise— catches synchronous throws from native@parcel/watcher'ssubscribe(), not just promise rejections.gitwatcher into its ownforkScopedwithcatchCause— a git watcher failure no longer kills the entire watcher service; only git HEAD tracking is lost@parcel/watchercallback signature is(error, events), errors were silently ignored, now loggedcatchCauselogging — message explains the consequence ("watcher disabled: initialization failed, continuing without file watching")unsubscribe()errors — prevents unhandled rejections during cleanupHow did you verify your code works?
bun test test/filesystem/watcher.test.ts)bun test test/filesystem/)bunx tsgo --noEmit)Effect.tryPromiseandEffect.logWarningare used elsewhere in the codebase@parcel/watchernative binding loads and subscribes successfullyOPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER=true opencodeavoids the crashScreenshots / recordings
N/A — no UI changes
Checklist