MCPcopy Create free account
hub / github.com/betta-tech/byo-coding-agent / loadHistory

Function loadHistory

internal/ui/input.go:186–205  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

184}
185
186func loadHistory() []string {
187 path := historyPath()
188 if path == "" {
189 return nil
190 }
191 f, err := os.Open(path)
192 if err != nil {
193 return nil
194 }
195 defer f.Close()
196 var lines []string
197 s := bufio.NewScanner(f)
198 s.Buffer(make([]byte, 0, 64*1024), 1024*1024)
199 for s.Scan() {
200 if s.Text() != "" {
201 lines = append(lines, s.Text())
202 }
203 }
204 return lines
205}
206
207func appendHistory(line string) {
208 path := historyPath()

Callers 1

ReadChatInputFunction · 0.85

Calls 2

historyPathFunction · 0.85
CloseMethod · 0.45

Tested by

no test coverage detected