Fail to start in a newly initialized repo #2790

Closed
opened 2026-02-16 17:37:16 -05:00 by yindo · 4 comments
Owner

Originally created by @Z-Map on GitHub (Nov 11, 2025).

Originally assigned to: @thdxr on GitHub.

Description

Trying to start opencode inside a repo that has no commit yet completely brake opencode's project discovery.

OpenCode version

1.0.57

Steps to reproduce

  1. initialize a git repo with git init myrepo
  2. move into the new repo cd myrepo
  3. launch opencode

TUI will display an error panel at the bottom, non-interactive command will fail with a

TypeError: blob.write(pathOrFdOrBlob, blob) expects a Blob-y thing to write

The error line is from packages/opencode/src/project/project.ts line 63 where it tries to write an empty result from the previous call to git rev-list.
git rev-list --max-parents=0 --all returns nothing on a new repo.

My git version is 2.51.2, I don't know if it influence the command output.

I'm not familiar enough with opencode's codebase to fix it myself in PR sorry.

Screenshot and/or share link

Image

Operating System

Archlinux

Terminal

Ghostty

Originally created by @Z-Map on GitHub (Nov 11, 2025). Originally assigned to: @thdxr on GitHub. ### Description Trying to start opencode inside a repo that has no commit yet completely brake opencode's project discovery. ### OpenCode version 1.0.57 ### Steps to reproduce 1. initialize a git repo with `git init myrepo` 2. move into the new repo `cd myrepo` 3. launch `opencode` TUI will display an error panel at the bottom, non-interactive command will fail with a > TypeError: blob.write(pathOrFdOrBlob, blob) expects a Blob-y thing to write The error line is from `packages/opencode/src/project/project.ts` line 63 where it tries to write an empty result from the previous call to [git rev-list](https://github.com/sst/opencode/blob/98be75b17c839bd003807681234f33be5d655fbd/packages/opencode/src/project/project.ts#L50). `git rev-list --max-parents=0 --all` returns nothing on a new repo. My git version is 2.51.2, I don't know if it influence the command output. I'm not familiar enough with opencode's codebase to fix it myself in PR sorry. ### Screenshot and/or share link <img width="1213" height="264" alt="Image" src="https://github.com/user-attachments/assets/5b99c72d-ad08-4253-8261-7ba96c08473a" /> ### Operating System Archlinux ### Terminal Ghostty
yindo added the bug label 2026-02-16 17:37:16 -05:00
yindo closed this issue 2026-02-16 17:37:16 -05:00
Author
Owner

@cholladay0816 commented on GitHub (Nov 11, 2025):

Running into the same issue on WSL2, both with the NPM and curl install on a fresh instance.

Edit: Rolling back to 1.0.55 fixes for me, and I see from the NPM install that it's 2 packages instead of 5 between versions, which makes me think it could be a dependency issue where something required maybe isn't auto-installing itself.

@cholladay0816 commented on GitHub (Nov 11, 2025): Running into the same issue on WSL2, both with the NPM and curl install on a fresh instance. Edit: Rolling back to 1.0.55 fixes for me, and I see from the NPM install that it's 2 packages instead of 5 between versions, which makes me think it could be a dependency issue where something required maybe isn't auto-installing itself.
Author
Owner

@rekram1-node commented on GitHub (Nov 11, 2025):

ill fix it

@rekram1-node commented on GitHub (Nov 11, 2025): ill fix it
Author
Owner

@rekram1-node commented on GitHub (Nov 11, 2025):

This is a regression, it was fixed a long time ago

@rekram1-node commented on GitHub (Nov 11, 2025): This is a regression, it was fixed a long time ago
Author
Owner

@thdxr commented on GitHub (Nov 11, 2025):

fixed

@thdxr commented on GitHub (Nov 11, 2025): fixed
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2790