forked from slopus/happy-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconcurrent_fix_patch.txt
More file actions
44 lines (38 loc) · 1.29 KB
/
Copy pathconcurrent_fix_patch.txt
File metadata and controls
44 lines (38 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// 并发问题修复补丁 - startAhaServer.ts
// 问题1: 传入undefined清空header元数据
// 问题2: 状态不匹配 ('in_progress' vs 'in-progress')
// 修复1: create_task (第567行附近)
// 原始代码(有问题):
// await api.updateArtifact(teamId, undefined, newBody, undefined, artifact.bodyVersion);
// 修复后的代码:
await api.updateArtifact(
teamId,
artifact.header, // 保留现有header metadata
newBody,
undefined,
artifact.bodyVersion
);
// 修复2: update_task (第711行附近)
// 原始代码(有问题):
// await api.updateArtifact(teamId, undefined, newBody, undefined, artifact.bodyVersion);
// 修复后的代码:
await api.updateArtifact(
teamId,
artifact.header, // 保留现有header metadata
newBody,
undefined,
artifact.bodyVersion
);
// 修复3: 状态匹配问题 - list_tasks工具
// 问题:UI显示'in_progress',后端保存'in-progress'
// 修复:统一状态字符串
const normalizeStatus = (status: string): string => {
if (!status) return null;
return status === 'in_progress' ? 'in-progress' : status;
};
// 在create_task和update_task中使用:
const normalizedStatus = normalizeStatus(status);
const newBody = {
...artifact.body,
status: normalizedStatus || 'todo', // 默认状态
};