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

Method Load

session/store.go:70–90  ·  view source on GitHub ↗
(sessionID string)

Source from the content-addressed store, hash-verified

68 s.LoadSkillRecovery(sessionID),
69 s.LoadTaskRuntimeSnapshot(sessionID),
70 )
71}
72
73func (s *Store) Load(sessionID string) []map[string]any {
74 file, err := os.Open(s.sessionReadPath(sessionID))
75 if err != nil {
76 return s.loadSQLiteMessages(sessionID)
77 }
78 defer file.Close()
79 var messages []map[string]any
80 scanner := bufio.NewScanner(file)
81 scanner.Buffer(make([]byte, 0, 64*1024), 10*1024*1024)
82 for scanner.Scan() {
83 line := scanner.Bytes()
84 if len(line) == 0 {
85 continue
86 }
87 var message map[string]any
88 if err := json.Unmarshal(line, &message); err == nil {
89 messages = append(messages, message)
90 }
91 }
92 return messages
93}

Calls 3

sessionReadPathMethod · 0.95
loadSQLiteMessagesMethod · 0.95
CloseMethod · 0.65