Repository navigation
Description
Summary
On Windows, the OpenCode Desktop sidecar process crashes with exit code 3221226505 (0xC0000409, STATUS_STACK_BUFFER_OVERRUN), taking the local server offline and making the conversation unresponsive. Forensic analysis of the Windows minidump points the crash at the bundled native file-watcher module @parcel/watcher-win32-x64\watcher.node. The crash is triggered when the watcher's glob/regex engine processes very long filesystem paths, matching the known upstream bug parcel-bundler/watcher#250.
This looks like the same crash class as #29033 (open) and #28413 (closed) — both report the identical exit code on Windows, but neither pinpointed the underlying module. This report adds the minidump-confirmed root cause and the upstream link.
Environment
- OpenCode version: Desktop v1.17.7 (Windows x64)
- Operating System: Windows 11 (10.0.26100)
- Terminal: desktop
- The crash is not model-specific — it was observed across multiple models. The trigger is the filesystem path, not the AI model.
Symptoms
| Symptom | Detail |
|---|---|
| UI | Local server disconnects; conversation becomes unresponsive |
| Sidecar exit code | 3221226505 (0xC0000409, STATUS_STACK_BUFFER_OVERRUN) |
| Logs | sidecar exited { code: 3221226505 } |
| Reproducibility | Deterministic when long paths are written inside the watched workspace |
Root cause (minidump evidence)
A Windows crash dump is generated under:
%APPDATA%\ai.opencode.desktop\Crashpad\reports\
Key facts from the dump:
| Field | Value |
|---|---|
| Exception code | 0xe0000008 (fast-fail / stack-buffer-overrun family) |
| Exception location | inside KERNELBASE.dll |
| Loaded native module | @parcel\watcher-win32-x64\watcher.node |
The stack overflow originates in the watcher's native code — not in the Node application logic or in user scripts. It matches the known upstream issue:
Stack overflow crash (
STATUS_STACK_BUFFER_OVERRUN/0xC0000409) instd::regex_matchon long paths when using a glob ignore option —parcel-bundler/watcher#250
@parcel/watcher applies std::regex_match to filesystem paths; with sufficiently long input strings the regex engine consumes enough stack space to trip the compiler /GS buffer-security check. The crash is therefore path-length dependent.
Steps to reproduce
Warning: this will disconnect the OpenCode session. Run only in a disposable workspace.
Create a file with a very long basename inside a directory that OpenCode is watching:
$dir = "C:\some\watched\workspace"
$long = "VERY_LONG_BASENAME_" + ("x" * 200) + "_20260101T000000Z.txt"
Set-Content -Path (Join-Path $dir $long) -Value "test"A deep directory hierarchy combined with a very long basename (total path well beyond 260 characters) reliably trips the watcher's regex engine and crashes the sidecar within seconds.
Why it can look model-dependent
Sessions that happen to create long paths crash; sessions that don't, never see it. This creates a false correlation between the crash and a specific model. The real variable is path length, not the model.
Recommendations
- Upgrade or replace
@parcel/watcherto a release that resolvesparcel-bundler/watcher#250. - Bound/normalize path length before passing paths to the watcher's glob-ignore matching, if upgrading isn't immediately possible.
- Add a config toggle to disable file watching for users running file-intensive tasks.
- Graceful degradation: when the sidecar crashes, preserve conversation state and allow reconnection without losing context.
- Long-path testing: exercise the bundled native watcher with paths > 260 characters on Windows.
Workaround (user-side)
- Keep workspace file/directory basenames short.
- Do file-intensive/intermediate work outside the watched workspace, then copy only short-named final artifacts into it.
- Avoid printing long recursive path listings that the watcher may then process.
Related
- Sidecar crashes with STATUS_STACK_BUFFER_OVERRUN (0xC0000409) on Windows with CJK paths #29033 (open) — same exit code /
STATUS_STACK_BUFFER_OVERRUNon Windows, root cause not identified - [Bug] Sidecar crashes with exit code 3221226505 (0xC0000409) on Windows - causes local server to go offline #28413 (closed, not planned) — same exit code
3221226505
Activity
github-actions commentedon Jun 15, 2026
This issue might be a duplicate of existing issues. Please check:
STATUS_STACK_BUFFER_OVERRUN(0xC0000409) sidecar crash on Windows, also attributed to long/complex paths and the file watcher — open and actively tracked3221226505on Windows (closed, marked not planned)Your report adds valuable minidump-confirmed root cause analysis pointing to
@parcel/watcher'sstd::regex_match, which may help move #29033 forward. Consider whether this is best added as a comment to #29033 rather than a separate issue, or ask a maintainer to link/merge them.github-actions commentedon Aug 15, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.