alibaba/open-code-review · error

load resume session: %w (run 'ocr session list' to see avail

Error message

load resume session: %w (run 'ocr session list' to see available sessions)

What it means

session.LoadReviewResumeState failed to load the session identified by --resume: the id does not exist in this repo's session store, the stored file is corrupt, or it belongs to a different repository. The hint 'run ocr session list' is appended because a mistyped or stale id is the most common cause.

Source

Thrown at cmd/opencodereview/review_cmd.go:354

	return nil
}

func loadReviewResumeState(repoDir string, opts reviewOptions) (*session.ResumeState, error) {
	if opts.resume == "" {
		return nil, nil
	}
	current := session.SessionOptions{
		ReviewMode: reviewModeFromOptions(opts),
		DiffFrom:   opts.from,
		DiffTo:     opts.to,
		DiffCommit: opts.commit,
	}
	if current.ReviewMode == session.ReviewModeWorkspace {
		return nil, fmt.Errorf("resume requires --from/--to or --commit; workspace resume is not supported")
	}
	state, err := session.LoadReviewResumeState(repoDir, opts.resume)
	if err != nil {
		return nil, fmt.Errorf("load resume session: %w (run 'ocr session list' to see available sessions)", err)
	}
	if err := state.ValidateOptions(current); err != nil {
		return nil, fmt.Errorf("%w (run 'ocr session list' to see available sessions)", err)
	}
	// A parent whose every item failed is deliberately allowed through: it has a
	// verifiable manifest, so its whole selected set can simply be re-dispatched.
	// Whether the checkpoints may be reused at all is decided later, by
	// validateResumeIdentity, once the input identity is known.
	return state, nil
}

// validateResumeIdentity rejects a resume whose input, rules, provider or model
// no longer match the parent run.
//
// It must run before agent.New: agent.New creates the session, and session.New
// writes session_start immediately, so validating any later would leave an orphan
// session on disk behind every rejection. It must also run after max-tokens is
// resolved, because the per-file token ceiling decides which large diffs are

View on GitHub (pinned to 5cf97d0d15)

Solutions

  1. Run 'ocr session list' to see available session IDs and verify the --resume value
  2. Check that the session belongs to this repository and diff mode; resume requires an identity match with the current options
  3. If the session file was deleted or corrupted, start a fresh review instead
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at cmd/opencodereview/review_cmd.go:354 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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