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
Not work in a git project, but normal work in a not git dir #2365
open opencode at a ~ directory everything come normal, but open at a project directory (has a .git folder), custom url port has been changed to a random port
changed the title [-]Not work in a project, but normal work in a not git dir[/-][+]Not work in a git project, but normal work in a not git dir[/+]on Sep 2, 2025
Have the same issue - basically prevents me from using OpenCode at all. My project is a monorepo of decent size (uv / python project).
I run >>> opencode and then I am able to type into the prompt/text area, but basically the rest of the TUI is unresponsive (i.e. when i type /models nothing shows up).
In my home directory, opencode is perfectly responsive.
edit: I am also using a custom provider.
INFO 2025-09-02T22:03:46 +92ms service=default version=0.6.3 args=["run","hello","--print-logs","--model","LiteLLM/openai/gpt-5"] opencode
INFO 2025-09-02T22:03:46 +0ms service=project directory=/home fromDirectory
INFO 2025-09-02T22:03:46 +9ms service=config path=/home/.config/opencode/config.json loading
INFO 2025-09-02T22:03:46 +1ms service=config path=/home/.config/opencode/opencode.json loading
INFO 2025-09-02T22:03:46 +3ms service=config path=/home/.config/opencode/opencode.jsonc loading
INFO 2025-09-02T22:03:46 +2ms service=plugin [email protected] loading plugin
INFO 2025-09-02T22:03:46 +1ms service=plugin [email protected] loading plugin
INFO 2025-09-02T22:03:46 +14ms service=bus type=* subscribing
INFO 2025-09-02T22:03:46 +0ms service=bus type=session.updated subscribing
INFO 2025-09-02T22:03:46 +0ms service=bus type=message.updated subscribing
INFO 2025-09-02T22:03:46 +0ms service=bus type=message.part.updated subscribing
INFO 2025-09-02T22:03:46 +0ms service=format init
INFO 2025-09-02T22:03:46 +0ms service=bus type=file.edited subscribing
INFO 2025-09-02T22:03:46 +1ms service=session id=ses_6f38adfa6ffet9fHNHK4bCABLb version=0.6.3 projectID=global directory=/home title=New session - 2025-09-02T22:03:46.649Z time={"created":1756850626649,"updated":1756850626649} created
INFO 2025-09-02T22:03:46 +0ms service=lsp serverIds=typescript, vue, eslint, gopls, ruby-lsp, pyright, elixir-ls, zls, csharp, rust, clangd enabled LSP servers
INFO 2025-09-02T22:03:46 +0ms service=bus type=session.updated publishing
INFO 2025-09-02T22:03:46 +2ms service=bus type=message.part.updated subscribing
INFO 2025-09-02T22:03:46 +0ms service=bus type=session.error subscribing
INFO 2025-09-02T22:03:46 +1ms service=session session=ses_6f38adfa6ffet9fHNHK4bCABLb chatting
INFO 2025-09-02T22:03:46 +3ms service=bus type=message.updated publishing
INFO 2025-09-02T22:03:46 +1ms service=bus type=message.part.updated publishing
INFO 2025-09-02T22:03:46 +0ms service=bus type=session.updated publishing
INFO 2025-09-02T22:03:46 +3ms service=models.dev file={} refreshing
INFO 2025-09-02T22:03:46 +1ms service=provider init
INFO 2025-09-02T22:03:46 +1ms service=provider providerID=openai found
INFO 2025-09-02T22:03:46 +0ms service=provider providerID=opencode found
INFO 2025-09-02T22:03:46 +0ms service=provider providerID=LiteLLM found
INFO 2025-09-02T22:03:46 +0ms service=provider providerID=LiteLLM modelID=openai/gpt-5 getModel
INFO 2025-09-02T22:03:46 +1ms service=provider status=started providerID=LiteLLM getSDK
INFO 2025-09-02T22:03:46 +66ms service=provider status=completed duration=66 providerID=LiteLLM getSDK
INFO 2025-09-02T22:03:46 +0ms service=provider providerID=LiteLLM modelID=openai/gpt-5 found
INFO 2025-09-02T22:03:46 +1ms service=session session=ses_6f38adfa6ffet9fHNHK4bCABLb sessionID=ses_6f38adfa6ffet9fHNHK4bCABLb locking
INFO 2025-09-02T22:03:46 +13ms service=bus type=message.updated publishing
INFO 2025-09-02T22:03:46 +1ms service=mcp key=serena type=local found
INFO 2025-09-02T22:03:47 +1010ms service=session session=ses_6f38adfa6ffet9fHNHK4bCABLb type=start part
INFO 2025-09-02T22:03:48 +1096ms service=session session=ses_6f38adfa6ffet9fHNHK4bCABLb type=start-step part
INFO 2025-09-02T22:03:48 +0ms service=bus type=message.part.updated publishing
INFO 2025-09-02T22:03:50 +1273ms service=session session=ses_6f38adfa6ffet9fHNHK4bCABLb type=reasoning-start part
INFO 2025-09-02T22:03:51 +1065ms service=session session=ses_6f38adfa6ffet9fHNHK4bCABLb type=reasoning-end part
INFO 2025-09-02T22:03:51 +0ms service=bus type=message.part.updated publishing
INFO 2025-09-02T22:03:51 +0ms service=session session=ses_6f38adfa6ffet9fHNHK4bCABLb type=text-start part
INFO 2025-09-02T22:03:51 +1ms service=session session=ses_6f38adfa6ffet9fHNHK4bCABLb type=text-delta part
INFO 2025-09-02T22:03:51 +0ms service=bus type=message.part.updated publishing
INFO 2025-09-02T22:03:51 +7ms service=session session=ses_6f38adfa6ffet9fHNHK4bCABLb type=text-delta part
INFO 2025-09-02T22:03:51 +1ms service=bus type=message.part.updated publishing
INFO 2025-09-02T22:03:51 +7ms service=session session=ses_6f38adfa6ffet9fHNHK4bCABLb type=text-delta part
INFO 2025-09-02T22:03:51 +0ms service=bus type=message.part.updated publishing
INFO 2025-09-02T22:03:51 +9ms service=session session=ses_6f38adfa6ffet9fHNHK4bCABLb type=text-delta part
INFO 2025-09-02T22:03:51 +0ms service=bus type=message.part.updated publishing
INFO 2025-09-02T22:03:51 +12ms service=session session=ses_6f38adfa6ffet9fHNHK4bCABLb type=text-delta part
INFO 2025-09-02T22:03:51 +0ms service=bus type=message.part.updated publishing
INFO 2025-09-02T22:03:51 +18ms service=session session=ses_6f38adfa6ffet9fHNHK4bCABLb type=text-delta part
INFO 2025-09-02T22:03:51 +0ms service=bus type=message.part.updated publishing
INFO 2025-09-02T22:03:51 +8ms service=session session=ses_6f38adfa6ffet9fHNHK4bCABLb type=text-delta part
INFO 2025-09-02T22:03:51 +0ms service=bus type=message.part.updated publishing
INFO 2025-09-02T22:03:51 +13ms service=session session=ses_6f38adfa6ffet9fHNHK4bCABLb type=text-delta part
INFO 2025-09-02T22:03:51 +0ms service=bus type=message.part.updated publishing
INFO 2025-09-02T22:03:51 +16ms service=session session=ses_6f38adfa6ffet9fHNHK4bCABLb type=text-delta part
INFO 2025-09-02T22:03:51 +1ms service=bus type=message.part.updated publishing
INFO 2025-09-02T22:03:51 +215ms service=session session=ses_6f38adfa6ffet9fHNHK4bCABLb type=text-end part
INFO 2025-09-02T22:03:51 +0ms service=bus type=message.part.updated publishing
Hi! How can I help you today?
INFO 2025-09-02T22:03:51 +283ms service=session session=ses_6f38adfa6ffet9fHNHK4bCABLb type=finish-step part
INFO 2025-09-02T22:03:51 +1ms service=bus type=message.part.updated publishing
INFO 2025-09-02T22:03:51 +1ms service=bus type=message.updated publishing
INFO 2025-09-02T22:03:51 +0ms service=session session=ses_6f38adfa6ffet9fHNHK4bCABLb type=finish part
INFO 2025-09-02T22:03:51 +0ms service=bus type=message.updated publishing
INFO 2025-09-02T22:03:51 +1ms service=bus type=message.updated publishing
INFO 2025-09-02T22:03:51 +0ms service=session session=ses_6f38adfa6ffet9fHNHK4bCABLb sessionID=ses_6f38adfa6ffet9fHNHK4bCABLb unlocking
INFO 2025-09-02T22:03:51 +2ms service=bus type=session.idle publishing
Same problem here, it returns 400 Bad request with a wrong baseUrl and a random port when I use opencode in a project with a .git folder.
Works well without .git
This is the error from the tui sending it to the server, opencode has a client server architecture, when you run opencode it is actually 2 processes: a server and the tui so the tui sends http request to that server
Can you share what the error is? Maybe if you can run:
I create a new project with just a uc init. Work well. Commit one time and get the "bad request".
I add some information: i'm working with restricted internet access. Cause i see : Unable to connect. Is the computer able to access the url? Failed to fetch models.dev.
INFO 2025-09-19T09:28:49 +140ms service=default version=0.9.9 args=["run","hello","--print-logs"] opencode
INFO 2025-09-19T09:28:49 +1ms service=project directory=C:\Users\test\MyApp\workspace_atom\test fromDirectory
INFO 2025-09-19T09:28:49 +98ms service=config path=C:\Users\test\.config\opencode\config.json loading
INFO 2025-09-19T09:28:49 +0ms service=config path=C:\Users\test\.config\opencode\opencode.json loading
INFO 2025-09-19T09:28:49 +7ms service=config path=C:\Users\test\.config\opencode\opencode.jsonc loading
INFO 2025-09-19T09:28:49 +10ms service=plugin [email protected] loading plugin
INFO 2025-09-19T09:28:49 +4ms service=plugin [email protected] loading plugin
INFO 2025-09-19T09:28:49 +54ms service=bus type=* subscribing
INFO 2025-09-19T09:28:49 +0ms service=bus type=session.updated subscribing
INFO 2025-09-19T09:28:49 +0ms service=bus type=message.updated subscribing
INFO 2025-09-19T09:28:49 +0ms service=bus type=message.part.updated subscribing
INFO 2025-09-19T09:28:49 +0ms service=format init
INFO 2025-09-19T09:28:49 +0ms service=bus type=file.edited subscribing
INFO 2025-09-19T09:28:49 +2ms service=session id=ses_69eb1f13affeEzVeh3ch7NTLDS version=0.9.9 projectID=746c96e57beae72643c8b0eb8dccea82908df34c directory=C:\Users\test\MyApp\workspace_atom\test title=New session - 2025-09-19T09:28:49.605Z time={"created":1758274129605,"updated":1758274129605} created
INFO 2025-09-19T09:28:49 +0ms service=lsp serverIds=typescript, vue, eslint, gopls, ruby-lsp, pyright, elixir-ls, zls, csharp, rust, clangd, svelte enabled LSP servers
INFO 2025-09-19T09:28:49 +6ms service=bus type=session.updated publishing
INFO 2025-09-19T09:28:49 +3ms service=bus type=message.part.updated subscribing
INFO 2025-09-19T09:28:49 +0ms service=bus type=session.error subscribing
INFO 2025-09-19T09:28:49 +1ms service=session.prompt session=ses_69eb1f13affeEzVeh3ch7NTLDS prompt
INFO 2025-09-19T09:28:49 +4ms service=bus type=message.updated publishing
INFO 2025-09-19T09:28:49 +2ms service=bus type=message.part.updated publishing
INFO 2025-09-19T09:28:49 +2ms service=bus type=session.updated publishing
INFO 2025-09-19T09:28:49 +3ms service=models.dev file={} refreshing
INFO 2025-09-19T09:28:49 +2ms service=provider init
INFO 2025-09-19T09:28:49 +1ms service=provider providerID=openai found
INFO 2025-09-19T09:28:49 +0ms service=provider providerID=opencode found
INFO 2025-09-19T09:28:49 +0ms service=provider providerID=test-small found
INFO 2025-09-19T09:28:49 +0ms service=provider providerID=test-large found
INFO 2025-09-19T09:28:49 +0ms service=provider providerID=test-codestral found
INFO 2025-09-19T09:28:49 +0ms service=provider providerID=test-small modelID=mistral-small-2503 getModel
INFO 2025-09-19T09:28:49 +1ms service=provider status=started providerID=test-small getSDK
INFO 2025-09-19T09:28:49 +113ms service=provider status=completed duration=113 providerID=test-small getSDK
INFO 2025-09-19T09:28:49 +1ms service=provider providerID=test-small modelID=mistral-small-2503 found
INFO 2025-09-19T09:28:49 +1ms service=session.prompt session=ses_69eb1f13affeEzVeh3ch7NTLDS sessionID=ses_69eb1f13affeEzVeh3ch7NTLDS locking
ERROR 2025-09-19T09:28:49 +5ms service=models.dev error=Unable to connect. Is the computer able to access the url? Failed to fetch models.dev
INFO 2025-09-19T09:28:49 +24ms service=session.prompt session=ses_69eb1f13affeEzVeh3ch7NTLDS sessionID=ses_69eb1f13affeEzVeh3ch7NTLDS unlocking
ERROR 2025-09-19T09:28:49 +5ms service=default name=Error message=Unable to connect. Is the computer able to access the url? fatal
Error: Unexpected error, check log file at for more details
INFO 2025-09-19T09:28:49 +12ms service=bus type=session.idle publishing
Activity
github-actions commentedon Sep 2, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
rekram1-node commentedon Sep 2, 2025
Hm can you reword? Not sure I am following
EachenL commentedon Sep 2, 2025
I'm using a custom providers, And all settings are set according to the settings in the document. My custom endpoint is http://127.0.0.1:52147/api/v1, But when I open opencode in a path with .git, If I want to send content, opencode will report an error:tui failed to send message: POST "http://127.0.0.1:42811/session/ses_67ad6fa15s6eaea516f1/message" : 400 Bad Request.
However, if I open opencode in a dirctory without .git, It will not report this error and I can send content normally
opencode version is 0.5.29
[-]Not work in a project, but normal work in a not git dir[/-][+]Not work in a git project, but normal work in a not git dir[/+]rekram1-node commentedon Sep 2, 2025
ahh okay
rekram1-node commentedon Sep 2, 2025
can you run in the directory causing issues:
^ For that please replace:
and show me the output
vkmenon commentedon Sep 2, 2025
Have the same issue - basically prevents me from using OpenCode at all. My project is a monorepo of decent size (uv / python project).
I run >>> opencode and then I am able to type into the prompt/text area, but basically the rest of the TUI is unresponsive (i.e. when i type /models nothing shows up).
In my home directory, opencode is perfectly responsive.
edit: I am also using a custom provider.
rekram1-node commentedon Sep 2, 2025
@vkmenon is that the same issue? OP was having
tui failed to send messageerror toasts? Do you see these too?arsham commentedon Sep 2, 2025
Does
git fsckshow you anything?vkmenon commentedon Sep 2, 2025
@arsham
yes git fsck shows me a lot (it's a big repo and takes a while to run)
@rekram1-node - apologies, I mostly was piggybacking on the fact that Opencode seems to work in home directory / non-git folder but not in my repo.
arsham commentedon Sep 3, 2025
You have a lot of dangling objects, try this:
git gc --prune=now. See if that helps opencode work.I would copy the whole project into another directory and test on the copy.
vkmenon commentedon Sep 3, 2025
@arsham - still same issue after git gc --prune=now
however, cloning the repo into another folder seemed to work fine.
any thoughts as to how opencode is affected by the repo?
2 remaining items
rekram1-node commentedon Sep 3, 2025
We have snapshots and that could be causing issue, can you try setting
"snapshot": falsein your project opencode.json configuration?rekram1-node commentedon Sep 3, 2025
You could also try doing:
AlexandreNeKeR commentedon Sep 17, 2025
Hi,
Same issue here. I'm on Windows 11 with opencode 0.9.9. Work perfectly on dir without .git but '400 Bad Request' with a .git.
Try
then
git gc --prune=nowrekram1-node commentedon Sep 17, 2025
Does it 400 bad request no matter what in git dir? even if it is a hello?
natinho68 commentedon Sep 18, 2025
Same problem here, it returns 400 Bad request with a wrong baseUrl and a random port when I use opencode in a project with a .git folder.
Works well without .git
rekram1-node commentedon Sep 18, 2025
This is the error from the tui sending it to the server, opencode has a client server architecture, when you run opencode it is actually 2 processes: a server and the tui so the tui sends http request to that server
Can you share what the error is? Maybe if you can run:
in the project with the issue?
AlexandreNeKeR commentedon Sep 19, 2025
I create a new project with just a
uc init. Work well. Commit one time and get the "bad request".I add some information: i'm working with restricted internet access. Cause i see :
Unable to connect. Is the computer able to access the url? Failed to fetch models.dev.rekram1-node commentedon Sep 19, 2025
@AlexandreNeKeR can you visit models.dev by chance?
https://models.dev/
AlexandreNeKeR commentedon Sep 19, 2025
Only with my browser. I'm not an admin on my PC. There are admin restrictions and a proxy.
rekram1-node commentedon Sep 19, 2025
@AlexandreNeKeR if you run:
find the cache dir, for me it outputs:
And then create a file in that dir^ models.json and place the contents of this in it: https://models.dev/api.json
AlexandreNeKeR commentedon Sep 19, 2025
I create models.json but same error and same logs.
rekram1-node commentedon Sep 19, 2025
And models.json has that json content in it?
and where is it located?
Did you restart opencode after doing this?
AlexandreNeKeR commentedon Sep 22, 2025
rekram1-node commentedon Dec 28, 2025
[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!