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
{{ message }}
Repository navigation
Opencode hangs when opened in a directory with .git #6363
I run my opencode instances inside of coder/code-server. If i open opencode in a blank folder no issue but if i git init that folder it will no longer support opencode. It simply hangs. Again only thing changed is if there is a .git folder or not in the project that breaks everything.
OpenCode version
No response
Steps to reproduce
I install the interface in my coolify server
I install opencode using curl
I install the opencode vscode plugin
i create a directory for my work
git init (same issue if i clone the empty repo)
try to open opencode via vs-code plugin or shell and opencode tui never comes up just blank and have to close window because ctrl+c doesnt effect the processes.
These issues share common themes with hanging/freezing behavior and inability to terminate the application with Ctrl+C or Esc. Feel free to ignore if your specific case (hanging when opening in a .git directory) is distinct from these.
# opencode --print-logs run "hello world"
INFO 2025-12-29T15:59:18 +354ms service=default version=1.0.207 args=["--print-logs","run","hello world"] opencode
INFO 2025-12-29T15:59:18 +1ms service=default directory=/config/workspace creating instance
INFO 2025-12-29T15:59:18 +0ms service=project directory=/config/workspace fromDirectory
INFO 2025-12-29T15:59:18 +8ms service=default directory=/config/workspace bootstrapping
INFO 2025-12-29T15:59:18 +2ms service=config path=/config/.config/opencode/config.json loading
INFO 2025-12-29T15:59:18 +1ms service=config path=/config/.config/opencode/opencode.json loading
INFO 2025-12-29T15:59:18 +0ms service=config path=/config/.config/opencode/opencode.jsonc loading
INFO 2025-12-29T15:59:18 +2ms service=bun cmd=["/config/.opencode/bin/opencode","add","@opencode-ai/plugin@1.0.207","--exact"] cwd=/config/.config/opencode running
INFO 2025-12-29T15:59:18 +12ms service=bun code=0 stdout=bun add v1.3.5 (1e86cebd)
installed @opencode-ai/plugin@1.0.207
[4.00ms] done
stderr=Saved lockfile
done
INFO 2025-12-29T15:59:18 +0ms service=config path=/config/.opencode/opencode.jsonc loading
INFO 2025-12-29T15:59:18 +1ms service=config path=/config/.opencode/opencode.json loading
INFO 2025-12-29T15:59:18 +0ms service=bun cmd=["/config/.opencode/bin/opencode","add","@opencode-ai/plugin@1.0.207","--exact"] cwd=/config/.opencode running
INFO 2025-12-29T15:59:18 +8ms service=bun code=0 stdout=bun add v1.3.5 (1e86cebd)
installed @opencode-ai/plugin@1.0.207
[3.00ms] done
stderr=Saved lockfile
done
INFO 2025-12-29T15:59:18 +5ms service=plugin path=opencode-copilot-auth@0.0.9 loading plugin
INFO 2025-12-29T15:59:18 +5ms service=plugin path=opencode-anthropic-auth@0.0.5 loading plugin
INFO 2025-12-29T15:59:18 +17ms service=bus type=* subscribing
INFO 2025-12-29T15:59:18 +0ms service=bus type=session.updated subscribing
INFO 2025-12-29T15:59:18 +0ms service=bus type=message.updated subscribing
INFO 2025-12-29T15:59:18 +0ms service=bus type=message.part.updated subscribing
INFO 2025-12-29T15:59:18 +0ms service=bus type=session.updated subscribing
INFO 2025-12-29T15:59:18 +0ms service=bus type=message.updated subscribing
INFO 2025-12-29T15:59:18 +0ms service=bus type=message.part.updated subscribing
INFO 2025-12-29T15:59:18 +0ms service=bus type=session.diff subscribing
INFO 2025-12-29T15:59:18 +0ms service=format init
INFO 2025-12-29T15:59:18 +0ms service=bus type=file.edited subscribing
INFO 2025-12-29T15:59:18 +0ms service=lsp serverIds=deno, typescript, vue, eslint, oxlint, biome, gopls, ruby-lsp, pyright, elixir-ls, zls, csharp, fsharp, sourcekit-lsp, rust, clangd, svelte, astro, jdtls, yaml-ls, lua-ls, php intelephense, dart, ocaml-lsp, bash, terraform, texlab, dockerfile, gleam, clojure-lsp, nixd, tinymist, haskell-language-server enabled LSP servers
INFO 2025-12-29T15:59:18 +1ms service=file.watcher init
INFO 2025-12-29T15:59:18 +1ms service=bus type=command.executed subscribing
INFO 2025-12-29T15:59:18 +1ms service=file.watcher platform=linux backend=inotify watcher backend
INFO 2025-12-29T15:59:18 +20ms service=vcs branch=HEAD initialized
INFO 2025-12-29T15:59:18 +0ms service=bus type=file.watcher.updated subscribing
I am going to run some tests using the same container image on my desktop worked fine for the same test, but launching a new container on my dev server is having the same issue. Will try on another server of the same cluster
I dont know what caused it because new containers rebooted contieners all had the same issue but only 1 server had it. i rebooted that server and it is fine we can close or leave this ticket open maybe with a differnet label and see if anyone else comes by with the same type of issue
I have this same issue. I am wondering if it is related to inotify running out of watches? I notice that is also hangs at the file.watcher subscription. If I log into another server that has no other of my processes running, it works with git. So likely @wojons had no inotify issues on the freshly rebooted container.
yeah ill add a timeout to it, can you also do an ls in .git and see if there are any folders i didnt exclude in watcher.ts? ig i should just ls, exclude everything but the 1 file
Im really only trying to watch the current branch and nothing else
yeah ill add a timeout to it, can you also do an ls in .git and see if there are any folders i didnt exclude in watcher.ts? ig i should just ls, exclude everything but the 1 file
Im really only trying to watch the current branch and nothing else
Activity
github-actions commentedon Dec 29, 2025
This issue might be a duplicate of existing issues. Please check:
bun addget stuck #4682: opencode get stuck whenbun addget stuckThese issues share common themes with hanging/freezing behavior and inability to terminate the application with Ctrl+C or Esc. Feel free to ignore if your specific case (hanging when opening in a .git directory) is distinct from these.
rekram1-node commentedon Dec 29, 2025
using opencode run, with print logs flags, anyway u can try running that in there so we can see what step hangs?
wojons commentedon Dec 29, 2025
It just gets stuck there.
I am going to run some tests using the same container image on my desktop worked fine for the same test, but launching a new container on my dev server is having the same issue. Will try on another server of the same cluster
wojons commentedon Dec 29, 2025
I dont know what caused it because new containers rebooted contieners all had the same issue but only 1 server had it. i rebooted that server and it is fine we can close or leave this ticket open maybe with a differnet label and see if anyone else comes by with the same type of issue
jumpmanjay commentedon Dec 29, 2025
I have this same issue. I am wondering if it is related to inotify running out of watches? I notice that is also hangs at the file.watcher subscription. If I log into another server that has no other of my processes running, it works with git. So likely @wojons had no inotify issues on the freshly rebooted container.
A fix for this issue would be appreciated!
rekram1-node commentedon Dec 29, 2025
yeah ill add a timeout to it, can you also do an ls in .git and see if there are any folders i didnt exclude in watcher.ts? ig i should just ls, exclude everything but the 1 file
Im really only trying to watch the current branch and nothing else
jumpmanjay commentedon Dec 29, 2025
It looks like "branches" is missing
rekram1-node commentedon Dec 29, 2025
ig ur git version is super old then..
jumpmanjay commentedon Dec 29, 2025
Likely. v2.31.3
rekram1-node commentedon Dec 29, 2025
pushed 2 fixes, should be fixed in next release
02e5a19
76b0121