Skip to content

Repair owned repository caches that are missing origin #277

Description

@AntoineToussaint

Observed production failure

Mind's real SWE-bench ingest-only production path delegates repository preparation to Codefly PrepareRepositoryCheckout. With the default shared Codefly-owned cache, a valid Git checkout can exist without an origin remote. Codefly accepts it as a repository at rev-parse --git-dir, then fails permanently at:

prepare repository checkout capability: resolve repository origin:
git remote get-url origin: error: No such remote 'origin'

This currently makes Mind TestSWEBenchIngestOnlyPerformanceSmoke fail before checkout/ingestion for django__django-11099. It reproduces unchanged on Mind main efadc4e0 with Codefly CLI v0.1.80.

Generic behavior needed

PrepareRepositoryCheckout owns this named cache projection and already repairs interrupted non-repositories. It should also recover a structurally valid owned cache whose origin is absent, using the typed request's authoritative RepositoryURL, then continue the normal fetch/revision/clean flow.

It must still fail closed when an existing origin points somewhere different; do not silently retarget a mismatched source. Cache/worktree safety and cancellation preservation must remain intact.

Acceptance

  • A real repository cache with no origin is repaired through the production typed capability and resolves the requested revision.
  • A cache with a mismatched existing origin still fails.
  • Retry remains idempotent and leaves a clean checkout.
  • No workaround or Git command is added to Mind.

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