Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/cloud/src/__tests__/TelemetryClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,13 @@ describe("TelemetryClient", () => {
})

const eventProperties = {
appName: "roo-code",
appVersion: "1.0.0",
vscodeVersion: "1.60.0",
platform: "darwin",
editorName: "vscode",
language: "en",
mode: "code",
taskId: "test-task-id",
message: {
ts: 1,
Expand Down
2 changes: 1 addition & 1 deletion packages/types/npm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@roo-code/types",
"version": "1.23.0",
"version": "1.24.0",
"description": "TypeScript type definitions for Roo Code.",
"publishConfig": {
"access": "public",
Expand Down
1 change: 1 addition & 0 deletions packages/types/src/telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export const rooCodeTelemetryEventSchema = z.discriminatedUnion("type", [
z.object({
type: z.literal(TelemetryEventName.TASK_MESSAGE),
properties: z.object({
...telemetryPropertiesSchema.shape,
taskId: z.string(),
message: clineMessageSchema,
}),
Expand Down
11 changes: 8 additions & 3 deletions src/core/task/Task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,8 @@ export class Task extends EventEmitter<ClineEvents> {

private async addToClineMessages(message: ClineMessage) {
this.clineMessages.push(message)
await this.providerRef.deref()?.postStateToWebview()
const provider = this.providerRef.deref()
await provider?.postStateToWebview()
this.emit("message", { action: "created", message })
await this.saveClineMessages()

Expand All @@ -340,7 +341,8 @@ export class Task extends EventEmitter<ClineEvents> {
}

private async updateClineMessage(partialMessage: ClineMessage) {
await this.providerRef.deref()?.postMessageToWebview({ type: "partialMessage", partialMessage })
const provider = this.providerRef.deref()
await provider?.postMessageToWebview({ type: "partialMessage", partialMessage })
this.emit("message", { action: "updated", message: partialMessage })

const shouldCaptureMessage = partialMessage.partial !== true && CloudService.isEnabled()
Expand Down Expand Up @@ -808,7 +810,9 @@ export class Task extends EventEmitter<ClineEvents> {
if (Array.isArray(message.content)) {
const newContent = message.content.map((block) => {
if (block.type === "tool_use") {
// it's important we convert to the new tool schema format so the model doesn't get confused about how to invoke tools
// It's important we convert to the new tool schema
// format so the model doesn't get confused about how to
// invoke tools.
const inputAsXml = Object.entries(block.input as Record<string, string>)
.map(([key, value]) => `<${key}>\n${value}\n</${key}>`)
.join("\n")
Expand Down Expand Up @@ -1503,6 +1507,7 @@ export class Task extends EventEmitter<ClineEvents> {
const rooIgnoreInstructions = this.rooIgnoreController?.getInstructions()

const state = await this.providerRef.deref()?.getState()

const {
browserViewportSize,
mode,
Expand Down