Skip to content

Commit d67dc63

Browse files
committed
fix(core): create session if no current and no last
If we're not starting a new session, we don't have a current session and we don't have a last session, we have to create a new session. Without a session, submitting prompts fails silently.
1 parent 4a44347 commit d67dc63

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lua/opencode/core.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ function M.open(opts)
7676
else
7777
if not state.active_session then
7878
state.active_session = session.get_last_workspace_session()
79+
if not state.active_session then
80+
state.active_session = M.create_new_session()
81+
end
7982
else
8083
if not state.display_route and are_windows_closed then
8184
-- We're not displaying /help or something like that but we have an active session

0 commit comments

Comments
 (0)