Summary
Switching from Gemini 3 Flash (with Google Search enabled) to Sonar results in a runtime error due to an incompatible leftover tools configuration.
Steps to Reproduce
- Add a Generate Text block
- Set the model to Gemini 3 Flash
- Enable the Google Search Tool
- Change the model to Sonar
- Run the block
Actual Result
The following error is returned:
Perplexity Error: ["At body -> tools -> 0: Input should be a dictionary or an instance of ToolSpec"]
Expected Result
- The block should run successfully with Sonar
OR - The system should automatically remove or adapt incompatible tool configurations when switching models
OR - A clear validation error should be shown before execution
Root Cause (Hypothesis)
The tools configuration from Gemini persists after switching models, even though Sonar does not support the same tool format.
Problematic config:
"modelOverride": {
"model": "sonar",
"config": {
"tools": [
"googleSearch"
]
},
"temperature": 0.95,
"ignorePreamble": false,
"maxResponseTokens": 32768
}
Sonar likely expects tools to be structured as a ToolSpec object (dictionary), not a string.
Suggested Fixes
- Clear or reset
config.toolswhen switching models - Add schema validation on model change
- Provide UI feedback when incompatible settings persist
- Optionally auto-transform supported tool formats across models
Impact
- Confusing error message for users
- Breaks workflow when switching models
- Hard to diagnose without inspecting raw config