✨ 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

+3
View File
@@ -544,6 +544,9 @@ export function App() {
initialImplTabPreCreateScript={settings?.implTabPreCreateScript ?? ''}
initialImplTabPostCloseScript={settings?.implTabPostCloseScript ?? ''}
initialSplitNewTerminals={settings?.splitNewTerminals ?? true}
initialDefaultBrainstormProfilePath={settings?.defaultBrainstormProfilePath ?? ''}
initialDefaultImplementProfilePath={settings?.defaultImplementProfilePath ?? ''}
initialDefaultTestProfilePath={settings?.defaultTestProfilePath ?? ''}
initialConflictResolutionProfilePath={settings?.conflictResolutionProfilePath ?? ''}
initialCommitProfilePath={settings?.commitProfilePath ?? ''}
initialPrDiffSummaryProfilePath={settings?.prDiffSummaryProfilePath ?? ''}
@@ -37,6 +37,9 @@ interface SubmitValues {
implTabPreCreateScript: string
implTabPostCloseScript: string
splitNewTerminals: boolean
defaultBrainstormProfilePath: string
defaultImplementProfilePath: string
defaultTestProfilePath: string
conflictResolutionProfilePath: string
commitProfilePath: string
prDiffSummaryProfilePath: string
@@ -87,6 +90,9 @@ export interface SettingsModalProps {
initialImplTabPreCreateScript: string
initialImplTabPostCloseScript: string
initialSplitNewTerminals: boolean
initialDefaultBrainstormProfilePath: string
initialDefaultImplementProfilePath: string
initialDefaultTestProfilePath: string
initialConflictResolutionProfilePath: string
initialCommitProfilePath: string
initialPrDiffSummaryProfilePath: string
@@ -173,6 +179,9 @@ export function SettingsModal({
initialImplTabPreCreateScript,
initialImplTabPostCloseScript,
initialSplitNewTerminals,
initialDefaultBrainstormProfilePath,
initialDefaultImplementProfilePath,
initialDefaultTestProfilePath,
initialConflictResolutionProfilePath,
initialCommitProfilePath,
initialPrDiffSummaryProfilePath,
@@ -211,6 +220,9 @@ export function SettingsModal({
const [implTabPreCreateScript, setImplTabPreCreateScript] = useState(initialImplTabPreCreateScript)
const [implTabPostCloseScript, setImplTabPostCloseScript] = useState(initialImplTabPostCloseScript)
const [splitNewTerminals, setSplitNewTerminals] = useState(initialSplitNewTerminals)
const [defaultBrainstormProfilePath, setDefaultBrainstormProfilePath] = useState(initialDefaultBrainstormProfilePath)
const [defaultImplementProfilePath, setDefaultImplementProfilePath] = useState(initialDefaultImplementProfilePath)
const [defaultTestProfilePath, setDefaultTestProfilePath] = useState(initialDefaultTestProfilePath)
const [conflictResolutionProfilePath, setConflictResolutionProfilePath] = useState(initialConflictResolutionProfilePath)
const [commitProfilePath, setCommitProfilePath] = useState(initialCommitProfilePath)
const [prDiffSummaryProfilePath, setPrDiffSummaryProfilePath] = useState(initialPrDiffSummaryProfilePath)
@@ -251,6 +263,9 @@ export function SettingsModal({
setImplTabPreCreateScript(initialImplTabPreCreateScript)
setImplTabPostCloseScript(initialImplTabPostCloseScript)
setSplitNewTerminals(initialSplitNewTerminals)
setDefaultBrainstormProfilePath(initialDefaultBrainstormProfilePath)
setDefaultImplementProfilePath(initialDefaultImplementProfilePath)
setDefaultTestProfilePath(initialDefaultTestProfilePath)
setConflictResolutionProfilePath(initialConflictResolutionProfilePath)
setCommitProfilePath(initialCommitProfilePath)
setPrDiffSummaryProfilePath(initialPrDiffSummaryProfilePath)
@@ -342,6 +357,10 @@ export function SettingsModal({
implTabPreCreateScript: implTabPreCreateScript.trim(),
implTabPostCloseScript: implTabPostCloseScript.trim(),
splitNewTerminals,
// 三个会话默认 profile:空串 = 落到 DEFAULT_PROFILE_PATH
defaultBrainstormProfilePath: defaultBrainstormProfilePath.trim(),
defaultImplementProfilePath: defaultImplementProfilePath.trim(),
defaultTestProfilePath: defaultTestProfilePath.trim(),
// 冲突解决 profile:空串 = 用 DEFAULT_PROFILE_PATH
conflictResolutionProfilePath: conflictResolutionProfilePath.trim(),
// 提交代码 profile:空串 = 未配置 → 提交严格失败
@@ -528,6 +547,78 @@ export function SettingsModal({
/>
</Field>
<Field
label="头脑风暴默认配置文件"
hint={(
<>
新建工单 / 续聊的头脑风暴会话默认用此 profile;工单详情面板里的「头脑风暴配置文件」优先级更高。留空用 official。
</>
)}
>
<SelectMenu
value={defaultBrainstormProfilePath}
onChange={setDefaultBrainstormProfilePath}
variant="input"
className={inputClass}
options={[
{ value: '', label: '(默认)' },
...profiles.map(p => ({ value: p.path, label: p.name })),
...(defaultBrainstormProfilePath
&& !profiles.some(p => p.path === defaultBrainstormProfilePath)
? [{ value: defaultBrainstormProfilePath, label: `自定义:${defaultBrainstormProfilePath}` }]
: []),
]}
/>
</Field>
<Field
label="实施默认配置文件"
hint={(
<>
实施会话默认用此 profile;工单详情面板里的「实施配置文件」优先级更高。留空用 official。
</>
)}
>
<SelectMenu
value={defaultImplementProfilePath}
onChange={setDefaultImplementProfilePath}
variant="input"
className={inputClass}
options={[
{ value: '', label: '(默认)' },
...profiles.map(p => ({ value: p.path, label: p.name })),
...(defaultImplementProfilePath
&& !profiles.some(p => p.path === defaultImplementProfilePath)
? [{ value: defaultImplementProfilePath, label: `自定义:${defaultImplementProfilePath}` }]
: []),
]}
/>
</Field>
<Field
label="测试默认配置文件"
hint={(
<>
测试会话默认用此 profile;工单详情面板里的「测试配置文件」优先级更高。留空用 official。
</>
)}
>
<SelectMenu
value={defaultTestProfilePath}
onChange={setDefaultTestProfilePath}
variant="input"
className={inputClass}
options={[
{ value: '', label: '(默认)' },
...profiles.map(p => ({ value: p.path, label: p.name })),
...(defaultTestProfilePath
&& !profiles.some(p => p.path === defaultTestProfilePath)
? [{ value: defaultTestProfilePath, label: `自定义:${defaultTestProfilePath}` }]
: []),
]}
/>
</Field>
<Field
label="冲突解决配置文件"
hint={(
+12
View File
@@ -55,6 +55,9 @@ export interface SettingsValues {
implTabPreCreateScript: string
implTabPostCloseScript: string
splitNewTerminals: boolean
defaultBrainstormProfilePath: string
defaultImplementProfilePath: string
defaultTestProfilePath: string
conflictResolutionProfilePath: string
commitProfilePath: string
prDiffSummaryProfilePath: string
@@ -91,6 +94,9 @@ export interface SettingsOverlayState {
implTabPreCreateScript: string
implTabPostCloseScript: string
splitNewTerminals: boolean
defaultBrainstormProfilePath: string
defaultImplementProfilePath: string
defaultTestProfilePath: string
conflictResolutionProfilePath: string
commitProfilePath: string
prDiffSummaryProfilePath: string
@@ -422,6 +428,9 @@ export function useIssues(): UseIssuesResult {
implTabPreCreateScript: values.implTabPreCreateScript,
implTabPostCloseScript: values.implTabPostCloseScript,
splitNewTerminals: values.splitNewTerminals,
defaultBrainstormProfilePath: values.defaultBrainstormProfilePath,
defaultImplementProfilePath: values.defaultImplementProfilePath,
defaultTestProfilePath: values.defaultTestProfilePath,
conflictResolutionProfilePath: values.conflictResolutionProfilePath,
commitProfilePath: values.commitProfilePath,
prDiffSummaryProfilePath: values.prDiffSummaryProfilePath,
@@ -824,6 +833,9 @@ export function useIssues(): UseIssuesResult {
implTabPreCreateScript: msg.implTabPreCreateScript,
implTabPostCloseScript: msg.implTabPostCloseScript,
splitNewTerminals: msg.splitNewTerminals,
defaultBrainstormProfilePath: msg.defaultBrainstormProfilePath,
defaultImplementProfilePath: msg.defaultImplementProfilePath,
defaultTestProfilePath: msg.defaultTestProfilePath,
conflictResolutionProfilePath: msg.conflictResolutionProfilePath,
commitProfilePath: msg.commitProfilePath,
prDiffSummaryProfilePath: msg.prDiffSummaryProfilePath,
+6
View File
@@ -117,6 +117,9 @@ export type ExtensionToWebview
implTabPreCreateScript: string
implTabPostCloseScript: string
splitNewTerminals: boolean
defaultBrainstormProfilePath: string
defaultImplementProfilePath: string
defaultTestProfilePath: string
conflictResolutionProfilePath: string
commitProfilePath: string
prDiffSummaryProfilePath: string
@@ -196,6 +199,9 @@ export type WebviewToExtension
implTabPreCreateScript: string
implTabPostCloseScript: string
splitNewTerminals: boolean
defaultBrainstormProfilePath: string
defaultImplementProfilePath: string
defaultTestProfilePath: string
conflictResolutionProfilePath: string
commitProfilePath: string
prDiffSummaryProfilePath: string