mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-09-30 06:53:14 +00:00
fix: Dont regenertae during eval mode (#658)
This commit is contained in:
parent
97341af69d
commit
9a559bd965
3 changed files with 12 additions and 3 deletions
|
|
@ -8,6 +8,7 @@ import { createIssueFieldsFromMessages } from "../utils/generate-issue-fields.js
|
|||
import {
|
||||
GITHUB_INSTALLATION_ID,
|
||||
GITHUB_INSTALLATION_TOKEN_COOKIE,
|
||||
GITHUB_PAT,
|
||||
LOCAL_MODE_HEADER,
|
||||
MANAGER_GRAPH_ID,
|
||||
OPEN_SWE_STREAM_MODE,
|
||||
|
|
@ -86,7 +87,9 @@ ${ISSUE_CONTENT_CLOSE_TAG}`,
|
|||
? { [LOCAL_MODE_HEADER]: "true" }
|
||||
: getDefaultHeaders(config);
|
||||
|
||||
if (!isLocal) {
|
||||
// Only regenerate if its not running in local mode, and the GITHUB_PAT is not in the headers
|
||||
// If the GITHUB_PAT is in the headers, then it means we're running an eval and this does not need to be regenerated
|
||||
if (!isLocal && !(GITHUB_PAT in defaultHeaders)) {
|
||||
logger.info("Regenerating installation token before starting new session.");
|
||||
defaultHeaders[GITHUB_INSTALLATION_TOKEN_COOKIE] =
|
||||
await regenerateInstallationToken(defaultHeaders[GITHUB_INSTALLATION_ID]);
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import {
|
|||
LOCAL_MODE_HEADER,
|
||||
GITHUB_INSTALLATION_ID,
|
||||
GITHUB_INSTALLATION_TOKEN_COOKIE,
|
||||
GITHUB_PAT,
|
||||
} from "@open-swe/shared/constants";
|
||||
import { createLogger, LogLevel } from "../../../utils/logger.js";
|
||||
import { getBranchName } from "../../../utils/github/git.js";
|
||||
|
|
@ -44,7 +45,9 @@ export async function startPlanner(
|
|||
? { [LOCAL_MODE_HEADER]: "true" }
|
||||
: getDefaultHeaders(config);
|
||||
|
||||
if (!localMode) {
|
||||
// Only regenerate if its not running in local mode, and the GITHUB_PAT is not in the headers
|
||||
// If the GITHUB_PAT is in the headers, then it means we're running an eval and this does not need to be regenerated
|
||||
if (!localMode && !(GITHUB_PAT in defaultHeaders)) {
|
||||
logger.info("Regenerating installation token before starting planner run.");
|
||||
defaultHeaders[GITHUB_INSTALLATION_TOKEN_COOKIE] =
|
||||
await regenerateInstallationToken(defaultHeaders[GITHUB_INSTALLATION_ID]);
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import {
|
|||
LOCAL_MODE_HEADER,
|
||||
GITHUB_INSTALLATION_ID,
|
||||
GITHUB_INSTALLATION_TOKEN_COOKIE,
|
||||
GITHUB_PAT,
|
||||
} from "@open-swe/shared/constants";
|
||||
import { PlannerGraphState } from "@open-swe/shared/open-swe/planner/types";
|
||||
import { createLangGraphClient } from "../../../utils/langgraph-client.js";
|
||||
|
|
@ -95,7 +96,9 @@ async function startProgrammerRun(input: {
|
|||
? { [LOCAL_MODE_HEADER]: "true" }
|
||||
: getDefaultHeaders(config);
|
||||
|
||||
if (!isLocal) {
|
||||
// Only regenerate if its not running in local mode, and the GITHUB_PAT is not in the headers
|
||||
// If the GITHUB_PAT is in the headers, then it means we're running an eval and this does not need to be regenerated
|
||||
if (!isLocal && !(GITHUB_PAT in defaultHeaders)) {
|
||||
logger.info(
|
||||
"Regenerating installation token before starting programmer run.",
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue