MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / snapshot

Method snapshot

agent/task_runtime.go:690–715  ·  view source on GitHub ↗
(taskIDs []string, scopeID string)

Source from the content-addressed store, hash-verified

688}
689
690func (rt *AgentTaskRuntime) snapshot(taskIDs []string, scopeID string) map[string]any {
691 rt.mu.Lock()
692 defer rt.mu.Unlock()
693 var tasks []map[string]any
694 var pending []string
695 var missing []string
696 for _, id := range taskIDs {
697 record := rt.getTaskLocked(id, scopeID, true)
698 if record == nil {
699 missing = append(missing, id)
700 continue
701 }
702 tasks = append(tasks, serializeTaskPayload(record.ToMap()))
703 if !isStableTask(record) {
704 pending = append(pending, id)
705 }
706 }
707 return map[string]any{
708 "tasks": tasks,
709 "timeout": false,
710 "pending_task_ids": pending,
711 "missing_task_ids": missing,
712 "expired_task_ids": []string{},
713 "inaccessible_task_ids": []string{},
714 }
715}
716
717func isStableTask(record *AgentTaskRecord) bool {
718 if record == nil {

Callers 1

WaitForTasksMethod · 0.95

Calls 4

getTaskLockedMethod · 0.95
serializeTaskPayloadFunction · 0.85
isStableTaskFunction · 0.85
ToMapMethod · 0.45

Tested by

no test coverage detected