Skip to content

Commit dba9116

Browse files
authored
Merge pull request RooCodeInc#1518 from RooVetGit/revert_tool_progress_for_now
Revert tool progress for now
2 parents 85dd1a1 + c9794d2 commit dba9116

File tree

7 files changed

+6
-73
lines changed

7 files changed

+6
-73
lines changed

.changeset/empty-bees-suffer.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"roo-cline": patch
3+
---
4+
5+
Revert tool progress for now

src/core/Cline.ts

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ import {
4848
ClineSay,
4949
ClineSayBrowserAction,
5050
ClineSayTool,
51-
ToolProgressStatus,
5251
} from "../shared/ExtensionMessage"
5352
import { getApiMetrics } from "../shared/getApiMetrics"
5453
import { HistoryItem } from "../shared/HistoryItem"
@@ -409,7 +408,6 @@ export class Cline {
409408
type: ClineAsk,
410409
text?: string,
411410
partial?: boolean,
412-
progressStatus?: ToolProgressStatus,
413411
): Promise<{ response: ClineAskResponse; text?: string; images?: string[] }> {
414412
// If this Cline instance was aborted by the provider, then the only thing keeping us alive is a promise still running in the background, in which case we don't want to send its result to the webview as it is attached to a new instance of Cline now. So we can safely ignore the result of any active promises, and this class will be deallocated. (Although we set Cline = undefined in provider, that simply removes the reference to this instance, but the instance is still alive until this promise resolves or rejects.)
415413
if (this.abort) {
@@ -425,7 +423,6 @@ export class Cline {
425423
// existing partial message, so update it
426424
lastMessage.text = text
427425
lastMessage.partial = partial
428-
lastMessage.progressStatus = progressStatus
429426
// todo be more efficient about saving and posting only new data or one whole message at a time so ignore partial for saves, and only post parts of partial message instead of whole array in new listener
430427
// await this.saveClineMessages()
431428
// await this.providerRef.deref()?.postStateToWebview()
@@ -463,8 +460,6 @@ export class Cline {
463460
// lastMessage.ts = askTs
464461
lastMessage.text = text
465462
lastMessage.partial = false
466-
lastMessage.progressStatus = progressStatus
467-
468463
await this.saveClineMessages()
469464
// await this.providerRef.deref()?.postStateToWebview()
470465
await this.providerRef
@@ -516,7 +511,6 @@ export class Cline {
516511
images?: string[],
517512
partial?: boolean,
518513
checkpoint?: Record<string, unknown>,
519-
progressStatus?: ToolProgressStatus,
520514
): Promise<undefined> {
521515
if (this.abort) {
522516
throw new Error(`Task: ${this.taskNumber} Roo Code instance aborted (#2)`)
@@ -532,7 +526,6 @@ export class Cline {
532526
lastMessage.text = text
533527
lastMessage.images = images
534528
lastMessage.partial = partial
535-
lastMessage.progressStatus = progressStatus
536529
await this.providerRef
537530
.deref()
538531
?.postMessageToWebview({ type: "partialMessage", partialMessage: lastMessage })
@@ -552,7 +545,6 @@ export class Cline {
552545
lastMessage.text = text
553546
lastMessage.images = images
554547
lastMessage.partial = false
555-
lastMessage.progressStatus = progressStatus
556548

557549
// instead of streaming partialMessage events, we do a save and post like normal to persist to disk
558550
await this.saveClineMessages()
@@ -1711,16 +1703,8 @@ export class Cline {
17111703
try {
17121704
if (block.partial) {
17131705
// update gui message
1714-
let toolProgressStatus
1715-
if (this.diffStrategy && this.diffStrategy.getProgressStatus) {
1716-
toolProgressStatus = this.diffStrategy.getProgressStatus(block)
1717-
}
1718-
17191706
const partialMessage = JSON.stringify(sharedMessageProps)
1720-
1721-
await this.ask("tool", partialMessage, block.partial, toolProgressStatus).catch(
1722-
() => {},
1723-
)
1707+
await this.ask("tool", partialMessage, block.partial).catch(() => {})
17241708
break
17251709
} else {
17261710
if (!relPath) {
@@ -1815,14 +1799,6 @@ export class Cline {
18151799
diff: diffContent,
18161800
} satisfies ClineSayTool)
18171801

1818-
let toolProgressStatus
1819-
if (this.diffStrategy && this.diffStrategy.getProgressStatus) {
1820-
toolProgressStatus = this.diffStrategy.getProgressStatus(block, diffResult)
1821-
}
1822-
await this.ask("tool", completeMessage, block.partial, toolProgressStatus).catch(
1823-
() => {},
1824-
)
1825-
18261802
const didApprove = await askApproval("tool", completeMessage)
18271803
if (!didApprove) {
18281804
await this.diffViewProvider.revertChanges() // This likely handles closing the diff view

src/core/diff/strategies/multi-search-replace.ts

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { DiffStrategy, DiffResult } from "../types"
22
import { addLineNumbers, everyLineHasLineNumbers, stripLineNumbers } from "../../../integrations/misc/extract-text"
33
import { distance } from "fastest-levenshtein"
4-
import { ToolProgressStatus } from "../../../shared/ExtensionMessage"
5-
import { ToolUse } from "../../assistant-message"
64

75
const BUFFER_LINES = 40 // Number of extra context lines to show before and after matches
86

@@ -364,27 +362,4 @@ Only use a single line of '=======' between search and replacement content, beca
364362
failParts: diffResults,
365363
}
366364
}
367-
368-
getProgressStatus(toolUse: ToolUse, result?: DiffResult): ToolProgressStatus {
369-
const diffContent = toolUse.params.diff
370-
if (diffContent) {
371-
const icon = "diff-multiple"
372-
const searchBlockCount = (diffContent.match(/SEARCH/g) || []).length
373-
if (toolUse.partial) {
374-
if (diffContent.length < 1000 || (diffContent.length / 50) % 10 === 0) {
375-
return { icon, text: `${searchBlockCount}` }
376-
}
377-
} else if (result) {
378-
if (result.failParts?.length) {
379-
return {
380-
icon,
381-
text: `${searchBlockCount - result.failParts.length}/${searchBlockCount}`,
382-
}
383-
} else {
384-
return { icon, text: `${searchBlockCount}` }
385-
}
386-
}
387-
}
388-
return {}
389-
}
390365
}

src/core/diff/types.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
* Interface for implementing different diff strategies
33
*/
44

5-
import { ToolProgressStatus } from "../../shared/ExtensionMessage"
6-
import { ToolUse } from "../assistant-message"
7-
85
export type DiffResult =
96
| { success: true; content: string; failParts?: DiffResult[] }
107
| ({
@@ -37,6 +34,4 @@ export interface DiffStrategy {
3734
* @returns A DiffResult object containing either the successful result or error details
3835
*/
3936
applyDiff(originalContent: string, diffContent: string, startLine?: number, endLine?: number): Promise<DiffResult>
40-
41-
getProgressStatus?(toolUse: ToolUse, result?: any): ToolProgressStatus
4237
}

src/shared/ExtensionMessage.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ export interface ClineMessage {
155155
reasoning?: string
156156
conversationHistoryIndex?: number
157157
checkpoint?: Record<string, unknown>
158-
progressStatus?: ToolProgressStatus
159158
}
160159

161160
export type ClineAsk =
@@ -275,8 +274,3 @@ export interface HumanRelayCancelMessage {
275274
}
276275

277276
export type ClineApiReqCancelReason = "streaming_failed" | "user_cancelled"
278-
279-
export type ToolProgressStatus = {
280-
icon?: string
281-
text?: string
282-
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ export const ChatRowContent = ({
258258
<span style={{ fontWeight: "bold" }}>Roo wants to edit this file:</span>
259259
</div>
260260
<CodeAccordian
261-
progressStatus={message.progressStatus}
262261
isLoading={message.partial}
263262
diff={tool.diff!}
264263
path={tool.path!}

webview-ui/src/components/common/CodeAccordian.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { memo, useMemo } from "react"
22
import { getLanguageFromPath } from "../../utils/getLanguageFromPath"
33
import CodeBlock, { CODE_BLOCK_BG_COLOR } from "./CodeBlock"
4-
import { ToolProgressStatus } from "../../../../src/shared/ExtensionMessage"
54

65
interface CodeAccordianProps {
76
code?: string
@@ -13,7 +12,6 @@ interface CodeAccordianProps {
1312
isExpanded: boolean
1413
onToggleExpand: () => void
1514
isLoading?: boolean
16-
progressStatus?: ToolProgressStatus
1715
}
1816

1917
/*
@@ -34,7 +32,6 @@ const CodeAccordian = ({
3432
isExpanded,
3533
onToggleExpand,
3634
isLoading,
37-
progressStatus,
3835
}: CodeAccordianProps) => {
3936
const inferredLanguage = useMemo(
4037
() => code && (language ?? (path ? getLanguageFromPath(path) : undefined)),
@@ -98,14 +95,6 @@ const CodeAccordian = ({
9895
</>
9996
)}
10097
<div style={{ flexGrow: 1 }}></div>
101-
{progressStatus && progressStatus.text && (
102-
<>
103-
{progressStatus.icon && <span className={`codicon codicon-${progressStatus.icon} mr-1`} />}
104-
<span className="mr-1 ml-auto text-vscode-descriptionForeground">
105-
{progressStatus.text}
106-
</span>
107-
</>
108-
)}
10998
<span className={`codicon codicon-chevron-${isExpanded ? "up" : "down"}`}></span>
11099
</div>
111100
)}

0 commit comments

Comments
 (0)