fix: sync performance, startup logging, and insights fixes#25
Conversation
Log elapsed time for each startup phase so it's clear where time is spent with large session counts. Discovery phase logs per-agent file counts, file watcher logs directory count and setup duration, and the "listening" line shows total startup time. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove project filter from the insights list API call so global insights remain visible when a project is selected. The backend still accepts the parameter but the frontend no longer sends it. In generateClaude, try parsing stdout before checking cmd.Run error. If the CLI exits non-zero but produced valid JSON with a non-empty result, use it instead of discarding. This captures insights when claude is terminated after completing generation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Three changes to reduce sync time from ~14s to sub-second for unchanged sessions: 1. Replace SHA-256 hash skip check with file_size + file_mtime. The mtime is free from the existing os.Stat call, eliminating a full file read per session just for the skip check. 2. Add path-based DB lookup (GetFileInfoByPath) for codex and gemini files. These agents require parsing to get the session ID, but the path-based check lets us skip unchanged files before parsing. 3. Generalize the failed-file tombstone into a skip cache that also covers files returning nil sessions (non-interactive codex sessions). On second sync, ~7000 non-interactive files are skipped via in-memory mtime check instead of being re-parsed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
roborev: Combined Review (
|
- Remove unnecessary selectedId reset and load() from setProject since load no longer filters by project - Update frontend test assertions to match no-args listInsights call - Add TestGenerateClaude_SalvageOnNonZeroExit covering 6 cases for stdout salvage on CLI failure Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
roborev: Combined Review (
|
- Pass mtime from initial os.Stat through processResult instead of re-stat'ing in cacheSkipFromPath, preventing race where a file written between parse and cache gets its new mtime permanently cached as a skip entry - Remove cacheSkipFromPath; all callers now use cacheSkip with the captured mtime directly - Clear skip cache in SyncSingleSession before processing so codex exec sessions cached as non-interactive during SyncAll can still be found via the includeExec fallback - Make GetFileInfoByPath deterministic with ORDER BY/LIMIT for the theoretical case of duplicate file_path rows - Add TestSyncSingleSessionCodexExecBypassesCache integration test Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
roborev: Combined Review (
|
The fakeClaudeBin helper used a #!/bin/sh script which doesn't exist on Windows. Use a .cmd batch file with @type/@EXIT on Windows. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
roborev: Combined Review (
|
Check ctx.Err() before attempting to salvage stdout from a failed CLI invocation. Without this, a cancelled/timed-out context could return success if the CLI emitted valid JSON before being killed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
roborev: Combined Review (
|
|
"Neither finding is valid. High — "Bad global find-and-replace": Hallucinated again. The file contains "@type %q\r\n@exit /b %d\r\n" — Medium — "mtime/size-only skip": Same finding for the fourth time. Already addressed. |
Summary
Test plan
CGO_ENABLED=1 go test -tags fts5 ./...passesnpx tsc --noEmitpasses in frontend🤖 Generated with Claude Code