summaryrefslogtreecommitdiff
path: root/continuedev/src/continuedev/server
diff options
context:
space:
mode:
authorNate Sesti <33237525+sestinj@users.noreply.github.com>2023-09-03 21:58:46 -0700
committerGitHub <noreply@github.com>2023-09-03 21:58:46 -0700
commite645a89192b28cc16a1303bfa5551834c64ecb77 (patch)
tree6da1d0b5f59cef5c9fd9a615119742550fe1ad2c /continuedev/src/continuedev/server
parente49c6f55ae0c00bc660bbe885ea44f3a2fb1dc35 (diff)
downloadsncontinue-e645a89192b28cc16a1303bfa5551834c64ecb77.tar.gz
sncontinue-e645a89192b28cc16a1303bfa5551834c64ecb77.tar.bz2
sncontinue-e645a89192b28cc16a1303bfa5551834c64ecb77.zip
refactor: :construction: Initial, not tested, refactor of LLM (#448)
* refactor: :construction: Initial, not tested, refactor of LLM * refactor: :construction: replace usages of _complete with complete * fix: :bug: fixes after refactor * refactor: :recycle: template raw completions in chat format * test: :white_check_mark: simplified edit prompt and UNIT TESTS! * ci: :green_heart: unit tests in ci * fix: :bug: fixes for unit tests in ci * fix: :bug: start uvicorn in tests without poetry * fix: :closed_lock_with_key: add secrets to main.yaml * feat: :adhesive_bandage: timeout for all LLM classes * ci: :green_heart: prepare main.yaml for main branch
Diffstat (limited to 'continuedev/src/continuedev/server')
-rw-r--r--continuedev/src/continuedev/server/session_manager.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/continuedev/src/continuedev/server/session_manager.py b/continuedev/src/continuedev/server/session_manager.py
index aea20ef9..f0c33929 100644
--- a/continuedev/src/continuedev/server/session_manager.py
+++ b/continuedev/src/continuedev/server/session_manager.py
@@ -10,7 +10,6 @@ from fastapi.websockets import WebSocketState
from ..core.autopilot import Autopilot
from ..core.main import FullState
from ..libs.util.create_async_task import create_async_task
-from ..libs.util.errors import SessionNotFound
from ..libs.util.logging import logger
from ..libs.util.paths import (
getSessionFilePath,
@@ -124,7 +123,12 @@ class SessionManager:
# Read and update the sessions list
with open(getSessionsListFilePath(), "r") as f:
- sessions_list = json.load(f)
+ try:
+ sessions_list = json.load(f)
+ except json.JSONDecodeError:
+ raise Exception(
+ f"It looks like there is a JSON formatting error in your sessions.json file ({getSessionsListFilePath()}). Please fix this before creating a new session."
+ )
session_ids = [s["session_id"] for s in sessions_list]
if session_id not in session_ids: