{"record":{"id":"08929f96c69d522a","repo":"nikivdev/code","slug":"git-push-failed-08929f","errorCode":null,"errorMessage":"git push {} {} failed","messagePattern":"git push (.+?) (.+?) failed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/sync.rs","lineNumber":5602,"sourceCode":"            || combined.contains(\"eslint\")\n            || combined.contains(\"error:\")\n            || combined.contains(\"failed to push\");\n\n        // Prompt user if not already in auto-fix mode\n        let should_fix = if auto_fix {\n            true\n        } else if is_hook_failure && attempts == 1 {\n            sync_stdoutln!(\"{}\", combined);\n            prompt_for_push_fix()?\n        } else {\n            false\n        };\n\n        if !should_fix || attempts > max_attempts {\n            if !should_fix {\n                sync_stdoutln!(\"{}\", combined);\n            }\n            bail!(\"git push {} {} failed\", remote, branch);\n        }\n\n        sync_progressln!(\n            \"Push failed (attempt {}/{}), attempting auto-fix with Claude Opus...\",\n            attempts,\n            max_attempts\n        );\n\n        // Run Claude to fix the errors (fallback to opencode glm if Claude fails)\n        let mut fixed = try_claude_fix(&combined)?;\n        if !fixed {\n            sync_progressln!(\"Claude fix failed; trying opencode glm...\");\n            fixed = try_opencode_fix(&combined)?;\n        }\n        if !fixed {\n            sync_stdoutln!(\"{}\", combined);\n            bail!(\"Auto-fix failed. Run manually:\\n  claude 'fix these errors: ...'\");\n        }","sourceCodeStart":5584,"sourceCodeEnd":5620,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/sync.rs#L5584-L5620","documentation":"The push auto-fix loop exhausted its retry budget (`attempts > max_attempts`) or auto-fix was disabled while the push kept failing. If auto-fix is off, the combined git output is printed first, then this error bails.","triggerScenarios":"`git push <remote> <branch>` failed repeatedly; either `should_fix` false (no auto-fix allowed) or max auto-fix attempts exceeded without success.","commonSituations":"Remote moved ahead (needs pull/rebase); rejected non-fast-forward; auth/permission errors on the remote; protected branch policies.","solutions":["Read the combined push output printed above the error","`git pull --rebase <remote> <branch>` then push again","Re-run sync with auto-fix enabled to let the agent attempt repairs"],"exampleFix":"// before: push failing on stale branch\ngit pull --rebase origin main\ngit push origin main\n// after: push succeeds","handlingStrategy":"retry","validationCode":"git fetch origin && git rev-list --left-right --count HEAD...origin/main\n# if behind count > 0, pull --rebase before syncing/pushing","typeGuard":null,"tryCatchPattern":"match sync() {\n    Err(e) if e.contains(\"git push\") && e.contains(\"failed\") => {\n        run(\"git\", &[\"pull\", \"--rebase\"]);\n        // then retry sync, ideally with auto-fix enabled\n    }\n    r => r?,\n}","preventionTips":["Keep branches rebased on their remote before pushing","Enable the auto-fix path so failures get agent-assisted repair","Check branch protection/permission policies on the remote","Avoid force-pushing shared branches that cause repeated rejections"],"tags":["git","push","retry-exhausted","remote"],"backgroundTag":"git-push-rejected","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}