fix: protect task_uuid from DispatchContext overwrite and update acceptance criteria
CI / fmt (pull_request) Successful in 4m44s
CI / test (pull_request) Successful in 12m48s

- 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:
2026-04-28 07:01:20 +07:00
co-authored by Claude Opus 4.7
parent 562d3b01c3
commit 5e7a479991
2 changed files with 8 additions and 3 deletions
+3 -1
View File
@@ -204,7 +204,9 @@ func buildDispatchMetadata(task *database.Task) map[string]string {
var ctx map[string]string
if err := json.Unmarshal([]byte(task.DispatchContext), &ctx); err == nil {
for k, v := range ctx {
metadata[k] = v
if k != "task_uuid" {
metadata[k] = v
}
}
}
}
+5 -2
View File
@@ -168,7 +168,7 @@ Ví dụ:
3. OpenClaw/SMTP retry đúng thứ tự 1s -> 5s -> 15s.
4. Hết retry thì `FAILED` và có `last_error`.
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
@@ -177,4 +177,7 @@ Ví dụ:
3. SMTP fail hết retry -> `FAILED`, có `last_error`.
4. Callback sai token -> 401, state không đổ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.