🐛 fix(vscode): 修复看板缓存并增加问答默认模型

This commit is contained in:
cruldra committed 2026-10-09 17:00:43 -04:00
1 parent c38f1dc468
commit 012daf95b5
25 files changed
+1753 -164

No files matched your search

+15 -2
View File
@@ -1,4 +1,5 @@
import type { CustomTextEditorProvider, Disposable, DocumentSymbol, Event, TextDocument, TextDocumentShowOptions, WebviewPanel } from 'vscode'
import type { ClaudeProfile } from '../../cc/profiles'
import type { ClaudeImage } from '../../cc/spawnClaude'
import type { CommentEdit, RewriteOutcome, WriteResult } from '../commentRewrite'
import type { BlockKind, LocalSymbol, RuleLocation, RuleReference, SourceRange, WorkspaceIndex } from '../contract'
@@ -547,7 +548,13 @@ class Preview {
await this.ask(msg.askId, msg.anchor, msg.question, msg.images)
return
case 'selectAskProfile':
await this.owner.qa.profiles.select(msg.id)
try {
await this.owner.qa.profiles.select(msg.id)
}
catch (err) {
void window.showErrorMessage(err instanceof Error ? err.message : String(err))
await this.postProfiles()
}
return
case 'stopAsk':
this.owner.qa.stop(msg.askId)
@@ -968,7 +975,13 @@ class Preview {
return failed('文件还有没保存的修改,模型读的是磁盘上的文件:先保存再重写注释。')
const at = locate(document.uri)
const cwd = at?.folder.uri.fsPath ?? dirname(document.uri.fsPath)
const profile = await this.owner.qa.profiles.current()
let profile: ClaudeProfile | undefined
try {
profile = await this.owner.qa.profiles.current()
}
catch (err) {
return failed(err instanceof Error ? err.message : String(err))
}
if (signal.aborted)
return { status: 'stopped' }
let question = ''