fix: authentication bugs and example (#643)

* fix: fix authentication bugs and example

* fix: formatting

* fix: move items
This commit is contained in:
Palash Shah 2025-08-01 17:16:57 -04:00 • committed by GitHub
parent 041cb4aca6
commit 857053ad95
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 5 deletions

View file

@ -11,4 +11,7 @@ GITHUB_CALLBACK_URL=""
GITHUB_LOGIN_URL=""
GITHUB_ACCESS_TOKEN_LOGIN_LINK=
SECRETS_ENCRYPTION_KEY=""
SECRETS_ENCRYPTION_KEY=""
OPEN_SWE_LOCAL_MODE=true
OPEN_SWE_LOCAL_PROJECT_PATH=""

View file

@ -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"
SKIP_CI_UNTIL_LAST_COMMIT="true"
OPEN_SWE_LOCAL_MODE=true
OPEN_SWE_LOCAL_PROJECT_PATH=""

View file

@ -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<PlannerGraphState> | undefined;
let programmerThread: Thread<GraphState> | 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;