Solving the 'GPT-5.2 Not Available' Error in GitHub Copilot Code Reviews: A Developer Tool Insight
GitHub Copilot Code Review Fails: Unpacking the 'GPT-5.2 Not Available' Error
GitHub Copilot has become an indispensable developer tool for many, streamlining everything from code generation to review processes. However, a recent discussion in the GitHub Community highlighted a sudden halt in Copilot code review functionality, with users encountering a perplexing 'Model "gpt-5.2" is not available' error. This insight delves into the root causes and provides actionable solutions to get your AI-powered code reviews back on track.
The Problem: A Sudden Halt in Copilot Code Reviews
A user, jgeorge-np, reported that their Copilot code reviews stopped working abruptly. The GitHub Actions log revealed a critical error during the 'Run Autofind TS Agent' step, specifically when Copilot attempted to create a session with a particular AI model. The error message was clear:
Error: Model "gpt-5.2" is not available.
at t.resolveAndValidateModel (file:///home/runner/.cache/copilot/pkg/linux-x64/1.0.21/app.js:2455:32690)
at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
at async t.buildSettingsAndTools (file:///home/runner/.cache/copilot/pkg/linux-x64/1.0.21/app.js:2455:16269)
at async t.runAgenticLoop (file:///home/runner/.cache/copilot/pkg/linux-x64/1.0.21/app.js:2455:37361)
at async t.processQueuedItems (file:///home/runner/.cache/copilot/pkg/linux-x64/1.0.21/app.js:2455:7978)
at async t.processQueue (file:///home/runner/.cache/copilot/pkg/linux-x64/1.0.21/app.js:2455:2932)
at async t.send (file:///home/runner/.cache/copilot/pkg/linux-x64/1.0.21/app.js:2453:4033)While other warnings like 'Failed to fetch memory prompts: HTTP 404' appeared, they were gracefully handled and not the cause of the failure. The core issue lay squarely with the unavailable model.
The Root Cause: Backend Model Rotation
Community experts Pwimawy and Gecko51 quickly identified the likely culprit: a backend model rotation or deprecation on GitHub's side. The Copilot CLI, specifically version @github/copilot@1.0.21, was attempting to use a model identified as gpt-5.2[Reas>. This model identifier was no longer recognized or supported by the Copilot API, leading to the rejection.
This scenario typically arises from two main factors:
- Outdated Copilot CLI Version: The version of the Copilot CLI being used (e.g., pinned to
1.0.21) might havegpt-5.2hardcoded as a default or preferred model for code review. - Explicit Model Overrides: Workflow configurations or custom Code Review (CCR) settings within the repository or organization might be explicitly forcing the use of
gpt-5.2(e.g., through settings likeuseGPT5Model,queryAgentModelName, orverificationModelName).
Solutions to Restore Copilot Functionality
To resolve this issue and ensure your AI code reviews continue uninterrupted, consider the following steps:
- Upgrade Copilot CLI: The most straightforward solution is to upgrade to the latest version of the
@github/copilotCLI. If you're installing it in your GitHub Actions workflow, switch from a specific version (like1.0.21) to@latestor the current stable release. Newer versions are designed to reference currently available models. - Remove Explicit Model Overrides: Review your repository or organization's Copilot Code Review (CCR) settings. If you have any explicit model configurations that reference
gpt-5.2by name or setuseGPT5Modeltotrue, remove or update them. Allowing Copilot to automatically select a supported model is often the best approach. - Check GitHub Action Versions: If you're using an official action like
github/copilot-code-review-action, ensure you're using its latest version. These actions often pin their internal CLI versions, so updating the action itself can resolve the underlying CLI version issue. - Verify Pinned CLI Versions: Inspect your workflow's
package.jsonor lockfile. If it's pulling1.0.21(or another outdated version) due to a lockfile, update it to ensure the latest CLI is installed.
Given that the error appeared suddenly, it strongly indicates a backend change. By updating your Copilot CLI and ensuring no deprecated models are explicitly referenced, you can quickly restore this valuable developer tool to full functionality. Staying current with tool versions is key to maintaining smooth development workflows.
