From 8a0f3f5a1319b7743a48bb0ecac2b6e5eff319ad Mon Sep 17 00:00:00 2001 From: shinchan-zhai Date: Sat, 4 Apr 2026 14:48:42 +0800 Subject: [PATCH] feat: change claw402 default model from deepseek to glm-5 --- api/handler_ai_model.go | 2 +- api/handler_onboarding.go | 8 ++++---- mcp/payment/claw402.go | 5 ++++- web/src/components/trader/model-constants.ts | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/api/handler_ai_model.go b/api/handler_ai_model.go index 4ffce4f2..fcda2098 100644 --- a/api/handler_ai_model.go +++ b/api/handler_ai_model.go @@ -218,7 +218,7 @@ func (s *Server) handleGetSupportedModels(c *gin.Context) { {"id": "grok", "name": "Grok (xAI)", "provider": "grok", "defaultModel": "grok-3-latest"}, {"id": "kimi", "name": "Kimi (Moonshot)", "provider": "kimi", "defaultModel": "moonshot-v1-auto"}, {"id": "minimax", "name": "MiniMax", "provider": "minimax", "defaultModel": "MiniMax-M2.7"}, - {"id": "claw402", "name": "Claw402 (Base USDC)", "provider": "claw402", "defaultModel": "deepseek"}, + {"id": "claw402", "name": "Claw402 (Base USDC)", "provider": "claw402", "defaultModel": "glm-5"}, } c.JSON(http.StatusOK, supportedModels) diff --git a/api/handler_onboarding.go b/api/handler_onboarding.go index 263d1909..5425e359 100644 --- a/api/handler_onboarding.go +++ b/api/handler_onboarding.go @@ -54,7 +54,7 @@ func (s *Server) handleBeginnerOnboarding(c *gin.Context) { } if !reusedExisting { - if err := s.store.AIModel().Update(userID, "claw402", true, privateKey, "", "deepseek"); err != nil { + if err := s.store.AIModel().Update(userID, "claw402", true, privateKey, "", "glm-5"); err != nil { logger.Errorf("Failed to save beginner claw402 config for user %s: %v", userID, err) c.JSON(http.StatusInternalServerError, gin.H{"error": "failed to save beginner model configuration"}) return @@ -68,7 +68,7 @@ func (s *Server) handleBeginnerOnboarding(c *gin.Context) { os.Setenv("CLAW402_WALLET_KEY", privateKey) os.Setenv("CLAW402_WALLET_ADDRESS", address) - os.Setenv("CLAW402_DEFAULT_MODEL", "deepseek") + os.Setenv("CLAW402_DEFAULT_MODEL", "glm-5") envSaved, envPath, envErr := persistBeginnerWalletEnv(privateKey, address) resp := beginnerOnboardingResponse{ @@ -77,7 +77,7 @@ func (s *Server) handleBeginnerOnboarding(c *gin.Context) { Chain: "base", Asset: "USDC", Provider: "claw402", - DefaultModel: "deepseek", + DefaultModel: "glm-5", ConfiguredModelID: configuredModelID, BalanceUSDC: wallet.QueryUSDCBalanceStr(address), EnvSaved: envSaved, @@ -233,7 +233,7 @@ func persistBeginnerWalletEnv(privateKey string, address string) (bool, string, if err := upsertEnvFile(path, map[string]string{ "CLAW402_WALLET_KEY": privateKey, "CLAW402_WALLET_ADDRESS": address, - "CLAW402_DEFAULT_MODEL": "deepseek", + "CLAW402_DEFAULT_MODEL": "glm-5", }); err != nil { lastErr = err continue diff --git a/mcp/payment/claw402.go b/mcp/payment/claw402.go index 990fae7d..3d8381f0 100644 --- a/mcp/payment/claw402.go +++ b/mcp/payment/claw402.go @@ -13,7 +13,7 @@ import ( const ( DefaultClaw402URL = "https://claw402.ai" - DefaultClaw402Model = "deepseek" + DefaultClaw402Model = "glm-5" ) // claw402ModelEndpoints maps user-friendly model names to claw402 API paths. @@ -39,6 +39,9 @@ var claw402ModelEndpoints = map[string]string{ "gemini-3.1-pro": "/api/v1/ai/gemini/chat/3.1-pro", // Kimi "kimi-k2.5": "/api/v1/ai/kimi/chat/k2.5", + // Z.AI (智谱) + "glm-5": "/api/v1/ai/zhipu/chat", + "glm-5-turbo": "/api/v1/ai/zhipu/chat/turbo", } func init() { diff --git a/web/src/components/trader/model-constants.ts b/web/src/components/trader/model-constants.ts index 2b53be37..2a1d8e00 100644 --- a/web/src/components/trader/model-constants.ts +++ b/web/src/components/trader/model-constants.ts @@ -96,7 +96,7 @@ export const AI_PROVIDER_CONFIG: Record = { apiName: 'MiniMax', }, claw402: { - defaultModel: 'deepseek', + defaultModel: 'glm-5', apiUrl: 'https://claw402.ai', apiName: 'Claw402', },