feat: Fix SEO agent behavior and add z.ai API validation
- Add "SEO-First" mode to prevent unwanted agent switching - SEO agent now stays locked and answers queries through SEO lens - Add [SUGGEST_AGENT:xxx] marker for smart agent suggestions - Add suggestion banner UI with Switch/Dismiss buttons - Prevent auto-switching mid-response - Add validateConnection() method to ZaiPlanService - Add debounced API key validation (500ms) in Settings - Add inline status indicators (valid/validating/error) - Add persistent validation cache (5min) in localStorage - Add "Test Connection" button for manual re-validation - Add clear error messages for auth failures - Add ApiValidationStatus interface - Add apiValidationStatus state for tracking connection states - Add setApiValidationStatus action - Real-time API key validation in Settings panel - Visual status indicators (✓/✗/🔄) - Agent suggestion banner with Switch/Dismiss actions Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -74,6 +74,14 @@ export class ModelAdapter {
|
||||
return this.qwenService.hasOAuthToken();
|
||||
}
|
||||
|
||||
async validateConnection(provider: ModelProvider): Promise<APIResponse<{ valid: boolean; models?: string[] }>> {
|
||||
const service = this.getService(provider);
|
||||
if (!service || !service.validateConnection) {
|
||||
return { success: false, error: `Provider ${provider} does not support connection validation` };
|
||||
}
|
||||
return await service.validateConnection();
|
||||
}
|
||||
|
||||
private isProviderAuthenticated(provider: ModelProvider): boolean {
|
||||
switch (provider) {
|
||||
case "qwen":
|
||||
|
||||
Reference in New Issue
Block a user