Copilot Chat: Schema Validation Error With Gemini Pro
Hey guys, it looks like some of us are running into a bit of a snag with Copilot Chat after the most recent update. Specifically, a 400 error is popping up when trying to use Copilot Chat in Agent Mode with a custom Gemini 2.5 Pro API key. Let's dive into the details and see what's going on.
Understanding the Schema Validation Issue
When using Copilot Chat with Agent Mode enabled and a custom Gemini 2.5 Pro API key, you might encounter a frustrating 400 error. This error is distinct from other similar issues because it exclusively occurs under these specific conditions. It doesn't happen with the default model, making it particularly puzzling. The error isn't isolated to a single conversation; it manifests in both new and ongoing chats, impacting usability across the board. The error message points to a schema validation problem, specifically a missing title property. This detail is crucial because it suggests a change or bug introduced in the latest update that affects how the schema is validated when using a custom Gemini model.
This schema validation issue indicates that the system expects a title property within the arrayOfIssues schema, but it's not finding it. This could be due to a mismatch between the schema that Copilot Chat expects and the actual structure of the data being processed by the Gemini 2.5 Pro model. Identifying and addressing this discrepancy is essential to resolve the 400 error and restore normal functionality. The error message, schema at properties.arrayOfIssues requires unspecified property 'title', clearly pinpoints where the validation fails, providing a starting point for debugging and resolution. Understanding the root cause of this schema mismatch is vital for a quick and effective fix.
Steps to Reproduce the Error
To reliably reproduce this issue, follow these steps:
- Open GitHub Copilot Chat: Launch your GitHub Copilot Chat environment.
- Enable Agent Mode: Make sure Agent Mode is activated within Copilot Chat.
- Use Gemini 2.5 Pro with your own API key: Configure Copilot Chat to use the Gemini 2.5 Pro model, utilizing your personal API key.
- Start or continue any conversation: Initiate a new chat or resume an existing one.
- Send a prompt: As soon as you send a prompt, the error should surface immediately.
By following these steps, you should consistently encounter the 400 error, confirming that the issue is reproducible and not an isolated incident. This repeatability is crucial for developers to investigate and resolve the problem effectively. Each step ensures that the environment is correctly set up to trigger the schema validation failure, allowing for targeted debugging and testing. The consistency of the error across different conversations also rules out the possibility of specific prompts or data causing the issue, highlighting the problem's systemic nature.
Expected vs. Actual Behavior
Expected Behavior: The request should be processed without a hitch. You should be able to send prompts and receive responses as usual, without any errors popping up.
Actual Behavior:
Instead, a 400 error is thrown. The error message indicates that there’s a missing title property in the schema, which is causing the validation to fail. This prevents the request from being processed correctly.
The discrepancy between the expected and actual behavior highlights a significant issue within Copilot Chat's interaction with the Gemini 2.5 Pro model. The failure to process requests normally disrupts the user experience and hinders productivity. The error message, pointing to a missing title property, provides a clear indication of where the problem lies. Addressing this schema validation error is crucial to restoring the intended functionality of Copilot Chat and ensuring seamless interaction with custom Gemini models. Understanding this difference is vital for prioritizing and implementing the necessary fixes.
Environment Details
Here’s the environment where this issue is happening:
- Copilot Chat: Latest version
- Gemini 2.5 Pro: Using a custom API key
- Reproducibility: The error occurs 100% of the time
- Operating System: Windows_NT x64 10.0.26200
- VS Code Version: Code - Insiders 1.106.0-insider (d8b078709ba22088ce8709dd94dc344db768d6a0, 2025-10-10T08:19:44.111Z)
- Extension Version: 0.32.2025100703
This information is essential for pinpointing the source of the problem, as it narrows down the variables that could be contributing to the error. Knowing the specific versions of Copilot Chat, Gemini 2.5 Pro, and VS Code helps developers replicate the environment and debug effectively. The 100% reproducibility rate confirms that the issue is consistent and not influenced by intermittent factors. Additionally, details about the operating system and extension versions provide a comprehensive overview of the setup, aiding in the identification of potential conflicts or compatibility issues. Having this context is critical for a targeted and efficient troubleshooting process.
Additional Context and Potential Causes
It’s worth noting that this error is different from issue #253136. The error message is unique and points to a schema change in the latest release. Also, using the default model doesn’t trigger the error, suggesting that the issue is specific to using a custom Gemini model.
Possible Causes:
- Schema Mismatch: There might be a mismatch between the schema expected by Copilot Chat and the actual schema of the data returned by the Gemini 2.5 Pro model.
- API Key Issues: Although less likely, there could be an issue with how the custom API key is being handled, causing the data to be malformed.
- Recent Updates: A recent update to Copilot Chat or the Gemini 2.5 Pro model might have introduced a bug that affects schema validation.
To further investigate, it would be helpful to:
- Examine the schema being used by Copilot Chat.
- Verify that the Gemini 2.5 Pro model is returning data in the expected format.
- Check for any recent changes or updates that might have introduced the bug.
By carefully examining these areas, we can hopefully get to the bottom of this and get Copilot Chat working smoothly again with custom Gemini models.
I hope this helps in resolving the issue! Let me know if you need any more information or if there’s anything else I can do to assist.
For more information on Gemini Pro and its capabilities, check out the official Google AI documentation. This could provide further insights into the expected data formats and API usage, helping to identify any discrepancies causing the schema validation error.