feat(claude): 纯本地后台任务运行时允许继续对话
- Dominant language
- TypeScript
- Stars
- 2.7k
- Forks
- 395
- Avg merge
- 21h 48m
- Merged PRs (30d)
- 776
Description
## 背景
当前 Claude Code 会话执行纯本地后台任务(例如 `local_bash` 轮询 CI、等待文件或等待外部命令完成)时,会话仍保持运行态。任务完成前,用户消息不能真正开启下一轮对话,输入体验上像是被“正在生成”阻塞。
这与 continuation claim 泄漏问题不同:本 issue 讨论的是纯本地任务的产品行为和会话调度策略,不涉及 #1941 的 claim 生命周期修复。
## 当前行为
- `local_bash` 等纯本地检查仍占用当前 turn;
- 会话暂时保持运行态;
- 用户输入无法立即作为新的对话 turn 处理;
- 用户容易误以为模型仍在生成内容。
## 期望行为
对于不调用模型、不会触发 Claude 自动 continuation 的纯本地后台任务:
- 用户可以继续输入并发送消息,或至少消息可以明确排队;
- 纯本地任务继续在后台运行;
- 不允许同一个 Claude Query 中出现互相冲突的并行模型 turn;
- 后台任务完成后,不应因为本地任务本身偷偷触发 continuation;
- UI 应明确区分“前台模型正在生成”和“后台本地任务正在运行”。
## 需要明确的产品/技术决策
1. 用户消息是立即进入新的 Query,还是先排在当前 Query 后面;
2. 本地任务运行时是否允许前台模型 turn 与本地任务并行;
3. 本地任务结束时是否需要向当前会话注入结果;
4. UI 使用“后台任务运行中”“消息已排队”等哪种状态表达;
5. `local_agent` / `local_workflow` 等可能触发模型自动 continuation 的任务,是否采用不同规则。
## 非目标
- 不回退或削弱 continuation claim 的并发保护;
- 不改变 #1941 / #1932 / #1915 的修复;
- 不把可能触发模型自动 continuation 的 Agent/workflow 任务与纯本地任务混为一谈。
## 相关
- PR #2039
- #1941
- #1932
- #1915
Contributor guide
Research direction
No source files, tests, or entry points are named. Start by reviewing PR #2039 and the related issues #1941, #1932, and #1915, then resolve the listed product and scheduling decisions before locating the implementation. Done means pure local tasks can run in the background with clear UI state and without conflicting or unintended model continuation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- full-stack
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100