{"record":{"id":"f7810b5a0a4fc1f9","repo":"alibaba/open-code-review","slug":"review-failed-s","errorCode":null,"errorMessage":"review failed (%s)","messagePattern":"review failed \\((.+?)\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/opencodereview/review_cmd.go","lineNumber":331,"sourceCode":"\t\treturn fmt.Errorf(\"review failed: %w\", runErr)\n\t}\n\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 {","sourceCodeStart":313,"sourceCodeEnd":349,"githubUrl":"https://github.com/alibaba/open-code-review/blob/5cf97d0d15cbd41b602513c4be3bfec3cee5bf7f/cmd/opencodereview/review_cmd.go#L313-L349","documentation":"Terminal failure branch that interpolates the manifest's terminal state name (e.g. failed with a specific state label) — the run reached the failed terminal state and nothing usable was covered. The state string in the message identifies which failure mode the session recorded.","triggerScenarios":"Thrown at cmd/opencodereview/review_cmd.go:331 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The run manifest reached terminal state 'failed' — every selected review item failed or the run aborted before producing usable coverage","Inspect the manifest's run_failure details and per-item errors (output via --output JSON)","Fix the underlying cause (credentials, network, repository state) and retry, optionally with --resume <session-id>"],"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"}