autonomy tasks source: enqueue structured tasks.json entries into runtime todo set

This commit is contained in:
DBT
2026-02-28 08:45:41 +00:00
parent 8fbbc6c098
commit 126488af0b

View File

@@ -194,6 +194,23 @@ func (e *Engine) tick() {
known := map[string]struct{}{}
for _, t := range todos {
known[t.ID] = struct{}{}
}
// Merge structured tasks.json entries as todo source too (for WebUI CRUD-created tasks).
for _, old := range stored {
if old.ID == "" {
continue
}
if _, ok := known[old.ID]; ok {
continue
}
st := strings.ToLower(old.Status)
if st == "done" || st == "completed" {
continue
}
todos = append(todos, todoItem{ID: old.ID, Content: old.Content, Priority: old.Priority, DueAt: old.DueAt})
known[old.ID] = struct{}{}
}
for _, t := range todos {
st, ok := e.state[t.ID]
if !ok {
status := "idle"