{"record":{"id":"2c8adc94b2c54c33","repo":"google-gemini/gemini-cli","slug":"failed-to-checkout-feature-branch-branch-name","errorCode":null,"errorMessage":"Failed to checkout feature branch {branch_name}: {e}","messagePattern":"Failed to checkout feature branch (.+?): (.+?)","errorType":"exception","errorClass":"OrchestrationError","httpStatus":null,"severity":"error","filePath":"tools/caretaker-agent/cloudrun/pr-generator/workflow/orchestrator.py","lineNumber":205,"sourceCode":"            )\n            return\n\n        if claim_action == ClaimAction.NEEDS_HUMAN:\n            logging.warning(\n                \"Generation attempts exceeded maximum allowed limit. Issue moved to NEEDS_HUMAN. Exiting cleanly.\"\n            )\n            return\n\n        try:\n            branch_name = f\"ssr-agent-{sanitize_identifier(str(issue_num))}\"\n\n            # Sync repository and check out target branch\n            self._sync_or_clone_repository()\n            try:\n                # TODO: Add logic to fetch and checkout the existing branch if responding to user feedback\n                CommandExecutor.run([\"git\", \"checkout\", \"-B\", branch_name, \"origin/main\"], self.config.pr_repo_path)\n            except CommandExecutionError as e:\n                raise OrchestrationError(f\"Failed to checkout feature branch {branch_name}: {e}\") from e\n\n            # Install project NPM dependencies inside PR workspace\n            logging.info(\"Installing node dependencies inside PR repository workspace...\")\n            try:\n                npm_install_cmd = 'NODE_OPTIONS=\"--max-old-space-size=4096\" npm ci --no-audit --no-fund --maxsockets 3'\n                CommandExecutor.run(npm_install_cmd, self.config.pr_repo_path)\n            except CommandExecutionError as e:\n                raise OrchestrationError(f\"Failed to install NPM dependencies in PR workspace: {e}\") from e\n\n            # Persist the specifications file inside the PR repo workspace\n            spec_pr_path = os.path.join(self.config.pr_repo_path, \"firestore_doc.json\")\n            try:\n                with open(spec_pr_path, \"w\", encoding=\"utf-8\") as f:\n                    json.dump(firestore_doc, f, indent=2)\n            except IOError as e:\n                raise OrchestrationError(f\"Failed to save firestore_doc.json to workspace: {e}\") from e\n\n            approved = False","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/google-gemini/gemini-cli/blob/5024443c7217464a66e98f80d73172a26440bd8f/tools/caretaker-agent/cloudrun/pr-generator/workflow/orchestrator.py#L187-L223","documentation":"Error \"Failed to checkout feature branch {branch_name}: {e}\" thrown in google-gemini/gemini-cli.","triggerScenarios":"Thrown at tools/caretaker-agent/cloudrun/pr-generator/workflow/orchestrator.py:205 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5024443c7217464a66e98f80d73172a26440bd8f","analyzedAt":"2026-08-12T06:01:53.711Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}