Skip to content

Windows Security blocks OpenTUI DLL during opencode initialization: Error Code 4551 #21234

Closed

Description

@thePrnvBot

Description

When running opencode on Windows, the application fails to start because Windows Security blocks a temporary DLL used by the OpenTUI render library.

I ran opencode --print-logs and got the following:

INFO  2026-04-06T20:04:02 +588ms service=default version=1.3.17 args=["--print-logs"] opencode
INFO  2026-04-06T20:04:02 +12ms service=default directory=C:\Users\[USER]\OneDrive\Desktop\[PROJECT_PATH]
INFO  2026-04-06T20:04:02 +12ms service=project directory=C:\Users\[USER]\OneDrive\Desktop\[PROJECT_PATH] fromDirectory
INFO  2026-04-06T20:04:02 +29ms service=db path=C:\Users\[USER]\.local\share\opencode\opencode.db opening database
INFO  2026-04-06T20:04:02 +11ms service=db count=10 mode=bundled applying migrations
INFO  2026-04-06T20:04:02 +33ms service=config path=C:\Users\[USER]\.config\opencode\config.json loading
INFO  2026-04-06T20:04:02 +1ms service=config path=C:\Users\[USER]\.config\opencode\opencode.json loading
INFO  2026-04-06T20:04:02 +9ms service=config path=C:\Users\[USER]\.config\opencode\opencode.jsonc loading
ERROR 2026-04-06T20:04:02 +150ms service=default e=Failed to initialize OpenTUI render library: Failed to open library "C:\Users\[USER]\AppData\Local\Temp\.d9ffdfa87bffbbfc-00000001.dll": error code 4551 rejection
ERROR 2026-04-06T20:04:02 +0ms service=default Error: Failed to initialize OpenTUI render library: Failed to open library "C:\Users\[USER]\AppData\Local\Temp\.d9ffdfa87bffbbfc-00000001.dll": error code 4551

I have tried clearing the cache from the .cache directory but it hasn't resolved the issue.

Plugins

openducky@latest

OpenCode version

1.3.17

Steps to reproduce

  1. Open Terminal
  2. Run opencode

Screenshot and/or share link

Image

Operating System

Windows 11

Terminal

Windows Terminal

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Apr 6, 2026
  2. github-actions commented on Apr 6, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    These issues cover the same root cause: Windows Defender/antivirus blocking the temporary DLL file that opencode extracts at runtime. Please review those threads for any existing workarounds or fixes before continuing here.

  3. changed the title [-]Windows Defender blocks OpenTUI DLL during opencode initialization: Error Code 4551[/-] [+]Windows Security blocks OpenTUI DLL during opencode initialization: Error Code 4551[/+] on Apr 6, 2026
  4. thePrnvBot commented on Apr 7, 2026

    @thePrnvBot
    Author

    The issue appears to have sorted itself, since I filed this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingopentuiThis relates to changes in v1.0, now that opencode uses opentuiwindows

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions