Skip to content

Opencode hangs when opened in a directory with .git #6363

Closed

Description

@wojons

Description

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

  1. I install the interface in my coolify server
  2. I install opencode using curl
  3. I install the opencode vscode plugin
  4. i create a directory for my work
  5. git init (same issue if i clone the empty repo)
  6. 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.

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. github-actions commented on Dec 29, 2025

    @github-actions
    Contributor

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

    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.

  2. rekram1-node commented on Dec 29, 2025

    @rekram1-node
    Contributor

    using opencode run, with print logs flags, anyway u can try running that in there so we can see what step hangs?

  3. wojons commented on Dec 29, 2025

    @wojons
    Author

    It just gets stuck there.

    # 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

  4. wojons commented on Dec 29, 2025

    @wojons
    Author

    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

  5. jumpmanjay commented on Dec 29, 2025

    @jumpmanjay

    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!

  6. rekram1-node commented on Dec 29, 2025

    @rekram1-node
    Contributor

    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

  7. jumpmanjay commented on Dec 29, 2025

    @jumpmanjay

    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

    It looks like "branches" is missing

  8. rekram1-node commented on Dec 29, 2025

    @rekram1-node
    Contributor

    ig ur git version is super old then..

  9. jumpmanjay commented on Dec 29, 2025

    @jumpmanjay

    ig ur git version is super old then..

    Likely. v2.31.3

  10. rekram1-node commented on Dec 29, 2025

    @rekram1-node
    Contributor

    pushed 2 fixes, should be fixed in next release

    02e5a19
    76b0121

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions