Skip to content
Closed
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
49 changes: 49 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@
"diff-match-patch": "^1.0.5",
"fast-deep-equal": "^3.1.3",
"fastest-levenshtein": "^1.0.16",
"fzf": "^0.5.2",
"get-folder-size": "^5.0.0",
"globby": "^14.0.2",
"isbinaryfile": "^5.0.2",
Expand All @@ -346,6 +347,7 @@
"tmp": "^0.2.3",
"tree-sitter-wasms": "^0.1.11",
"turndown": "^7.2.0",
"vscrui": "^0.2.1",
"web-tree-sitter": "^0.22.6",
"zod": "^3.23.8"
},
Expand Down
7 changes: 5 additions & 2 deletions src/core/Cline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ import { McpHub } from "../services/mcp/McpHub"
import crypto from "crypto"
import { insertGroups } from "./diff/insert-groups"
import { EXPERIMENT_IDS, experiments as Experiments } from "../shared/experiments"
import { logger } from "../utils/logging"

const cwd =
vscode.workspace.workspaceFolders?.map((folder) => folder.uri.fsPath).at(0) ?? path.join(os.homedir(), "Desktop") // may or may not exist but fs checking existence would immediately ask for permission which would be bad UX, need to come up with a better solution
Expand Down Expand Up @@ -597,6 +598,8 @@ export class Cline {

let modifiedOldUserContent: UserContent // either the last message if its user message, or the user message before the last (assistant) message
let modifiedApiConversationHistory: Anthropic.Messages.MessageParam[] // need to remove the last user message to replace with new modified user message
modifiedOldUserContent = []
modifiedApiConversationHistory = []
if (existingApiConversationHistory.length > 0) {
const lastMessage = existingApiConversationHistory[existingApiConversationHistory.length - 1]

Expand Down Expand Up @@ -666,7 +669,7 @@ export class Cline {
throw new Error("Unexpected: Last message is not a user or assistant message")
}
} else {
throw new Error("Unexpected: No existing API conversation history")
logger.debug("Unexpected: No existing API conversation history")
}

let newUserContent: UserContent = [...modifiedOldUserContent]
Expand Down Expand Up @@ -2836,7 +2839,7 @@ export class Cline {
}

const abortStream = async (cancelReason: ClineApiReqCancelReason, streamingFailedMessage?: string) => {
console.log(`[Cline#abortStream] cancelReason = ${cancelReason}`)
logger.debug(`[Cline#abortStream] cancelReason = ${cancelReason}`)

if (this.diffViewProvider.isEditing) {
await this.diffViewProvider.revertChanges() // closes diff view
Expand Down
Loading