Skip to content

[macOS] Critical: App killed on startup after update due to "Code Signature Invalid" #9939

Closed as not planned

Description

@lldxflwb

Describe the bug

After updating to the latest version, opencode fails to start on macOS. The process is immediately killed by the OS.

To Reproduce

  1. Update opencode to the latest version.
  2. Run opencode in terminal.
  3. Output:
    [1]    10549 killed     opencode

Root Cause Analysis (Logs)
Using sudo dmesg, I captured the kernel logs which confirm a Code Signing issue. The binary signature seems to be invalid or quarantined after the update.

Plaintext

[72909.498110]: proc 10073: load code signature error 2 for file "opencode"
[72909.498442]: ASP: Security policy would not allow process: 10073, /Users/USER/.opencode/bin/opencode
Working Solution
I fixed it by manually removing the quarantine attribute and forcing a re-sign of the binary:

# 1. (Optional) Remove quarantine
sudo xattr -d com.apple.quarantine ~/.opencode/bin/opencode

# 2. Force re-sign (Crucial Step)
sudo codesign --force --deep --sign - ~/.opencode/bin/opencode

Environment
OS: macOS

Version: (Current latest)

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. github-actions commented on Jan 22, 2026

    @github-actions
    Contributor

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

    These issues all report the same symptom: opencode process being killed on macOS without clear error messages. The root cause analysis in this issue (code signature errors from dmesg logs) provides valuable technical detail that could help resolve all three issues.

    Feel free to ignore if your specific case differs from these existing reports.

  2. philfan02 commented on Jan 25, 2026

    @philfan02

    This worked perfectly for me, thank you!

  3. loocor commented on Mar 4, 2026

    @loocor

    Confirming the same issue. After installing the CLI through the Desktop menu, I also encountered zsh: killed opencode.

    Upon inspection, it was found that ~/.opencode/bin/opencode lacks a code signature:
    Running codesign -v ~/.opencode/bin/opencode shows that it is unsigned.

    Temporary solution:
    Run sudo codesign --force --deep --sign - ~/.opencode/bin/opencode.

    Suggestion: The OpenCode release process should ensure that all distribution channels (installation scripts, Desktop, npm, and auto-updates) provide binaries with proper code signing.

  4. ramarivera commented on Mar 8, 2026

    @ramarivera

    +1ing this, thanks for raising the issue!

    EDIT: On second look, I ran the codesign and it still does not work for me and there are no logs whatsover that can be useful

  5. johnsonsleo commented on Apr 20, 2026

    @johnsonsleo

    same issue

  6. removed
    bugSomething isn't working
    on May 3, 2026
  7. github-actions commented on Jul 6, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions