The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu
Go agent-ai-cliagent-harnessesagent-securitybrowser-extensionciclaude-codecloudcodexcursordetection-engineeringjevknowledge-basememorymobile-device-managementobservabilitysecuritysecurity-information-and-event-managementsecurity-toolstelemetrytraces
Fix snapshotRepairFile to distinguish missing files from unreadable files
Cursor Agent1549b059dce6
diff --git a/cli/beacon/cmd/endpoint_diagnostics.go b/cli/beacon/cmd/endpoint_diagnostics.goindex 8dbcb5ff..6c77128d 100644--- a/cli/beacon/cmd/endpoint_diagnostics.go+++ b/cli/beacon/cmd/endpoint_diagnostics.go@@ -87,6 +87,7 @@ type repairFileSnapshot struct {existed booldata []bytemode os.FileMode+ readErr error}type repairRollback struct {@@ -978,7 +979,10 @@ func rollbackRepairError(err error, rollback *repairRollback) error {func snapshotRepairFile(path string) repairFileSnapshot {data, err := os.ReadFile(path)if err != nil {- return repairFileSnapshot{}+ if errors.Is(err, os.ErrNotExist) {+ return repairFileSnapshot{}+ }+ return repairFileSnapshot{existed: true, readErr: err}}snapshot := repairFileSnapshot{existed: true, data: data}if info, statErr := os.Stat(path); statErr == nil {@@ -994,6 +998,9 @@ func restoreRepairFile(path string, snapshot repairFileSnapshot) error {}return nil}+ if snapshot.readErr != nil {+ return fmt.Errorf("cannot restore %s: pre-repair snapshot failed: %w", path, snapshot.readErr)+ }if err := os.MkdirAll(filepath.Dir(path), 0755); err != nil {return err}