{"record":{"id":"6ede7673cdca8c61","repo":"nikivdev/code","slug":"commit-aborted-after-auto-fix-review-changes-and","errorCode":null,"errorMessage":"Commit aborted after auto-fix. Review changes and retry.","messagePattern":"Commit aborted after auto-fix\\. Review changes and retry\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/commit.rs","lineNumber":425,"sourceCode":"    } else if !agent_enabled {\n        eprintln!(\"ℹ️  manual fix-f-commit handoff disabled via FLOW_FIX_COMMIT_AGENT=off\");\n    }\n\n    if interactive && !current_findings.is_empty() && ai_available {\n        if prompt_yes_no_default_yes(\"Run auto-fix with ai?\")? {\n            let task = build_fix_f_commit_task(&current_findings);\n            println!(\"Running auto-fix with ai...\");\n            if let Err(err) = run_fix_f_commit_ai(repo_root, &task) {\n                eprintln!(\"⚠ Failed to run ai auto-fix: {err}\");\n            }\n            rescan_after_fix(&mut current_findings)?;\n            if current_findings.is_empty() {\n                if prompt_yes_no_default_yes(\n                    \"Secret scan is clean after auto-fix. Continue with commit?\",\n                )? {\n                    return Ok(());\n                }\n                bail!(\"Commit aborted after auto-fix. Review changes and retry.\");\n            }\n        }\n    }\n\n    if current_findings != findings {\n        print_secret_findings(\n            \"🔐 Potential secrets still detected in staged changes:\",\n            &current_findings,\n        );\n        println!();\n    }\n\n    let task = build_fix_f_commit_task(&current_findings);\n    if !task.trim().is_empty() {\n        eprintln!(\"Suggested prompt (copy/paste into your model):\");\n        eprintln!(\"────────────────────────────────────────\");\n        eprintln!(\"{}\", task);\n        eprintln!(\"────────────────────────────────────────\");","sourceCodeStart":407,"sourceCodeEnd":443,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/commit.rs#L407-L443","documentation":"This error is raised by `warn_secrets_in_diff` after an automatic AI-assisted fix (`run_fix_f_commit_ai`) re-scanned the diff: the scan is clean, the user was asked to confirm continuation and declined, so the commit is aborted. It differs from 255 only in that the fix was applied automatically by the `ai` CLI rather than manually by the user.","triggerScenarios":"During the commit flow, secrets were found, FLOW_FIX_COMMIT_AGENT enabled the AI auto-fix path, `run_fix_f_commit_ai` succeeded, the re-scan found nothing, and the user answered 'no' to 'Secret scan is clean after auto-fix. Continue with commit?'.","commonSituations":"User distrusts the auto-redaction and wants to review changes manually first, or wants to inspect what the AI modified before allowing the commit.","solutions":["Review the auto-applied changes with `git diff --cached`, then re-run the commit flow and confirm with 'yes'.","If the auto-fix was wrong, revert the affected hunks and redact manually, then retry.","Disable the AI auto-fix path with `FLOW_FIX_COMMIT_AGENT=off` to handle findings manually next time."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// after an AI auto-fix, verify the diff no longer contains findings before continuing\nlet findings = scan_diff_for_secrets(repo_root);\nif !findings.is_empty() { eprintln!(\"auto-fix incomplete; {:?} remain\", findings); }","typeGuard":null,"tryCatchPattern":"match run_fast() {\n    Err(e) if e.to_string().contains(\"Commit aborted after auto-fix\") => {\n        // user declined the auto-fixed diff; inspect and re-run\n        eprintln!(\"review AI-modified files with git diff --cached, then re-run\");\n    }\n    Err(e) => return Err(e),\n    Ok(_) => {}\n}","preventionTips":["Review AI-applied redactions before confirming the prompt","If you routinely want manual control, set FLOW_FIX_COMMIT_AGENT=off","Diff against HEAD after auto-fix to catch unintended edits"],"tags":["git","secrets","auto-fix","user-abort","interactive"],"backgroundTag":"secret-scan-commit-abort","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}