mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-10-06 11:12:10 +00:00
chore: Stop passing metadata obj when invoking runs (#649)
This commit is contained in:
parent
6433ed30e0
commit
4c75eca3f9
9 changed files with 0 additions and 64 deletions
|
|
@ -234,11 +234,6 @@ const App: React.FC = () => {
|
||||||
};
|
};
|
||||||
await client.runs.create(threadId, MANAGER_GRAPH_ID, {
|
await client.runs.create(threadId, MANAGER_GRAPH_ID, {
|
||||||
input: interruptInput,
|
input: interruptInput,
|
||||||
metadata: {
|
|
||||||
source: "cli:resume_interrupt",
|
|
||||||
owner,
|
|
||||||
repo: repoName,
|
|
||||||
},
|
|
||||||
config: {
|
config: {
|
||||||
recursion_limit: 400,
|
recursion_limit: 400,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -255,11 +255,6 @@ export class StreamingService {
|
||||||
|
|
||||||
const run = await newClient.runs.create(threadId, MANAGER_GRAPH_ID, {
|
const run = await newClient.runs.create(threadId, MANAGER_GRAPH_ID, {
|
||||||
input: runInput,
|
input: runInput,
|
||||||
metadata: {
|
|
||||||
source: "cli:start_manager",
|
|
||||||
owner: runInput.targetRepository?.owner,
|
|
||||||
repo: runInput.targetRepository?.repo,
|
|
||||||
},
|
|
||||||
config: {
|
config: {
|
||||||
recursion_limit: 400,
|
recursion_limit: 400,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -300,11 +300,6 @@ export async function classifyMessage(
|
||||||
command: {
|
command: {
|
||||||
resume: plannerResume,
|
resume: plannerResume,
|
||||||
},
|
},
|
||||||
metadata: {
|
|
||||||
source: "manager:classify_message_resume_planner",
|
|
||||||
owner: state.targetRepository?.owner,
|
|
||||||
repo: state.targetRepository?.repo,
|
|
||||||
},
|
|
||||||
streamMode: OPEN_SWE_STREAM_MODE as StreamMode[],
|
streamMode: OPEN_SWE_STREAM_MODE as StreamMode[],
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -90,11 +90,6 @@ ${ISSUE_CONTENT_CLOSE_TAG}`,
|
||||||
update: commandUpdate,
|
update: commandUpdate,
|
||||||
goto: "start-planner",
|
goto: "start-planner",
|
||||||
},
|
},
|
||||||
metadata: {
|
|
||||||
source: "manager:create_new_session",
|
|
||||||
owner: state.targetRepository?.owner,
|
|
||||||
repo: state.targetRepository?.repo,
|
|
||||||
},
|
|
||||||
config: {
|
config: {
|
||||||
recursion_limit: 400,
|
recursion_limit: 400,
|
||||||
configurable: getCustomConfigurableFields(config),
|
configurable: getCustomConfigurableFields(config),
|
||||||
|
|
|
||||||
|
|
@ -63,11 +63,6 @@ export async function startPlanner(
|
||||||
PLANNER_GRAPH_ID,
|
PLANNER_GRAPH_ID,
|
||||||
{
|
{
|
||||||
input: runInput,
|
input: runInput,
|
||||||
metadata: {
|
|
||||||
source: "manager:start_planner",
|
|
||||||
owner: state.targetRepository?.owner,
|
|
||||||
repo: state.targetRepository?.repo,
|
|
||||||
},
|
|
||||||
config: {
|
config: {
|
||||||
recursion_limit: 400,
|
recursion_limit: 400,
|
||||||
configurable: getCustomConfigurableFields(config),
|
configurable: getCustomConfigurableFields(config),
|
||||||
|
|
|
||||||
|
|
@ -114,11 +114,6 @@ async function startProgrammerRun(input: {
|
||||||
PROGRAMMER_GRAPH_ID,
|
PROGRAMMER_GRAPH_ID,
|
||||||
{
|
{
|
||||||
input: runInput,
|
input: runInput,
|
||||||
metadata: {
|
|
||||||
source: "planner:proposed_plan",
|
|
||||||
owner: state.targetRepository?.owner,
|
|
||||||
repo: state.targetRepository?.repo,
|
|
||||||
},
|
|
||||||
config: {
|
config: {
|
||||||
recursion_limit: 400,
|
recursion_limit: 400,
|
||||||
configurable: getCustomConfigurableFields(config),
|
configurable: getCustomConfigurableFields(config),
|
||||||
|
|
|
||||||
|
|
@ -190,11 +190,6 @@ webhooks.on("issues.labeled", async ({ payload }) => {
|
||||||
const run = await langGraphClient.runs.create(threadId, MANAGER_GRAPH_ID, {
|
const run = await langGraphClient.runs.create(threadId, MANAGER_GRAPH_ID, {
|
||||||
input: runInput,
|
input: runInput,
|
||||||
config,
|
config,
|
||||||
metadata: {
|
|
||||||
source: "github_webhook:issue_label",
|
|
||||||
owner: issueData.owner,
|
|
||||||
repo: issueData.repo,
|
|
||||||
},
|
|
||||||
ifNotExists: "create",
|
ifNotExists: "create",
|
||||||
streamResumable: true,
|
streamResumable: true,
|
||||||
streamMode: OPEN_SWE_STREAM_MODE as StreamMode[],
|
streamMode: OPEN_SWE_STREAM_MODE as StreamMode[],
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,16 @@
|
||||||
import { parsePartialJson } from "@langchain/core/output_parsers";
|
import { parsePartialJson } from "@langchain/core/output_parsers";
|
||||||
import {
|
import {
|
||||||
AIMessage,
|
AIMessage,
|
||||||
Checkpoint,
|
|
||||||
Message,
|
Message,
|
||||||
StreamMode,
|
StreamMode,
|
||||||
ToolMessage,
|
ToolMessage,
|
||||||
} from "@langchain/langgraph-sdk";
|
} from "@langchain/langgraph-sdk";
|
||||||
import { getContentString } from "../utils";
|
import { getContentString } from "../utils";
|
||||||
import { BranchSwitcher, CommandBar } from "./shared";
|
|
||||||
import { MarkdownText } from "../markdown-text";
|
import { MarkdownText } from "../markdown-text";
|
||||||
import {
|
import {
|
||||||
LoadExternalComponent,
|
LoadExternalComponent,
|
||||||
UIMessage,
|
UIMessage,
|
||||||
} from "@langchain/langgraph-sdk/react-ui";
|
} from "@langchain/langgraph-sdk/react-ui";
|
||||||
import { cn } from "@/lib/utils";
|
|
||||||
import { ToolCalls, ToolResult } from "./tool-calls";
|
import { ToolCalls, ToolResult } from "./tool-calls";
|
||||||
import { MessageContentComplex } from "@langchain/core/messages";
|
import { MessageContentComplex } from "@langchain/core/messages";
|
||||||
import { Fragment } from "react/jsx-runtime";
|
import { Fragment } from "react/jsx-runtime";
|
||||||
|
|
@ -345,19 +342,6 @@ export function mapToolMessageToActionStepProps(
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const attemptParseOwnerRepo = (repoQueryParam: string) => {
|
|
||||||
try {
|
|
||||||
if (!repoQueryParam || !repoQueryParam.includes("/")) {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
const [owner, repo] = repoQueryParam.split("/");
|
|
||||||
return { owner, repo };
|
|
||||||
} catch {
|
|
||||||
// no-op
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export function AssistantMessage({
|
export function AssistantMessage({
|
||||||
message,
|
message,
|
||||||
threadId,
|
threadId,
|
||||||
|
|
@ -377,7 +361,6 @@ export function AssistantMessage({
|
||||||
modifyRunId?: (runId: string) => Promise<void>;
|
modifyRunId?: (runId: string) => Promise<void>;
|
||||||
requestHelpEvents?: CustomNodeEvent[];
|
requestHelpEvents?: CustomNodeEvent[];
|
||||||
}) {
|
}) {
|
||||||
const [repo] = useQueryState("repo");
|
|
||||||
const content = message?.content ?? [];
|
const content = message?.content ?? [];
|
||||||
|
|
||||||
const handleHumanHelpResponse = async (response: string) => {
|
const handleHumanHelpResponse = async (response: string) => {
|
||||||
|
|
@ -388,15 +371,8 @@ export function AssistantMessage({
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const ownerRepo = attemptParseOwnerRepo(repo ?? "");
|
|
||||||
|
|
||||||
const newRun = await thread.client.runs.create(threadId, assistantId, {
|
const newRun = await thread.client.runs.create(threadId, assistantId, {
|
||||||
command: { resume: humanResponse },
|
command: { resume: humanResponse },
|
||||||
metadata: {
|
|
||||||
source: "web:interrupt_response",
|
|
||||||
owner: ownerRepo?.owner,
|
|
||||||
repo: ownerRepo?.repo,
|
|
||||||
},
|
|
||||||
config: {
|
config: {
|
||||||
recursion_limit: 400,
|
recursion_limit: 400,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -96,11 +96,6 @@ export function TerminalInput({
|
||||||
MANAGER_GRAPH_ID,
|
MANAGER_GRAPH_ID,
|
||||||
{
|
{
|
||||||
input: runInput,
|
input: runInput,
|
||||||
metadata: {
|
|
||||||
source: "web:start_manager",
|
|
||||||
owner: selectedRepository.owner,
|
|
||||||
repo: selectedRepository.repo,
|
|
||||||
},
|
|
||||||
config: {
|
config: {
|
||||||
recursion_limit: 400,
|
recursion_limit: 400,
|
||||||
configurable: {
|
configurable: {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue