alibaba/open-code-review · error

resume rejected: repository identity changed, so this is not

Error message

resume rejected: repository identity changed, so this is not the repository the parent run reviewed; %s

What it means

validateInputIdentity rejects resuming when the repository identity digest (Repository.IdentitySHA256) differs from the current repository's identity. A changed identity means the current repository is not the one the parent run reviewed — resume would compare results across unrelated repositories. An empty digest on both sides (no remote) counts as unchanged.

Source

Thrown at internal/session/resume_identity.go:114

	case m.SchemaVersion != ManifestSchemaVersion:
		return fmt.Errorf("resume session %q carries manifest schema %q, but this build can only verify %q; %s", s.SessionID, m.SchemaVersion, ManifestSchemaVersion, resumeHint)
	case m.Operation != OperationReview:
		return fmt.Errorf("resume session %q recorded operation %q, not %q; %s", s.SessionID, m.Operation, OperationReview, resumeHint)
	case len(m.Coverage.Selected) == 0:
		// Without this, an empty parent and an empty child would both hash to the
		// canonical empty digest, pass every comparison, and produce a run that
		// reuses nothing and dispatches nothing.
		return fmt.Errorf("resume session %q selected no input, so it has nothing to resume; %s", s.SessionID, resumeHint)
	}

	if m.Input.Mode != id.Mode {
		// Mode feeds item_id derivation, so parent and child items cannot even be
		// put side by side.
		return fmt.Errorf("resume rejected: input mode changed from %q to %q; %s", m.Input.Mode, id.Mode, resumeHint)
	}
	// Both sides empty means a repository with no remote, which is unchanged.
	if m.Repository.IdentitySHA256 != id.RepositorySHA256 {
		return fmt.Errorf("resume rejected: repository identity changed, so this is not the repository the parent run reviewed; %s", resumeHint)
	}
	if m.Input.SourceArtifactSHA256 != id.SourceArtifactSHA256 {
		return fmt.Errorf("resume rejected: the reviewed input changed since session %q — a ref may now point at a different commit, or the selected file set changed; %s", s.SessionID, resumeHint)
	}
	if m.Execution.RuleConfigSHA256 == "" {
		return fmt.Errorf("resume session %q recorded no rule identity, so it cannot be verified against the current rules; %s", s.SessionID, resumeHint)
	}
	if m.Execution.RuleConfigSHA256 != id.RuleConfigSHA256 {
		// The digest is one aggregate, so it can only be attributed to a layer,
		// never to a specific rule or pattern.
		return fmt.Errorf("resume rejected: review rule identity changed — either a rule text layer (custom, project, global or system) or the include/exclude file filter differs from session %q; %s", s.SessionID, resumeHint)
	}
	return nil
}

// explicitFlagHint renders the actionable half of a transition rejection. value
// is empty whenever the endpoint has no provider name — one configured straight
// from environment variables has none — and `pass --provider ` is not a command

View on GitHub (pinned to 5cf97d0d15)

Solutions

  1. Resume from the same clone/remote used by the parent session
  2. Restore the original remote URL (git remote set-url) so the repository identity matches
  3. Start a new review in the current repository instead of resuming

Example fix

// before
git remote set-url origin https://github.com/me/fork.git  # identity changed
// after
git remote set-url origin https://github.com/org/upstream.git  # restore original remote, then resume
Defensive patterns

Strategy: validation

Validate before calling

// Confirm the repository identity matches before resuming
if sess.Manifest != nil && sess.Manifest.Repository.IdentitySHA256 != currentRepoIdentitySHA256 {
    return fmt.Errorf("different repository/remote; resume from the original clone")
}

Try / catch

if err := ValidateResume(s, req); err != nil {
    if strings.Contains(err.Error(), "repository identity changed") {
        return startNewReview(req) // different repo — cannot reuse parent results
    }
    return err
}

Prevention

When it happens

Trigger: ValidateResume where m.Repository.IdentitySHA256 != id.RepositorySHA256 — e.g. resuming in a different clone, after changing the git remote URL, or in a different fork.

Common situations: Cloning the repo to a new path/machine with a different or missing remote; switching between HTTPS and SSH remotes or between fork and upstream; CI checking out a different repository than the one that started the run.

Related errors


AI-assisted analysis of alibaba/open-code-review@5cf97d0d15 (2026-09-02). Data as JSON: /api/errors/1212a3c93730afb7. Report an issue: GitHub.