fix: typos in docs and code
This commit is contained in:
9 files changed
+15
-15
No files matched your search
+3
-3
@@ -214,7 +214,7 @@ export class Cline {
|
||||
private async addToClineMessages(message: ClineMessage) {
|
||||
// these values allow us to reconstruct the conversation history at the time this cline message was created
|
||||
// it's important that apiConversationHistory is initialized before we add cline messages
|
||||
message.conversationHistoryIndex = this.apiConversationHistory.length - 1 // NOTE: this is the index of the last added message which is the user message, and once the clinemessages have been presented we update the apiconversationhistory with the completed assistant message. This means when reseting to a message, we need to +1 this index to get the correct assistant message that this tool use corresponds to
|
||||
message.conversationHistoryIndex = this.apiConversationHistory.length - 1 // NOTE: this is the index of the last added message which is the user message, and once the clinemessages have been presented we update the apiconversationhistory with the completed assistant message. This means when resetting to a message, we need to +1 this index to get the correct assistant message that this tool use corresponds to
|
||||
message.conversationHistoryDeletedRange = this.conversationHistoryDeletedRange
|
||||
this.clineMessages.push(message)
|
||||
await this.saveClineMessages()
|
||||
@@ -1386,7 +1386,7 @@ export class Cline {
|
||||
|
||||
if (!block.partial) {
|
||||
// Some models add code block artifacts (around the tool calls) which show up at the end of text content
|
||||
// matches ``` with atleast one char after the last backtick, at the end of the string
|
||||
// matches ``` with at least one char after the last backtick, at the end of the string
|
||||
const match = content?.trimEnd().match(/```[a-zA-Z0-9_-]+$/)
|
||||
if (match) {
|
||||
const matchLength = match[0].length
|
||||
@@ -2773,7 +2773,7 @@ export class Cline {
|
||||
if (!block.partial || this.didRejectTool || this.didAlreadyUseTool) {
|
||||
// block is finished streaming and executing
|
||||
if (this.currentStreamingContentIndex === this.assistantMessageContent.length - 1) {
|
||||
// its okay that we increment if !didCompleteReadingStream, it'll just return bc out of bounds and as streaming continues it will call presentAssitantMessage if a new block is ready. if streaming is finished then we set userMessageContentReady to true when out of bounds. This gracefully allows the stream to continue on and all potential content blocks be presented.
|
||||
// its okay that we increment if !didCompleteReadingStream, it'll just return bc out of bounds and as streaming continues it will call presentAssistantMessage if a new block is ready. if streaming is finished then we set userMessageContentReady to true when out of bounds. This gracefully allows the stream to continue on and all potential content blocks be presented.
|
||||
// last block is complete and it is finished executing
|
||||
this.userMessageContentReady = true // will allow pwaitfor to continue
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ export function getNextTruncationRange(
|
||||
let rangeEndIndex = startOfRest + messagesToRemove - 1
|
||||
|
||||
// Make sure the last message being removed is a user message, so that the next message after the initial task message is an assistant message. This preservers the user-assistant-user-assistant structure.
|
||||
// NOTE: anthropic format messages are always user-assitant-user-assistant, while openai format messages can have multiple user messages in a row (we use anthropic format throughout cline)
|
||||
// NOTE: anthropic format messages are always user-assistant-user-assistant, while openai format messages can have multiple user messages in a row (we use anthropic format throughout cline)
|
||||
if (messages[rangeEndIndex].role !== "user") {
|
||||
rangeEndIndex -= 1
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
||||
webviewView.webview.html = this.getHtmlContent(webviewView.webview)
|
||||
|
||||
// Sets up an event listener to listen for messages passed from the webview view context
|
||||
// and executes code based on the message that is recieved
|
||||
// and executes code based on the message that is received
|
||||
this.setWebviewMessageListener(webviewView.webview)
|
||||
|
||||
// Logs show up in bottom panel > Debug Console
|
||||
@@ -243,7 +243,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
||||
}
|
||||
|
||||
async initClineWithTask(task?: string, images?: string[]) {
|
||||
await this.clearTask() // ensures that an exising task doesn't exist before starting a new one, although this shouldn't be possible since user must clear task before starting a new one
|
||||
await this.clearTask() // ensures that an existing task doesn't exist before starting a new one, although this shouldn't be possible since user must clear task before starting a new one
|
||||
const { apiConfiguration, customInstructions, autoApprovalSettings, browserSettings, chatSettings } =
|
||||
await this.getState()
|
||||
this.cline = new Cline(
|
||||
@@ -357,7 +357,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
||||
|
||||
/**
|
||||
* Sets up an event listener to listen for messages passed from the webview context and
|
||||
* executes code based on the message that is recieved.
|
||||
* executes code based on the message that is received.
|
||||
*
|
||||
* @param webview A reference to the extension webview
|
||||
*/
|
||||
@@ -1184,7 +1184,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
||||
Now that we use retainContextWhenHidden, we don't have to store a cache of cline messages in the user's state, but we could to reduce memory footprint in long conversations.
|
||||
|
||||
- We have to be careful of what state is shared between ClineProvider instances since there could be multiple instances of the extension running at once. For example when we cached cline messages using the same key, two instances of the extension could end up using the same key and overwriting each other's messages.
|
||||
- Some state does need to be shared between the instances, i.e. the API key--however there doesn't seem to be a good way to notfy the other instances that the API key has changed.
|
||||
- Some state does need to be shared between the instances, i.e. the API key--however there doesn't seem to be a good way to notify the other instances that the API key has changed.
|
||||
|
||||
We need to use a unique identifier for each ClineProvider instance's message cache since we could be running several instances of the extension outside of just the sidebar i.e. in editor panels.
|
||||
|
||||
|
||||
Reference in new issue
Block a user