Skip to content

Commit f8a7b56

Browse files
authored
PROTO refactor reportbug (RooCodeInc#3485)
* protos report bug * changeset
1 parent 915555f commit f8a7b56

File tree

12 files changed

+102
-9
lines changed

12 files changed

+102
-9
lines changed

.changeset/rude-cameras-approve.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+
move slash report bug to protos / grpc

proto/build-proto.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const serviceNameMap = {
2929
task: "cline.TaskService",
3030
web: "cline.WebService",
3131
models: "cline.ModelsService",
32+
slash: "cline.SlashService",
3233
// Add new services here - no other code changes needed!
3334
}
3435
const serviceDirs = Object.keys(serviceNameMap).map((serviceKey) => path.join(ROOT_DIR, "src", "core", "controller", serviceKey))

proto/slash.proto

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
syntax = "proto3";
2+
3+
package cline;
4+
option java_package = "bot.cline.proto";
5+
option java_multiple_files = true;
6+
7+
import "common.proto";
8+
9+
// SlashService provides methods for managing slash
10+
service SlashService {
11+
// Sends button click message
12+
rpc reportBug(StringRequest) returns (Empty);
13+
}

src/core/controller/grpc-service-config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { handleStateServiceRequest, handleStateServiceStreamingRequest } from ".
1212
import { handleTaskServiceRequest, handleTaskServiceStreamingRequest } from "./task/index"
1313
import { handleWebServiceRequest, handleWebServiceStreamingRequest } from "./web/index"
1414
import { handleModelsServiceRequest, handleModelsServiceStreamingRequest } from "./models/index"
15+
import { handleSlashServiceRequest, handleSlashServiceStreamingRequest } from "./slash/index"
1516

1617
/**
1718
* Configuration for a service handler
@@ -67,4 +68,8 @@ export const serviceHandlers: Record<string, ServiceHandlerConfig> = {
6768
requestHandler: handleModelsServiceRequest,
6869
streamingHandler: handleModelsServiceStreamingRequest,
6970
},
71+
"cline.SlashService": {
72+
requestHandler: handleSlashServiceRequest,
73+
streamingHandler: handleSlashServiceStreamingRequest,
74+
},
7075
}

src/core/controller/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,6 @@ export class Controller {
274274
case "condense":
275275
this.task?.handleWebviewAskResponse("yesButtonClicked")
276276
break
277-
case "reportBug":
278-
this.task?.handleWebviewAskResponse("yesButtonClicked")
279-
break
280277
case "apiConfiguration":
281278
if (message.apiConfiguration) {
282279
await updateApiConfiguration(this.context, message.apiConfiguration)

src/core/controller/slash/index.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// AUTO-GENERATED FILE - DO NOT MODIFY DIRECTLY
2+
// Generated by proto/build-proto.js
3+
4+
import { createServiceRegistry, ServiceMethodHandler, StreamingMethodHandler } from "../grpc-service"
5+
import { StreamingResponseHandler } from "../grpc-handler"
6+
import { registerAllMethods } from "./methods"
7+
8+
// Create slash service registry
9+
const slashService = createServiceRegistry("slash")
10+
11+
// Export the method handler types and registration function
12+
export type SlashMethodHandler = ServiceMethodHandler
13+
export type SlashStreamingMethodHandler = StreamingMethodHandler
14+
export const registerMethod = slashService.registerMethod
15+
16+
// Export the request handlers
17+
export const handleSlashServiceRequest = slashService.handleRequest
18+
export const handleSlashServiceStreamingRequest = slashService.handleStreamingRequest
19+
export const isStreamingMethod = slashService.isStreamingMethod
20+
21+
// Register all slash methods
22+
registerAllMethods()
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// AUTO-GENERATED FILE - DO NOT MODIFY DIRECTLY
2+
// Generated by proto/build-proto.js
3+
4+
// Import all method implementations
5+
import { registerMethod } from "./index"
6+
import { reportBug } from "./reportBug"
7+
8+
// Register all slash service methods
9+
export function registerAllMethods(): void {
10+
// Register each method with the registry
11+
registerMethod("reportBug", reportBug)
12+
}
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+
* Report bug slash command logic
6+
*/
7+
export async function reportBug(controller: Controller, request: StringRequest): Promise<Empty> {
8+
await controller.task?.handleWebviewAskResponse("yesButtonClicked")
9+
return Empty.create()
10+
}

src/core/task/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3259,7 +3259,7 @@ export class Task {
32593259
await this.say("user_feedback", text ?? "", images)
32603260
pushToolResult(
32613261
formatResponse.toolResult(
3262-
`The user provided feedback on the Github issue generated:\n<feedback>\n${text}\n</feedback>`,
3262+
`The user did not submit the bug, and provided feedback on the Github issue generated instead:\n<feedback>\n${text}\n</feedback>`,
32633263
images,
32643264
),
32653265
)

src/shared/proto/slash.ts

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

0 commit comments

Comments
 (0)