✨ feat(vscode): 历史会话可换 profile 恢复
This commit is contained in:
1 parent
1c3e66bdc7
commit
07b2bf75a0
9 files changed
+177
-34
No files matched your search
@@ -0,0 +1,20 @@
|
||||
export function decideManagedResumeProfile(input: {
|
||||
storedProfile: string | undefined
|
||||
overrideProfile: string | undefined
|
||||
inferredProfile: string | null
|
||||
}): { effective: string | undefined, persist: string | undefined } {
|
||||
const override = input.overrideProfile?.trim() || undefined
|
||||
const stored = input.storedProfile?.trim() || undefined
|
||||
|
||||
if (override) { // ① 行内覆盖:与 store 不同才写回;忽略 jsonl 推断
|
||||
return {
|
||||
effective: override,
|
||||
persist: override !== stored ? override : undefined,
|
||||
}
|
||||
}
|
||||
if (stored) // ② store 已有 → 沿用,不写回
|
||||
return { effective: stored, persist: undefined }
|
||||
if (input.inferredProfile) // ③ 缺 profile 才用 jsonl 回填并写回
|
||||
return { effective: input.inferredProfile, persist: input.inferredProfile }
|
||||
return { effective: undefined, persist: undefined }
|
||||
}
|
||||
Reference in new issue
Block a user