✨ feat(vscode): 设置面板可配头脑风暴/实施/测试会话的默认 profile

三类会话的 profile 此前只有工单级字段,留空就硬编码落到 official,
想整体换模型只能一个工单一个工单改。

设置面板新增三个下拉,与冲突解决/提交/改动说明的 profile 选择同区。
解析链路变成:工单级字段 > 对应的全局默认设置 > getDefaultProfilePath(),
三类之间仍互不回退。新建工单的头脑风暴会话也走同一条链路。

Claude-Session: https://claude.ai/code/session_01REdhpbaNyqWASF2HWsnTFv
This commit is contained in:
cruldra committed 2026-09-13 08:59:56 +08:00
1 parent 518d471b7a
commit 958c59e090
11 files changed
+196 -18

No files matched your search

+25
View File
@@ -180,6 +180,15 @@ export interface Settings {
* extension finds the project's first `isResolved` state value and uses that.
*/
youtrackCloseCommand: string
/**
* 头脑风暴会话的默认 Claude profile 绝对路径。工单详情面板里的
* 「头脑风暴配置文件」为空时用它;它也为空才落到 DEFAULT_PROFILE_PATH。
*/
defaultBrainstormProfilePath: string
/** 实施会话的默认 Claude profile;工单级「实施配置文件」为空时用它。 */
defaultImplementProfilePath: string
/** 测试会话的默认 Claude profile;工单级「测试配置文件」为空时用它。 */
defaultTestProfilePath: string
/**
* Claude settings profile path for the conflict-resolution cc session
* (drag to 完成 when PR merge conflicts). Empty = DEFAULT_PROFILE_PATH.
@@ -272,6 +281,9 @@ function defaults(ctx: ExtensionContext): Settings {
youtrackBaseUrl: '',
youtrackProjectShortName: '',
youtrackCloseCommand: '',
defaultBrainstormProfilePath: '',
defaultImplementProfilePath: '',
defaultTestProfilePath: '',
conflictResolutionProfilePath: '',
commitProfilePath: '',
prDiffSummaryProfilePath: '',
@@ -369,6 +381,16 @@ export function getSettings(ctx: ExtensionContext): Settings {
const youtrackCloseCommand = typeof stored.youtrackCloseCommand === 'string'
? stored.youtrackCloseCommand
: base.youtrackCloseCommand
// 三个会话默认 profile:'' 有意义(= 落到 DEFAULT_PROFILE_PATH),不强制回退。
const defaultBrainstormProfilePath = typeof stored.defaultBrainstormProfilePath === 'string'
? stored.defaultBrainstormProfilePath
: base.defaultBrainstormProfilePath
const defaultImplementProfilePath = typeof stored.defaultImplementProfilePath === 'string'
? stored.defaultImplementProfilePath
: base.defaultImplementProfilePath
const defaultTestProfilePath = typeof stored.defaultTestProfilePath === 'string'
? stored.defaultTestProfilePath
: base.defaultTestProfilePath
// conflict-resolution profile: '' is meaningful (= DEFAULT_PROFILE_PATH at
// launch time), so don't coerce. Non-string legacy values collapse to ''.
const conflictResolutionProfilePath = typeof stored.conflictResolutionProfilePath === 'string'
@@ -417,6 +439,9 @@ export function getSettings(ctx: ExtensionContext): Settings {
youtrackBaseUrl,
youtrackProjectShortName,
youtrackCloseCommand,
defaultBrainstormProfilePath,
defaultImplementProfilePath,
defaultTestProfilePath,
conflictResolutionProfilePath,
commitProfilePath,
prDiffSummaryProfilePath,