Skip to content

Commit

Permalink
✨ Added preliminary noisy notifications (#315)
Browse files Browse the repository at this point in the history
Ref: konveyor/kai#596

---------

Signed-off-by: JonahSussman <[email protected]>
  • Loading branch information
JonahSussman authored Feb 4, 2025
1 parent d9c7f75 commit ab5db20
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions vscode/src/client/analyzerClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import { countIncidentsOnPaths } from "../analysis";
import { KaiRpcApplicationConfig } from "./types";
import { getModelProvider, ModelProvider } from "./modelProvider";
import { tracer } from "./tracer";
import { v4 as uuidv4 } from "uuid";

export class AnalyzerClient {
private kaiRpcServer: ChildProcessWithoutNullStreams | null = null;
Expand Down Expand Up @@ -149,12 +150,22 @@ export class AnalyzerClient {
new rpc.StreamMessageReader(this.kaiRpcServer.stdout),
new rpc.StreamMessageWriter(this.kaiRpcServer.stdin),
);

Check warning on line 153 in vscode/src/client/analyzerClient.ts

View workflow job for this annotation

GitHub Actions / Build (linux)

Delete `····`

Check warning on line 153 in vscode/src/client/analyzerClient.ts

View workflow job for this annotation

GitHub Actions / Build (macos)

Delete `····`

Check warning on line 153 in vscode/src/client/analyzerClient.ts

View workflow job for this annotation

GitHub Actions / Build (windows)

Delete `····`

Check warning on line 153 in vscode/src/client/analyzerClient.ts

View workflow job for this annotation

GitHub Actions / Test (linux)

Delete `····`

Check warning on line 153 in vscode/src/client/analyzerClient.ts

View workflow job for this annotation

GitHub Actions / Test (macos)

Delete `····`

Check warning on line 153 in vscode/src/client/analyzerClient.ts

View workflow job for this annotation

GitHub Actions / Test (windows)

Delete `····`
if (getConfigLoggingTraceMessageConnection()) {
this.rpcConnection.trace(
rpc.Trace.Verbose,
tracer(`${basename(this.kaiRpcServer.spawnfile)} message trace`),
);
}

this.rpcConnection.onNotification("my_progress", (params) => {
if (params.kind === "SimpleChatMessage") {
this.fireSolutionStateChange("sent", params.value.message);
} else {
this.fireSolutionStateChange("sent", JSON.stringify(params));
}
});

this.rpcConnection.listen();
}

Expand Down Expand Up @@ -536,19 +547,24 @@ export class AnalyzerClient {
const maxIterations = getConfigMaxLLMQueries();

try {
// generate a uuid for the request
const chatToken = uuidv4();

const request = {
file_path: "",
incidents,
max_priority: maxPriority,
max_depth: maxDepth,
max_iterations: maxIterations,
chat_token: chatToken,
};

this.outputChannel.appendLine(
`getCodeplanAgentSolution request: ${JSON.stringify(request, null, 2)}`,
);

this.fireSolutionStateChange("sent", "Waiting for the resolution...");

const response: SolutionResponse = await this.rpcConnection!.sendRequest(
"getCodeplanAgentSolution",
request,
Expand Down

0 comments on commit ab5db20

Please sign in to comment.