Commit 8a7eacc
fix(agent-runtime): set isResume based on thread message history (#419)
## Summary
- 修复 `ensureThread` 中 `isResume` 的判断逻辑:当传入 `threadId` 但 thread
中没有历史消息时(如通过 `createThread` 刚创建的空 thread),`isResume` 应为 `false`
- 通过 `store.getThread()` 检查 `thread.messages.length > 0` 来决定 `isResume`
的值
- 更新测试用例,覆盖空 thread 和有历史消息的 thread 两种场景
## Test plan
- [x] 原有测试 "should set isResume=false when no threadId provided" 通过
- [x] 修改测试 "should set isResume=false when threadId provided but thread
has no messages" 通过
- [x] 新增测试 "should set isResume=true when threadId provided and thread
has messages" 通过
- [x] 全部 104 个测试通过
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent c760776 commit 8a7eacc
2 files changed
Lines changed: 24 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
84 | 86 | | |
85 | 87 | | |
86 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
252 | | - | |
| 252 | + | |
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
264 | 284 | | |
265 | 285 | | |
266 | 286 | | |
| |||
0 commit comments