{"record":{"id":"ad16ae5c813e4883","repo":"chenhg5/cc-connect","slug":"wps-agentspace-auto-login-failed-w","errorCode":null,"errorMessage":"wps-agentspace: auto-login failed: %w","messagePattern":"wps-agentspace: auto-login failed: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"platform/wps-agentspace/wpsagentspace.go","lineNumber":126,"sourceCode":"func init() {\n\tcore.RegisterPlatform(\"wps-agentspace\", New)\n}\n\n// New creates a new Platform instance.\nfunc New(opts map[string]any) (core.Platform, error) {\n\tappID, _ := opts[\"app_id\"].(string)\n\twpsSid, _ := opts[\"wps_sid\"].(string)\n\n\t// Try to get wps_sid from environment variable\n\tif wpsSid == \"\" {\n\t\twpsSid = getEnvWithPrefix(\"WPS_SID\", \"\")\n\t}\n\n\t// If wps_sid is empty, try auto-login\n\tif wpsSid == \"\" {\n\t\tsid, encrypted, err := autoLogin(appID)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"wps-agentspace: auto-login failed: %w\", err)\n\t\t}\n\t\twpsSid = sid\n\n\t\t// Auto-save to config file\n\t\tif encrypted != \"\" {\n\t\t\tsaved := saveToConfig(appID, encrypted)\n\t\t\tif saved {\n\t\t\t\tfmt.Println(\"\\n✓ Token 已自动保存到配置文件\")\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"\\n=========================================\")\n\t\t\t\tfmt.Println(\"  Token 已获取，请设置环境变量：\")\n\t\t\t\tfmt.Println(\"=========================================\")\n\t\t\t\tfmt.Printf(\"\\n  export WPS_SID='%s'\\n\\n\", encrypted)\n\t\t\t\tfmt.Println(\"  或添加到 ~/.zshrc / ~/.bashrc\")\n\t\t\t\tfmt.Println(\"=========================================\")\n\t\t\t}\n\t\t}\n\t}","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/platform/wps-agentspace/wpsagentspace.go#L108-L144","documentation":"During platform construction, no wps_sid was available from config or environment, and the autoLogin attempt with the configured app_id also failed — so the platform cannot authenticate to WPS Agentspace at all.","triggerScenarios":"Thrown at platform/wps-agentspace/wpsagentspace.go:126 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a valid wps_sid explicitly in config or via the WPS_SID environment variable","Verify the app_id used for autoLogin is correct and the login endpoint is reachable","Treat as fatal startup misconfiguration: fail fast and surface the wrapped autoLogin error"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}