anomalyco / anomalyco/opencode
OpenCode Desktop crashes on Windows when workspace contains very long generated paths
@Hona is already working on this.
Since Sep 12, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
OpenCode Desktop crashes on Windows when workspace contains very long generated paths
Summary
OpenCode Desktop on Windows may intermittently lose its local backend/server when a workspace contains deeply nested, automatically generated files with very long absolute paths.
The visible symptom is that the OpenCode UI may remain open, but the local backend listening on 127.0.0.1:<dynamic-port> disappears.
During troubleshooting, the failing process was identified as an OpenCode utility process running as a Node service:
OpenCode.exe
--type=utility
--utility-sub-type=node.mojom.NodeService
A crash dump captured during reproduction showed:
Exception: E06D7363.?AVregex_error@std@@
Unhandled: C0000409
The affected workspace contained generated paths up to approximately 324 characters.
Moving the generated persistent data outside the OpenCode workspace stopped the crashes in subsequent validation tests.
Environment
- OS: Windows
- Application: OpenCode Desktop
- Container runtime: Docker Desktop
- Shell: Windows PowerShell
- Workspace: local Windows directory
- Workload involved:
- Docker Compose
- Python application
- HashiCorp Vault using the
filestorage backend
- OpenCode backend:
- local listener on
127.0.0.1 - dynamic TCP port
OpenCode.exe --type=utility --utility-sub-type=node.mojom.NodeService
- local listener on
No credentials, tokens, private keys, or production data are required to reproduce the issue.
Initial symptom
The problem initially appeared while OpenCode executed commands such as:
docker exec app-backend python /app/verify_service.py
and:
docker compose run ...
The OpenCode local backend would disappear during or shortly after some executions.
At first, the issue appeared related to Docker, TTY handling, PowerShell quoting, stdout/stderr streaming, Python, or the application itself.
Those possibilities were tested individually.
Isolation performed
The following operations worked correctly without crashing OpenCode:
echo TEST
docker ps
docker exec <container> echo TEST
docker exec <container> python --version
docker exec <container> python -c "print('OK')"
Python framework import
framework setup/initialization
client library initialization
authenticated API read
secret write
secret read
encryption operation
decryption operation
application key loading
The application tests also completed successfully.
This showed that the crash was not caused directly by:
- Docker CLI
docker exec- Python startup
- framework initialization
- network connectivity
- the secret-management API
- stdout/stderr volume
- the application roundtrip itself
The behavior was intermittent, which initially made the triggering condition difficult to identify.
Process-level evidence
The OpenCode process listening on the local dynamic port was identified using PowerShell:
$opids = (Get-Process OpenCode).Id
Get-NetTCPConnection -State Listen |
Where-Object { $opids -contains $_.OwningProcess } |
Select-Object LocalAddress, LocalPort, OwningProcess
The listener belonged to:
OpenCode.exe
--type=utility
--utility-sub-type=node.mojom.NodeService
When the issue occurred:
Main OpenCode process: UP
NodeService process: DOWN
Local listener: DOWN
The main desktop process remained running.
Exit status
A Win32_ProcessStopTrace event was used to capture the process termination.
Observed result:
ProcessName : OpenCode.exe
ExitStatus : 3221226505
Hexadecimal:
0xC0000409
This is a Windows fail-fast style termination status.
Crash dump evidence
Sysinternals ProcDump was attached to the OpenCode NodeService process.
Example command:
procdump.exe -accepteula -ma -e -t <PID> C:\Temp\OpenCodeDumps
When the issue reproduced, ProcDump reported:
Exception: E06D7363.?AVregex_error@std@@
Unhandled: C0000409
A full dump was successfully generated.
The std::regex_error immediately before the fail-fast termination became the most relevant diagnostic clue.
Workspace finding
The affected project contained persistent application data inside the workspace.
Example layout:
C:\Work\ExampleProject\
├── backend\
├── frontend\
├── config\
└── data\
└── service-data\
A Docker service used a bind mount similar to:
volumes:
- ./data/service-data:/service/data
The service generated deeply nested paths containing identifiers and metadata files.
Example pattern:
C:\Work\ExampleProject\data\service-data\
logical\
<generated-id>\
<generated-id>\
metadata\
<generated-name>
The longest paths found in the workspace were approximately:
324 characters
PowerShell was used to locate the longest paths:
Get-ChildItem "C:\Work\ExampleProject" -Recurse -Force -ErrorAction SilentlyContinue |
ForEach-Object {
[PSCustomObject]@{
Length = $_.FullName.Length
Path = $_.FullName
}
} |
Sort-Object Length -Descending |
Select-Object -First 20
The longest entries were all inside the generated persistent-data tree.
Important observation
Creating a normal file in the workspace did not reproduce the issue.
Creating a normal file inside the persistent-data directory also did not immediately reproduce it.
Therefore, this does not appear to be a generic "any filesystem change crashes OpenCode" problem.
The stronger correlation was with:
- deeply nested generated paths;
- long absolute path lengths;
- application-generated filesystem activity;
- a native
std::regex_error; - termination of the OpenCode NodeService.
Workaround / solution
The persistent generated data was moved outside the OpenCode workspace.
Before:
volumes:
- ./data/service-data:/service/data
After:
volumes:
- C:/ContainerData/ExampleProject/service-data:/service/data
The data was copied to the new location while the service was stopped.
Example workflow:
docker compose stop service
New-Item -ItemType Directory `
-Path "C:\ContainerData\ExampleProject\service-data" `
-Force
robocopy `
"C:\Work\ExampleProject\data\service-data" `
"C:\ContainerData\ExampleProject\service-data" `
/E /COPY:DAT /DCOPY:DAT /R:2 /W:1
Then the Docker Compose bind mount was changed to the external location and the service was restarted.
After validating the migrated data, the old generated directory was removed from the OpenCode workspace.
Validation after workaround
After moving the generated persistent data outside the workspace:
- the service started normally;
- previously stored data remained accessible;
- read/write operations succeeded;
- encryption/decryption verification succeeded;
- application-specific key loading succeeded;
- application tests passed;
- the previously problematic verification command completed successfully;
- the OpenCode
NodeServiceremained running during the validation.
Example application test result:
Found 5 test(s).
Ran 5 tests.
OK
Expected behavior
OpenCode should safely observe or ignore deeply nested and long filesystem paths without terminating its local NodeService.
A filesystem watcher error should not cause the entire local backend process to fail-fast.
Actual behavior
Under certain filesystem activity involving very long generated paths inside the workspace:
std::regex_error
is observed in the OpenCode NodeService process, followed by:
0xC0000409
The NodeService exits and the OpenCode local backend listener disappears.
Suspected root cause
The evidence suggests a bug in the native filesystem-watching/path-matching layer used by OpenCode Desktop on Windows.
The most relevant indicators are:
std::regex_errorimmediately before termination.- Fail-fast exit status
0xC0000409. - Only the OpenCode
NodeServiceterminates. - The issue is workspace-dependent.
- The workspace contained generated paths exceeding 300 characters.
- Moving the generated data outside the workspace stopped the observed crashes during subsequent validation.
This report does not claim that every long path will reproduce the crash.
The trigger appears intermittent and may depend on a particular filesystem-event pattern, path-matching expression, timing condition, or combination of those factors.
Suggested reproduction scenario
A minimal reproduction may be possible with:
- Open a local Windows directory in OpenCode Desktop.
- Generate a deeply nested directory tree inside the workspace.
- Include absolute paths exceeding 300 characters.
- Continuously create/update files under those paths.
- Execute normal shell commands through OpenCode while filesystem activity occurs.
- Monitor the OpenCode
NodeServiceprocess and local TCP listener.
Useful monitoring command:
$opids = (Get-Process OpenCode).Id
Get-NetTCPConnection -State Listen |
Where-Object { $opids -contains $_.OwningProcess } |
Select-Object LocalAddress, LocalPort, OwningProcess
For crash capture:
procdump.exe -accepteula -ma -e -t <NODE_SERVICE_PID> C:\Temp\OpenCodeDumps
Recommended mitigation for users
Until the underlying watcher issue is fixed:
- keep database storage outside the workspace;
- keep Vault/file-based secret storage outside the workspace;
- keep Docker persistent data outside the workspace;
- avoid generated trees with UUID/hash-based deep nesting inside directories watched by OpenCode;
- store persistent container data in paths such as:
C:\ContainerData\<project>\
and keep the OpenCode workspace focused on:
- source code;
- configuration;
- documentation;
- tests;
- small development artifacts.
Additional diagnostic artifacts available
The following evidence can be provided privately if required:
- ProcDump full crash dump;
- exact
Win32_ProcessStopTraceexit status; - OpenCode log immediately before the crash;
- sanitized Docker Compose example;
- sanitized list of long workspace paths;
- process hierarchy showing the failing NodeService.
The full memory dump should not be uploaded publicly without sanitization/review.
Plugins
No response
OpenCode version
OpenCode Desktop 1.18.30
Steps to reproduce
Steps to reproduce
-
On Windows, open a local project directory with OpenCode Desktop.
-
Inside the workspace, configure a Docker service that stores persistent generated data using a bind mount, for example:
volumes: - ./data/service-data:/service/data -
Run a service that creates deeply nested directories and files inside that mounted path, especially paths containing generated IDs, hashes, UUIDs, metadata directories, or similarly long names.
-
Verify that some absolute paths inside the OpenCode workspace exceed approximately 260–300 characters.
Example PowerShell command:
Get-ChildItem "C:\Work\ExampleProject" -Recurse -Force -ErrorAction SilentlyContinue | ForEach-Object { [PSCustomObject]@{ Length = $_.FullName.Length Path = $_.FullName } } | Sort-Object Length -Descending | Select-Object -First 20 -
Keep OpenCode Desktop open on that workspace and start the Docker services.
-
From OpenCode, execute commands that cause the containerized service to read/write data in the bind-mounted directory, for example:
docker exec app-backend python /app/verify_service.py -
Repeat the operation if necessary. The issue may be intermittent and does not reproduce on every execution.
-
Observe that the OpenCode UI may remain open, but its local backend becomes unavailable.
-
Check which OpenCode process owns the local listener:
$opids = (Get-Process OpenCode).Id Get-NetTCPConnection -State Listen | Where-Object { $opids -contains $_.OwningProcess } | Select-Object LocalAddress,LocalPort,OwningProcess -
When the issue occurs, the
OpenCode.exeprocess running as:--type=utility --utility-sub-type=node.mojom.NodeServiceterminates and the local
127.0.0.1:<dynamic-port>listener disappears. -
If ProcDump is attached to that process:
procdump.exe -accepteula -ma -e -t <PID> C:\Temp\OpenCodeDumpsthe crash may show:
Exception: E06D7363.?AVregex_error@std@@ Unhandled: C0000409 -
Move the generated persistent data outside the OpenCode workspace, for example:
volumes: - C:/ContainerData/ExampleProject/service-data:/service/data -
Restart the services and repeat the same OpenCode commands.
-
Observe that the previously failing operations complete successfully and the OpenCode
NodeServiceremains running.
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.