Files
cline-multi-mirror/src/core/controller/task/taskFeedback.ts
T
pashpashpashandellipsis-dev[bot] 675cd1779b using ulid instead of taskid (#5524)
* using ulid instead of taskid

* protos

* Update src/services/browser/BrowserSession.ts

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

---------

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
2025-08-12 21:19:28 -07:00

29 lines
944 B
TypeScript

import { Controller } from ".."
import { Empty, StringRequest } from "@shared/proto/cline/common"
import { telemetryService } from "@services/posthog/PostHogClientProvider"
/**
* Handles task feedback submission (thumbs up/down)
* @param controller The controller instance
* @param request The StringRequest containing the feedback type ("thumbs_up" or "thumbs_down") in the value field
* @returns Empty response
*/
export async function taskFeedback(controller: Controller, request: StringRequest): Promise<Empty> {
if (!request.value) {
console.warn("taskFeedback: Missing feedback type value")
return Empty.create()
}
try {
if (controller.task?.ulid) {
telemetryService.captureTaskFeedback(controller.task.ulid, request.value as any)
} else {
console.warn("taskFeedback: No active task to receive feedback")
}
} catch (error) {
console.error("Error in taskFeedback handler:", error)
}
return Empty.create()
}