From 2dce91aba253e16f0e62bdacc1fe0fe409e8fd77 Mon Sep 17 00:00:00 2001 From: Cameron Ring Date: Tue, 4 Nov 2025 15:36:24 -0800 Subject: [PATCH] fix(api): use core.initialize_current_model Very minor, but makes sense to use the helper we just made --- lua/opencode/api.lua | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lua/opencode/api.lua b/lua/opencode/api.lua index 07762389..723c7a41 100644 --- a/lua/opencode/api.lua +++ b/lua/opencode/api.lua @@ -545,13 +545,7 @@ function M.commands_list() end function M.current_model() - if state.current_model and state.current_model ~= "" then - return state.current_model - else - local conf = require('opencode.config_file').get_opencode_config() - local model = conf and conf.model - return model or '' - end + return core.initialize_current_model() end --- Runs a user-defined command by name.