[Feature] 支持首次添加项目后预先配置工具开关
- Dominant language
- TypeScript
- Stars
- 2.7k
- Forks
- 395
- Avg merge
- 21h 48m
- Merged PRs (30d)
- 776
Description
## 使用场景 / Use case
用户在开始首个会话前,希望先为刚添加的项目设置内置工具开关,例如关闭协同模式或启用特定工具;设置应在该项目后续创建的会话中生效。
## 当前问题 / Current limitation
首次添加本地项目后,若尚未发送首条消息创建会话,“设置 → 工具”的作用域下拉仅显示“新对话默认值”,不显示刚添加的项目。因此用户无法在创建首个会话前写入项目级工具设置。
源码定位:项目选择只通过 `patchNewMakerDraft({ workingDir })` 保存到临时草稿;工具页的项目候选仅来自当前已激活会话的工作目录和 `recent_workdirs`。而 `recent_workdirs` 只在项目会话创建或更新后写入,导致该首次项目在无会话时不可选。
## 期望方案 / Proposed solution
工具页的项目作用域候选应包含当前新对话草稿中已选择的本地项目,或在用户首次添加项目时以不依赖会话创建的方式使其可被工具页识别。
验收:选择一个此前未使用过的本地项目后,在不发送消息、不创建会话的情况下打开“设置 → 工具”,作用域下拉可选择该项目;对该项目设置的工具开关在随后创建的该项目会话中生效;“新对话默认值”作用域行为保持不变。
## 已考虑的替代方案 / Alternatives considered
先发送一条消息以创建会话后再配置工具可以绕过问题,但会迫使用户在完成项目级配置前启动会话,不满足预配置场景。
Contributor guide
Research direction
Start by tracing where patchNewMakerDraft({ workingDir }) stores the new-project selection and where the tools settings scope candidates are built from the active session and recent_workdirs. Make a newly selected local project appear in the scope dropdown before any message or session is created, preserve the new-conversation default scope, and verify that the setting applies when the first project session is later created.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100