MCPcopy Create free account
hub / github.com/braintrustdata/bash-agent-evals / loadHistory

Function loadHistory

src/cli.tsx:14–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12const MAX_HISTORY = 100;
13
14function loadHistory(): string[] {
15 try {
16 if (existsSync(HISTORY_FILE)) {
17 const data = JSON.parse(readFileSync(HISTORY_FILE, 'utf-8'));
18 return Array.isArray(data) ? data.slice(-MAX_HISTORY) : [];
19 }
20 } catch {
21 // Ignore errors, start fresh
22 }
23 return [];
24}
25
26function saveHistory(history: string[]): void {
27 try {

Callers 1

AppFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected