{"record":{"id":"df0f71faf78ee1af","repo":"nikivdev/code","slug":"commit-queue-is-empty","errorCode":null,"errorMessage":"Commit queue is empty.","messagePattern":"Commit queue is empty\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/commit.rs","lineNumber":7357,"sourceCode":"        .status();\n\n    match status {\n        Ok(status) => {\n            if !status.success() {\n                println!(\"⚠ Failed to open review (exit {}).\", status);\n            }\n        }\n        Err(err) => println!(\"⚠ Failed to run review opener: {}\", err),\n    }\n}\n\npub fn open_latest_queue_review() -> Result<()> {\n    ensure_git_repo()?;\n    let repo_root = git_root_or_cwd();\n    let _ = refresh_commit_queue(&repo_root);\n    let mut entries = load_commit_queue_entries(&repo_root)?;\n    if entries.is_empty() {\n        bail!(\"Commit queue is empty.\");\n    }\n    let entry = entries.pop().unwrap();\n    println!(\n        \"Opening latest queued commit {} in Rise...\",\n        short_sha(&entry.commit_sha)\n    );\n    open_review_in_rise(&repo_root, &entry.commit_sha);\n    Ok(())\n}\n\nfn latest_review_report_for_commit(repo_root: &Path, commit_sha: &str) -> Option<PathBuf> {\n    let report_dir = flow_commit_reports_dir()?;\n    let sha_short = short_sha(commit_sha);\n    let project_slug = safe_label_value(&flow_project_name(repo_root));\n    let branch = git_capture_in(repo_root, &[\"rev-parse\", \"--abbrev-ref\", \"HEAD\"])\n        .unwrap_or_else(|_| \"unknown\".to_string())\n        .trim()\n        .to_string();","sourceCodeStart":7339,"sourceCodeEnd":7375,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/commit.rs#L7339-L7375","documentation":"open_latest_queue_review() refreshes and loads the commit queue, and throws this error when there are zero queued entries — there is no latest queued commit to open a review for. It is an empty-state guard before popping the last entry.","triggerScenarios":"Calling open_latest_queue_review() (the 'open latest review in Rise' flow) when the commit queue file contains no entries — nothing was ever queued, or the queue was drained by approvals.","commonSituations":"Running the review-open command before creating any queued commits, after approving/clearing all entries, or after the internal queue state file was deleted or reset by policy fix.","solutions":["Queue commits first (run the commit/queue flow so entries are recorded)","If the queue should not be empty, check the internal .ai queue state file still exists","Re-run the tool from the correct repository root where the queue lives"],"exampleFix":"// before (shell)\nf commit open-review   # queue empty\n// after (shell)\nf commit            # creates queued entries\nf commit open-review","handlingStrategy":"validation","validationCode":"let entries = load_commit_queue_entries(&repo_root)?;\nif entries.is_empty() {\n    eprintln!(\"queue empty: run the commit flow first\");\n} else {\n    open_latest_queue_review()?;\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = tool.open_latest_queue_review() {\n    if e.to_string().contains(\"Commit queue is empty\") {\n        eprintln!(\"nothing queued yet; create commits first\");\n    } else { return Err(e.into()); }\n}","preventionTips":["Check queue state before invoking review-open commands","Ensure the commit flow ran at least once in this repo","Don't delete the internal .ai queue state file","Run from the repo root so the right queue is loaded"],"tags":["git","queue","empty-state"],"backgroundTag":"queue-empty","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}