diff --git a/apps/cli/.env.example b/apps/cli/.env.example index 3ec75640..eca9abe2 100644 --- a/apps/cli/.env.example +++ b/apps/cli/.env.example @@ -11,4 +11,7 @@ GITHUB_CALLBACK_URL="" GITHUB_LOGIN_URL="" GITHUB_ACCESS_TOKEN_LOGIN_LINK= -SECRETS_ENCRYPTION_KEY="" \ No newline at end of file +SECRETS_ENCRYPTION_KEY="" + +OPEN_SWE_LOCAL_MODE=true +OPEN_SWE_LOCAL_PROJECT_PATH="" \ No newline at end of file diff --git a/apps/open-swe/.env.example b/apps/open-swe/.env.example index 4496a3ca..ae060a01 100644 --- a/apps/open-swe/.env.example +++ b/apps/open-swe/.env.example @@ -52,4 +52,7 @@ OPEN_SWE_APP_URL="http://localhost:3000" SECRETS_ENCRYPTION_KEY="" # Whether or not to append the string "[skip ci]" to the commit message. # See the documentation for how to set this up: docs.langchain.com/labs/swe/setup/ci#skip-ci-until-last-commit -SKIP_CI_UNTIL_LAST_COMMIT="true" \ No newline at end of file +SKIP_CI_UNTIL_LAST_COMMIT="true" + +OPEN_SWE_LOCAL_MODE=true +OPEN_SWE_LOCAL_PROJECT_PATH="" \ No newline at end of file diff --git a/apps/open-swe/src/graphs/manager/nodes/classify-message/index.ts b/apps/open-swe/src/graphs/manager/nodes/classify-message/index.ts index 9ee38eef..200ac96a 100644 --- a/apps/open-swe/src/graphs/manager/nodes/classify-message/index.ts +++ b/apps/open-swe/src/graphs/manager/nodes/classify-message/index.ts @@ -45,6 +45,7 @@ import { isLocalMode } from "@open-swe/shared/open-swe/local-mode"; import { Thread } from "@langchain/langgraph-sdk"; import { PlannerGraphState } from "@open-swe/shared/open-swe/planner/types"; import { GraphState } from "@open-swe/shared/open-swe/types"; +import { Client } from "@langchain/langgraph-sdk"; const logger = createLogger(LogLevel.INFO, "ClassifyMessage"); /** @@ -64,11 +65,14 @@ export async function classifyMessage( let plannerThread: Thread | undefined; let programmerThread: Thread | undefined; - const langGraphClient = createLangGraphClient({ - defaultHeaders: getDefaultHeaders(config), - }); + let langGraphClient: Client | undefined; if (!isLocalMode(config)) { + // Only create LangGraph client if not in local mode + langGraphClient = createLangGraphClient({ + defaultHeaders: getDefaultHeaders(config), + }); + plannerThread = state.plannerSession?.threadId ? await langGraphClient.threads.get(state.plannerSession.threadId) : undefined;