Skip to content

Cloud sync removes all local codebases on connection failure #251

@Retengart

Description

@Retengart

Problem

syncIndexedCodebasesFromCloud() removes local codebases that don't exist in cloud. If cloud returns empty (auth failure, network issue, timeout), ALL local codebases are removed.

Current Behavior

// handlers.ts:43-56
if (collections.length === 0) {
    // If no collections in cloud, remove all local codebases
    for (const codebasePath of localCodebases) {
        this.snapshotManager.removeIndexedCodebase(codebasePath);
    }
}

Impact

  • Intermittent network issues = lost index state
  • Auth token expiry = lost index state
  • Zilliz Cloud maintenance = lost index state

Expected Behavior

Distinguish between:

  1. Cloud genuinely empty (user deleted everything)
  2. Cloud unreachable/error

Only remove local entries on confirmed cloud state, not on errors.

Location

  • packages/mcp/src/handlers.ts:31-142 - syncIndexedCodebasesFromCloud()

Suggested Fix

Check API response status/errors before assuming cloud is empty. Add error handling that preserves local state on connection failures.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions