Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,9 @@ async function main() {
}, snapshotConfig.interval * 1000);
snapshotTimer.unref();
bootLog(
`Git snapshots: ${snapshotConfig.dir} (every ${snapshotConfig.interval}s)`,
snapshotIntervalMs > 0
? `Git snapshots: ${snapshotConfig.dir} (every ${snapshotConfig.interval}s)`
: `Git snapshots: ${snapshotConfig.dir} (periodic timer disabled, SNAPSHOT_INTERVAL=0 — manual trigger only)`,
Comment on lines +373 to +375

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== locate files =="
git ls-files | rg '(^|/)src/index\.ts$|package\.json$' || true

echo "== relevant section =="
if [ -f src/index.ts ]; then
  wc -l src/index.ts
  sed -n '330,390p' src/index.ts | nl -ba -v330
fi

echo "== definitions/usages =="
rg -n "snapshotIntervalMs|snapshotConfig|snapshot" src/index.ts package.json || true

echo "== package module type =="
if [ -f package.json ]; then
  node -e "const p=require('./package.json'); console.log(JSON.stringify({type:p.type, main:p.main, dependencies:p.dependencies || {}, devDependencies:p.devDependencies || {}}, null, 2))"
fi

Repository: rohitg00/agentmemory

Length of output: 440


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== locate files =="
git ls-files | rg '(^|/)src/index\.ts$|package\.json$' || true

echo "== package module type =="
if [ -f package.json ]; then
  node -e "const p=require('./package.json'); console.log(JSON.stringify({type:p.type, main:p.main, dependencies:p.dependencies || {}, devDependencies:p.devDependencies || {}}, null, 2))"
fi

echo "== relevant src/index.ts section and identifiers =="
if [ -f src/index.ts ]; then
  wc -l src/index.ts
  sed -n '320,400p' src/index.ts | nl -ba -v320
  echo "== identifier occurrences =="
  rg -n "snapshotIntervalMs|snapshotConfig|GIT_SNAPSHOT|SNAPSHOT|interval" src/index.ts || true
fi

Repository: rohitg00/agentmemory

Length of output: 945


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== package name/context =="
sed -n '1,25p' src/index.ts

echo "== snapshot identifier occurrences =="
python3 - <<'PY'
from pathlib import Path
p=Path('src/index.ts')
print(f'src/index.ts lines={len(p.read_text().splitlines())}')
for i,line in enumerate(p.read_text().splitlines(),1):
    if 'snapshotIntervalMs' in line or 'snapshotConfig' in line or 'interval' in line and ('Snapshot' in line or 'SNAPSHOT' in line or 'git' in line.lower()):
        print(f'{i}: {line}')
PY

echo "== lines 330-390 =="
python3 - <<'PY'
from pathlib import Path
lines=Path('src/index.ts').read_text().splitlines()
for i in range(330, min(len(lines),390)+1):
    print(f'{i}: {lines[i-1]}')
PY

Repository: rohitg00/agentmemory

Length of output: 4037


Declare snapshotIntervalMs before the snapshot boot log.

snapshotIntervalMs is not defined in src/index.ts, so TypeScript rejects this file and execution raises ReferenceError when snapshots are enabled. Add the millisecond value before the timer guard and reuse it in the log.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/index.ts` around lines 373 - 375, Declare and initialize
snapshotIntervalMs in the snapshot startup flow before the timer guard and boot
log, deriving it from the configured snapshot interval in milliseconds. Reuse
this variable in the existing conditional log while preserving the enabled and
manual-trigger-only messages.

);
}

Expand Down