Skip to content

Commit d88c07c

Browse files
authored
PROTO refactor condense tool (RooCodeInc#3489)
* proto for condense * changeset * condense text
1 parent 5ee5577 commit d88c07c

File tree

7 files changed

+27
-7
lines changed

7 files changed

+27
-7
lines changed

.changeset/brown-dots-sip.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"claude-dev": patch
3+
---
4+
5+
convert condense command to use grpc

proto/slash.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ import "common.proto";
1010
service SlashService {
1111
// Sends button click message
1212
rpc reportBug(StringRequest) returns (Empty);
13+
rpc condense(StringRequest) returns (Empty);
1314
}

src/core/controller/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,6 @@ export class Controller {
271271
// initializing new instance of Cline will make sure that any agentically running promises in old instance don't affect our new task. this essentially creates a fresh slate for the new task
272272
await this.initTask(message.text, message.images)
273273
break
274-
case "condense":
275-
this.task?.handleWebviewAskResponse("yesButtonClicked")
276-
break
277274
case "apiConfiguration":
278275
if (message.apiConfiguration) {
279276
await updateApiConfiguration(this.context, message.apiConfiguration)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Controller } from ".."
2+
import { StringRequest, Empty } from "../../../shared/proto/common"
3+
4+
/**
5+
* Command slash command logic
6+
*/
7+
export async function condense(controller: Controller, request: StringRequest): Promise<Empty> {
8+
await controller.task?.handleWebviewAskResponse("yesButtonClicked")
9+
return Empty.create()
10+
}

src/core/controller/slash/methods.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33

44
// Import all method implementations
55
import { registerMethod } from "./index"
6+
import { condense } from "./condense"
67
import { reportBug } from "./reportBug"
78

89
// Register all slash service methods
910
export function registerAllMethods(): void {
1011
// Register each method with the registry
12+
registerMethod("condense", condense)
1113
registerMethod("reportBug", reportBug)
1214
}

src/shared/proto/slash.ts

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/components/chat/ChatView.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -556,10 +556,7 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
556556
})
557557
break
558558
case "condense":
559-
vscode.postMessage({
560-
type: "condense",
561-
text: lastMessage?.text,
562-
})
559+
await SlashServiceClient.condense({ value: lastMessage?.text }).catch((err) => console.error(err))
563560
break
564561
case "report_bug":
565562
await SlashServiceClient.reportBug({ value: lastMessage?.text }).catch((err) => console.error(err))

0 commit comments

Comments
 (0)