De-dup protocols

This commit is contained in:
chezsmithy 2025-04-15 21:07:38 -07:00
parent 97ba89eae4
commit 324d76f4a8
6 changed files with 4 additions and 22 deletions

View file

@ -687,8 +687,8 @@ export class Core {
}
// Define a callback for streaming output updates
const onPartialOutput = (params: {
toolCallId: string,
const onPartialOutput = (params: {
toolCallId: string,
contextItems: any[]
}) => {
this.messenger.send("toolCallPartialOutput" as any, params);
@ -726,7 +726,7 @@ export class Core {
const { markProcessAsBackgrounded } = await import("./tools/implementations/processState");
markProcessAsBackgrounded(toolCallId);
});
on("process/isBackgrounded", async ({ data: { toolCallId }, messageId }) => {
const { isProcessBackgrounded } = await import("./tools/implementations/processState");
const isBackgrounded = isProcessBackgrounded(toolCallId);
@ -735,13 +735,6 @@ export class Core {
return true; // Return true to indicate the message was handled successfully
});
// Handle partial output updates from tool calls
on("toolCallPartialOutput", ({ data }) => {
// This handler simply forwards the message to the webview
// The actual data processing happens in the Chat component's useWebviewListener
this.send("toolCallPartialOutput", data);
return;
});
}
private async isItemTooBig(item: ContextItemWithId) {

View file

@ -44,10 +44,6 @@ export type ToCoreFromIdeOrWebviewProtocol = {
// Special
ping: [string, string];
abort: [undefined, void];
toolCallPartialOutput: [
{ toolCallId: string; contextItems: any[] },
void,
];
// History
"history/list": [ListHistoryOptions, SessionMetadata[]];

View file

@ -7,9 +7,5 @@ export type ToCoreFromWebviewProtocol = ToCoreFromIdeOrWebviewProtocol & {
{ id: string | null; profileId?: string | null },
void,
];
toolCallPartialOutput: [
{ toolCallId: string; contextItems: any[] },
void,
];
};
export type ToWebviewFromCoreProtocol = ToWebviewFromIdeOrCoreProtocol;

View file

@ -8,7 +8,6 @@ import {
// extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/toolWindow/ContinueBrowser.kt
export const WEBVIEW_TO_CORE_PASS_THROUGH: (keyof ToCoreFromWebviewProtocol)[] =
[
"toolCallPartialOutput",
"ping",
"abort",
"history/list",

View file

@ -109,7 +109,7 @@ export const runTerminalCommandImpl: ToolImpl = async (args, extras) => {
removeBackgroundedProcess(toolCallId);
return;
}
if (!waitForCompletion) {
// Already resolved, just update the UI with final output
if (extras.onPartialOutput) {

View file

@ -277,7 +277,6 @@ export function Chat() {
useWebviewListener(
"toolCallPartialOutput",
async (data) => {
if (data && typeof data === "object" && "toolCallId" in data && "contextItems" in data) {
console.log("toolCallPartialOutput", data);
// Update tool call output in Redux store
dispatch(
@ -286,7 +285,6 @@ export function Chat() {
contextItems: data.contextItems,
}),
);
}
},
[dispatch],
);