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

Open
opened 2026-02-16 18:06:17 -05:00 by yindo · 2 comments
Owner

Originally created by @lldxflwb on GitHub (Jan 21, 2026).

Originally assigned to: @rekram1-node on GitHub.

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

Originally created by @lldxflwb on GitHub (Jan 21, 2026). Originally assigned to: @rekram1-node on GitHub. ### 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: ```bash [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_
yindo added the bug label 2026-02-16 18:06:17 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 21, 2026):

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

  • #2380: bug: immediately exits and other processes never exit - similar macOS startup failure with '[killed]' message
  • #8381: zsh: killed opencode -version - same '[killed]' output on macOS

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.

@github-actions[bot] commented on GitHub (Jan 21, 2026): This issue might be a duplicate of existing issues. Please check: - #2380: bug: immediately exits and other processes never exit - similar macOS startup failure with '[killed]' message - #8381: zsh: killed opencode -version - same '[killed]' output on macOS 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.
Author
Owner

@philfan02 commented on GitHub (Jan 25, 2026):

This worked perfectly for me, thank you!

@philfan02 commented on GitHub (Jan 25, 2026): This worked perfectly for me, thank you!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7140