{"record":{"id":"4213d5d4e7646dd3","repo":"alibaba/open-code-review","slug":"review-failed-d-of-d-selected-item-s-failed","errorCode":null,"errorMessage":"review failed: %d of %d selected item(s) failed","messagePattern":"review failed: (.+?) of (.+?) selected item\\(s\\) failed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/opencodereview/review_cmd.go","lineNumber":333,"sourceCode":"\tif manifest != nil && manifest.TerminalState == session.StateFailed {\n\t\t// The exit contract is: non-zero only for a run-level failure, or when\n\t\t// every selected item failed. Any usable coverage — even incomplete — exits\n\t\t// 0, so complete/partial/skipped all succeed and only failed lands here.\n\t\t// That makes a budget stop exit 0 whenever anything was covered (it is a\n\t\t// controlled truncation recording no run_failure) and non-zero only when\n\t\t// the cap left nothing covered at all. Partial results are published\n\t\t// regardless: runReview emits the frozen manifest before this error decides\n\t\t// the exit status.\n\t\t//\n\t\t// Reasons stored in the manifest already went through sanitizeReason, so\n\t\t// they are safe to echo on stderr.\n\t\tif rf := manifest.RunFailure; rf != nil {\n\t\t\tif rf.Reason != \"\" {\n\t\t\t\treturn fmt.Errorf(\"review failed (%s): %s\", rf.Classification, rf.Reason)\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"review failed (%s)\", rf.Classification)\n\t\t}\n\t\treturn fmt.Errorf(\"review failed: %d of %d selected item(s) failed\",\n\t\t\tlen(manifest.Coverage.Failed), len(manifest.Coverage.Selected))\n\t}\n\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}","sourceCodeStart":315,"sourceCodeEnd":351,"githubUrl":"https://github.com/alibaba/open-code-review/blob/5cf97d0d15cbd41b602513c4be3bfec3cee5bf7f/cmd/opencodereview/review_cmd.go#L315-L351","documentation":"Per the exit contract, a review exits non-zero only when every selected item failed. This error reports that count (N of M selected) — the run was not aborted at run level, but each individually reviewed item failed, so no usable coverage exists despite the run completing.","triggerScenarios":"Thrown at cmd/opencodereview/review_cmd.go:333 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Some or all selected review items failed while the run itself completed; check the Failed list in the emitted manifest","Retry the failed items — e.g. re-run with the same --from/--to or --commit, or resume the session","Investigate item-specific errors (usually LLM or diff-reading failures) reported per item"],"exampleFix":null,"handlingStrategy":"validation","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"}