Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
9 changes: 8 additions & 1 deletion packages/cloud/src/__tests__/TelemetryClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,14 +355,21 @@ describe("TelemetryClient", () => {
)
})

it("should attempt to capture TASK_MESSAGE events when recordTaskMessages is true", async () => {
it.only("should attempt to capture TASK_MESSAGE events when recordTaskMessages is true", async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the use of it.only to avoid excluding other tests from running in the full test suite.

Suggested change
it.only("should attempt to capture TASK_MESSAGE events when recordTaskMessages is true", async () => {
it("should attempt to capture TASK_MESSAGE events when recordTaskMessages is true", async () => {

mockSettingsService.getSettings.mockReturnValue({
cloudSettings: {
recordTaskMessages: true,
},
})

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
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
Loading