Problem
When switching modes in Roo Code (e.g., from "code" to "architect"), users experience Gemini API errors. The conversation history contains tool calls from the previous mode, and Gemini requires those tool definitions to be present to understand the history. However, the new mode may not have access to those tools, causing the API to fail.
Impact
- Users of the Gemini provider encounter errors when switching between modes
- Workflow is disrupted as mode switching is a common operation
- Users cannot seamlessly transition between modes without losing context or encountering errors