Skip to content

Commit ffdb3f5

Browse files
committed
fix(api_client): ensure opencode server waits for url before continuing
This should fix #210
1 parent 8eee7e6 commit ffdb3f5

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lua/opencode/api_client.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ function OpencodeApiClient:_ensure_base_url()
3939
end
4040

4141
if not state.opencode_server.url then
42-
return false
42+
state.opencode_server:get_spawn_promise():wait()
43+
if not state.opencode_server.url then
44+
return false
45+
end
4346
end
4447

4548
self.base_url = state.opencode_server.url:gsub('/$', '')

0 commit comments

Comments
 (0)