You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Had the same failure: the session title gets created, but no reply ever comes - only the server restarted while you were working notice, with event stream disconnected / stalled in the log.
Root cause for me: a stray empty .git folder in my home folder. That hidden folder makes everything around it look like one big "git project" - so opencode treated my entire home folder as the project and scanned all of it for changes before each reply (541k files, ~26 seconds per scan, twice per message). That is longer than opencode's internal watchdog waits, so it assumes the service died, restarts it, and you get the loop.
Quick check - run this in the folder where you start opencode:
git rev-parse --show-toplevel
If it prints your home folder (or a big folder above the project you actually work in), that leftover .git is the problem. Delete that .git folder (accidents like this usually contain no commits, so nothing is lost - if unsure, just rename it to .git.bak). Then start opencode inside a normal project folder, and never run git init in your home folder. This removed the failure completely for me.
If it prints your real project folder, the folder is fine and the files inside are the problem. Run: git ls-files --others --exclude-standard | wc -l
If that number is huge (100k+), opencode is choking on files that should have been skipped. List your big folders that don't belong to the project (node_modules/, target/, build/, caches, datasets) in a .gitignore file - one per line. As a last resort you can set "snapshot": false in your opencode config, which switches the scan off (but you also lose the undo feature).
Deleting the stray ~/.git / %USERPROFILE%\.git was enough for me.
Activity
Fgaoxing commentedon Sep 21, 2026
@thdxr
piknockyou commentedon Sep 30, 2026
Had the same failure: the session title gets created, but no reply ever comes - only the
server restarted while you were workingnotice, withevent stream disconnected / stalledin the log.Root cause for me: a stray empty
.gitfolder in my home folder. That hidden folder makes everything around it look like one big "git project" - so opencode treated my entire home folder as the project and scanned all of it for changes before each reply (541k files, ~26 seconds per scan, twice per message). That is longer than opencode's internal watchdog waits, so it assumes the service died, restarts it, and you get the loop.Quick check - run this in the folder where you start opencode:
git rev-parse --show-toplevel.gitis the problem. Delete that.gitfolder (accidents like this usually contain no commits, so nothing is lost - if unsure, just rename it to.git.bak). Then start opencode inside a normal project folder, and never rungit initin your home folder. This removed the failure completely for me.git ls-files --others --exclude-standard | wc -lIf that number is huge (100k+), opencode is choking on files that should have been skipped. List your big folders that don't belong to the project (
node_modules/,target/,build/, caches, datasets) in a.gitignorefile - one per line. As a last resort you can set"snapshot": falsein your opencode config, which switches the scan off (but you also lose the undo feature).Deleting the stray
~/.git/%USERPROFILE%\.gitwas enough for me.