{"record":{"id":"d9cb194b6b767d74","repo":"alibaba/open-code-review","slug":"load-resume-session-w-run-ocr-session-list-to","errorCode":null,"errorMessage":"load resume session: %w (run 'ocr session list' to see available sessions)","messagePattern":"load resume session: %w \\(run 'ocr session list' to see available sessions\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/opencodereview/review_cmd.go","lineNumber":354,"sourceCode":"\treturn nil\n}\n\nfunc loadReviewResumeState(repoDir string, opts reviewOptions) (*session.ResumeState, error) {\n\tif opts.resume == \"\" {\n\t\treturn nil, nil\n\t}\n\tcurrent := session.SessionOptions{\n\t\tReviewMode: reviewModeFromOptions(opts),\n\t\tDiffFrom:   opts.from,\n\t\tDiffTo:     opts.to,\n\t\tDiffCommit: opts.commit,\n\t}\n\tif current.ReviewMode == session.ReviewModeWorkspace {\n\t\treturn nil, fmt.Errorf(\"resume requires --from/--to or --commit; workspace resume is not supported\")\n\t}\n\tstate, err := session.LoadReviewResumeState(repoDir, opts.resume)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"load resume session: %w (run 'ocr session list' to see available sessions)\", err)\n\t}\n\tif err := state.ValidateOptions(current); err != nil {\n\t\treturn nil, fmt.Errorf(\"%w (run 'ocr session list' to see available sessions)\", err)\n\t}\n\t// A parent whose every item failed is deliberately allowed through: it has a\n\t// verifiable manifest, so its whole selected set can simply be re-dispatched.\n\t// Whether the checkpoints may be reused at all is decided later, by\n\t// validateResumeIdentity, once the input identity is known.\n\treturn state, nil\n}\n\n// validateResumeIdentity rejects a resume whose input, rules, provider or model\n// no longer match the parent run.\n//\n// It must run before agent.New: agent.New creates the session, and session.New\n// writes session_start immediately, so validating any later would leave an orphan\n// session on disk behind every rejection. It must also run after max-tokens is\n// resolved, because the per-file token ceiling decides which large diffs are","sourceCodeStart":336,"sourceCodeEnd":372,"githubUrl":"https://github.com/alibaba/open-code-review/blob/5cf97d0d15cbd41b602513c4be3bfec3cee5bf7f/cmd/opencodereview/review_cmd.go#L336-L372","documentation":"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.","triggerScenarios":"Thrown at cmd/opencodereview/review_cmd.go:354 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run 'ocr session list' to see available session IDs and verify the --resume value","Check that the session belongs to this repository and diff mode; resume requires an identity match with the current options","If the session file was deleted or corrupted, start a fresh review instead"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5cf97d0d15cbd41b602513c4be3bfec3cee5bf7f","analyzedAt":"2026-09-02T02:08:09.116Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}