alibaba/open-code-review · error
%w (run 'ocr session list' to see available sessions)
Error message
%w (run 'ocr session list' to see available sessions)
What it means
Generic wrap for a failed --resume load: the session exists but cannot be used because its recorded options (review mode, diff range, commit) do not match the current invocation, or the stored state is unreadable. The underlying cause is interpolated with %w plus the 'ocr session list' hint, so identity mismatches between the saved session and the requested resume are surfaced here.
Source
Thrown at cmd/opencodereview/review_cmd.go:357
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
// dropped and therefore which files the input identity covers.
//
// provider and model are explicit exactly when their flag was passed on thisView on GitHub (pinned to 5cf97d0d15)
Solutions
- Follow the hint in the message: run 'ocr session list' to see available sessions
- Verify the session ID passed to --resume exists and matches the current repo/mode identity
- See the wrapped error for the root cause (missing file, corrupted state, identity mismatch)
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at cmd/opencodereview/review_cmd.go:357 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/59bcafc57c631e3b.
Report an issue: GitHub.