fix: protect task_uuid from DispatchContext overwrite and update acceptance criteria
- Skip task_uuid key when merging DispatchContext into dispatch metadata - Update requirements.md acceptance criteria and test matrix for external rules Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -204,9 +204,11 @@ func buildDispatchMetadata(task *database.Task) map[string]string {
|
|||||||
var ctx map[string]string
|
var ctx map[string]string
|
||||||
if err := json.Unmarshal([]byte(task.DispatchContext), &ctx); err == nil {
|
if err := json.Unmarshal([]byte(task.DispatchContext), &ctx); err == nil {
|
||||||
for k, v := range ctx {
|
for k, v := range ctx {
|
||||||
|
if k != "task_uuid" {
|
||||||
metadata[k] = v
|
metadata[k] = v
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return metadata
|
return metadata
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-2
@@ -168,7 +168,7 @@ Ví dụ:
|
|||||||
3. OpenClaw/SMTP retry đúng thứ tự 1s -> 5s -> 15s.
|
3. OpenClaw/SMTP retry đúng thứ tự 1s -> 5s -> 15s.
|
||||||
4. Hết retry thì `FAILED` và có `last_error`.
|
4. Hết retry thì `FAILED` và có `last_error`.
|
||||||
5. Callback sai token trả 401 và không đổi state task.
|
5. Callback sai token trả 401 và không đổi state task.
|
||||||
6. Anti-loop + whitelist + idempotency hoạt động đúng.
|
6. Anti-loop + idempotency + external rules hoạt động đúng thứ tự.
|
||||||
|
|
||||||
10) Test matrix tối thiểu
|
10) Test matrix tối thiểu
|
||||||
|
|
||||||
@@ -177,4 +177,7 @@ Ví dụ:
|
|||||||
3. SMTP fail hết retry -> `FAILED`, có `last_error`.
|
3. SMTP fail hết retry -> `FAILED`, có `last_error`.
|
||||||
4. Callback sai token -> 401, state không đổi.
|
4. Callback sai token -> 401, state không đổi.
|
||||||
5. Duplicate `message_id` -> không tạo task mới.
|
5. Duplicate `message_id` -> không tạo task mới.
|
||||||
6. Sender là chính hệ thống hoặc ngoài whitelist -> `IGNORED`.
|
6. Sender là chính hệ thống -> `IGNORED`.
|
||||||
|
7. Sender ngoài whitelist -> `IGNORED` bởi external rules.
|
||||||
|
8. Sender trong blocklist -> `IGNORED` bởi external rules.
|
||||||
|
9. Rule metadata được truyền qua dispatch context đến OpenClaw.
|
||||||
|
|||||||
Reference in New Issue
Block a user