Allow messages with images and no text

This commit is contained in:
Saoud Rizwan
2024-08-10 02:17:43 -04:00
parent 7da81f651d
commit 60ca8baecb
3 changed files with 10 additions and 12 deletions

View File

@@ -133,15 +133,15 @@ export class ClaudeDevProvider implements vscode.WebviewViewProvider {
this.outputChannel.appendLine("Webview view resolved")
}
async initClaudeDevWithTask(task: string, images?: string[]) {
async initClaudeDevWithTask(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
const { apiProvider, apiKey, openRouterApiKey, awsAccessKey, awsSecretKey, awsRegion, maxRequestsPerTask } =
await this.getState()
this.claudeDev = new ClaudeDev(
this,
task,
{ apiProvider, apiKey, openRouterApiKey, awsAccessKey, awsSecretKey, awsRegion },
maxRequestsPerTask,
task,
images
)
}
@@ -254,7 +254,7 @@ export class ClaudeDevProvider implements vscode.WebviewViewProvider {
// Could also do this in extension .ts
//this.postMessageToWebview({ type: "text", text: `Extension: ${Date.now()}` })
// initializing new instance of ClaudeDev will make sure that any agentically running promises in old instance don't affect our new task. this essentially creates a fresh slate for the new task
await this.initClaudeDevWithTask(message.text!, message.images)
await this.initClaudeDevWithTask(message.text, message.images)
break
case "apiConfiguration":
if (message.apiConfiguration) {