| 865 | } |
| 866 | |
| 867 | func (rt *AgentTaskRuntime) findExpiredTaskIDs(taskIDs []string, scopeID string) []string { |
| 868 | rt.mu.Lock() |
| 869 | defer rt.mu.Unlock() |
| 870 | var expired []string |
| 871 | for _, taskID := range taskIDs { |
| 872 | if _, ok := rt.records[taskID]; ok { |
| 873 | continue |
| 874 | } |
| 875 | if parent, ok := rt.expiredTaskParentScopes[taskID]; ok && parent == scopeID { |
| 876 | expired = append(expired, taskID) |
| 877 | } |
| 878 | } |
| 879 | return expired |
| 880 | } |
| 881 | |
| 882 | func (rt *AgentTaskRuntime) scheduleTerminalRecordCleanupLocked(taskID string) { |
| 883 | record := rt.records[taskID] |