@lobehub/chat 1.83.6 → 1.83.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -75,7 +75,7 @@ jobs:
75
75
  # PR 构建:在基础版本号上添加 PR 信息
76
76
  pr_number="${{ github.event.pull_request.number }}"
77
77
  ci_build_number="${{ github.run_number }}" # CI 构建编号
78
- version="${base_version}-nightly.pr${pr_number}.${ci_build_number}"
78
+ version="0.0.0-nightly.pr${pr_number}.${ci_build_number}"
79
79
  echo "version=${version}" >> $GITHUB_OUTPUT
80
80
  echo "📦 Release Version: ${version} (based on base version ${base_version})"
81
81
 
package/CHANGELOG.md CHANGED
@@ -2,6 +2,56 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.83.8](https://github.com/lobehub/lobe-chat/compare/v1.83.7...v1.83.8)
6
+
7
+ <sup>Released on **2025-04-28**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Fix cloud data sync.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Fix cloud data sync, closes [#7600](https://github.com/lobehub/lobe-chat/issues/7600) ([1214544](https://github.com/lobehub/lobe-chat/commit/1214544))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
30
+ ### [Version 1.83.7](https://github.com/lobehub/lobe-chat/compare/v1.83.6...v1.83.7)
31
+
32
+ <sup>Released on **2025-04-27**</sup>
33
+
34
+ #### 💄 Styles
35
+
36
+ - **misc**: Fix `doubao-1-5-thinking-pro-vision` endpoint calling.
37
+
38
+ <br/>
39
+
40
+ <details>
41
+ <summary><kbd>Improvements and Fixes</kbd></summary>
42
+
43
+ #### Styles
44
+
45
+ - **misc**: Fix `doubao-1-5-thinking-pro-vision` endpoint calling, closes [#7478](https://github.com/lobehub/lobe-chat/issues/7478) ([a52f7d6](https://github.com/lobehub/lobe-chat/commit/a52f7d6))
46
+
47
+ </details>
48
+
49
+ <div align="right">
50
+
51
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
52
+
53
+ </div>
54
+
5
55
  ### [Version 1.83.6](https://github.com/lobehub/lobe-chat/compare/v1.83.5...v1.83.6)
6
56
 
7
57
  <sup>Released on **2025-04-27**</sup>
@@ -70,7 +70,8 @@ export default class RemoteServerSyncCtr extends ControllerModule {
70
70
  remoteServerUrl,
71
71
  } = args;
72
72
 
73
- const logPrefix = `[ForwardRequest ${method} ${urlPath}]`; // Add prefix for easier correlation
73
+ const pathname = new URL(urlPath, remoteServerUrl).pathname; // Extract pathname from URL
74
+ const logPrefix = `[ForwardRequest ${method} ${pathname}]`; // Add prefix for easier correlation
74
75
 
75
76
  if (!accessToken) {
76
77
  logger.error(`${logPrefix} No access token provided`); // Enhanced log
@@ -85,8 +86,6 @@ export default class RemoteServerSyncCtr extends ControllerModule {
85
86
  // 1. Determine target URL and prepare request options
86
87
  const targetUrl = new URL(urlPath, remoteServerUrl); // Combine base URL and path
87
88
 
88
- logger.debug(`${logPrefix} Forwarding to ${targetUrl.toString()}`); // Enhanced log
89
-
90
89
  // Prepare headers, cloning and adding Authorization
91
90
  const requestHeaders: OutgoingHttpHeaders = { ...originalHeaders }; // Use OutgoingHttpHeaders
92
91
  requestHeaders['Authorization'] = `Bearer ${accessToken}`;
@@ -119,9 +118,6 @@ export default class RemoteServerSyncCtr extends ControllerModule {
119
118
 
120
119
  clientRes.on('end', () => {
121
120
  const responseBody = Buffer.concat(chunks);
122
- logger.debug(
123
- `${logPrefix} Received response from ${targetUrl.toString()}: ${clientRes.statusCode}`,
124
- ); // Enhanced log
125
121
  resolve({
126
122
  // These are IncomingHttpHeaders
127
123
  body: responseBody,
@@ -192,7 +188,8 @@ export default class RemoteServerSyncCtr extends ControllerModule {
192
188
  urlPath: args.urlPath, // Log headers too for context
193
189
  });
194
190
 
195
- const logPrefix = `[ProxyTRPC ${args.method} ${args.urlPath}]`; // Prefix for this specific request
191
+ const url = new URL(args.urlPath, 'http://a.b');
192
+ const logPrefix = `[ProxyTRPC ${args.method} ${url.pathname}]`; // Prefix for this specific request
196
193
 
197
194
  try {
198
195
  const config = await this.remoteServerConfigCtr.getRemoteServerConfig();
@@ -1,6 +1,7 @@
1
1
  import { ElectronIPCEventHandler, ElectronIPCServer } from '@lobechat/electron-server-ipc';
2
2
  import { Session, app, ipcMain, protocol } from 'electron';
3
3
  import { macOS, windows } from 'electron-is';
4
+ import os from 'node:os';
4
5
  import { join } from 'node:path';
5
6
 
6
7
  import { name } from '@/../../package.json';
@@ -54,6 +55,13 @@ export class App {
54
55
  }
55
56
 
56
57
  constructor() {
58
+ logger.info('----------------------------------------------');
59
+ // Log system information
60
+ logger.info(` OS: ${os.platform()} (${os.arch()})`);
61
+ logger.info(` CPU: ${os.cpus().length} cores`);
62
+ logger.info(` RAM: ${Math.round(os.totalmem() / 1024 / 1024 / 1024)} GB`);
63
+ logger.info(`PATH: ${app.getAppPath()}`);
64
+ logger.info(` lng: ${app.getLocale()}`);
57
65
  logger.info('----------------------------------------------');
58
66
  logger.info('Starting LobeHub...');
59
67
 
@@ -251,6 +251,12 @@ export class MacOSMenu extends BaseMenuPlatform implements IMenuPlatform {
251
251
  },
252
252
  label: '更新缓存目录',
253
253
  },
254
+ {
255
+ click: () => {
256
+ this.app.storeManager.openInEditor();
257
+ },
258
+ label: '打开 Settings 配置文件',
259
+ },
254
260
  { type: 'separator' },
255
261
  {
256
262
  label: '自动更新测试模拟',
@@ -24,8 +24,9 @@ export const createLogger = (namespace: string) => {
24
24
  },
25
25
  info: (message, ...args) => {
26
26
  if (process.env.NODE_ENV === 'production') {
27
- electronLog.info(message, ...args);
27
+ electronLog.info(`[${namespace}]`, message, ...args);
28
28
  }
29
+
29
30
  debugLogger(`INFO: ${message}`, ...args);
30
31
  },
31
32
  verbose: (message, ...args) => {
package/changelog/v1.json CHANGED
@@ -1,4 +1,22 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "fixes": [
5
+ "Fix cloud data sync."
6
+ ]
7
+ },
8
+ "date": "2025-04-28",
9
+ "version": "1.83.8"
10
+ },
11
+ {
12
+ "children": {
13
+ "improvements": [
14
+ "Fix doubao-1-5-thinking-pro-vision endpoint calling."
15
+ ]
16
+ },
17
+ "date": "2025-04-27",
18
+ "version": "1.83.7"
19
+ },
2
20
  {
3
21
  "children": {
4
22
  "fixes": [
@@ -0,0 +1,113 @@
1
+ ---
2
+ title: Automatic Synchronization with LobeChat Desktop
3
+ description: Configure LobeChat Desktop for a synchronized experience
4
+ tags:
5
+ - LobeChat
6
+ - Desktop Synchronization
7
+ - Self-Hosted Instance
8
+ - OIDC Configuration
9
+ ---
10
+
11
+ # Automatic Synchronization with LobeChat Desktop
12
+
13
+ LobeChat Desktop provides users with an enhanced experience while also expanding the capabilities of LobeChat, allowing users to utilize LobeChat in offline environments. This document will guide you on how to configure LobeChat Desktop and connect it to your self-hosted instance.
14
+
15
+ ## System Requirements
16
+
17
+ LobeChat Desktop is built using Electron and supports the following operating systems:
18
+
19
+ - Windows
20
+ - macOS
21
+ - Linux (certain distributions)
22
+
23
+ ## Desktop Version Information
24
+
25
+ The version release of LobeChat Desktop follows this logic:
26
+
27
+ - **Beta Version**: All merges to the main branch that are automatically released will be created as Beta versions of LobeChat Desktop.
28
+ - **Stable Version**: The development team will periodically release stable versions through manual tagging.
29
+
30
+ If you wish to access the latest features, you can use the Beta version; if you prioritize stability, please use the Stable version.
31
+
32
+ ## Connecting to a Self-Hosted Instance
33
+
34
+ LobeChat Desktop can connect to your self-hosted LobeChat instance, allowing you to use your self-hosted configuration on the desktop.
35
+
36
+ ### Preparations
37
+
38
+ Before connecting the desktop to your self-hosted instance, ensure that your self-hosted instance is correctly configured with the OIDC-related environment variables.
39
+
40
+ <Callout>
41
+ Please ensure that your self-hosted instance version is 1.83.6 or higher to support desktop connection features.
42
+ </Callout>
43
+
44
+ #### OIDC Environment Variable Configuration
45
+
46
+ You need to add the following two environment variables, `ENABLE_OIDC` and `OIDC_JWKS_KEY`, to your self-hosted instance. You can click the button below to generate them with one click:
47
+
48
+ <OIDCJWKs />
49
+
50
+ Add the generated JWK key to your environment variables.
51
+
52
+ If you are deploying LobeChat using one-click deployment methods (such as Vercel, Railway, etc.), you need to:
53
+
54
+ 1. Add the above environment variables to the environment variable configuration of your deployment platform.
55
+ 2. For Vercel deployments, ensure that the `APP_URL` environment variable is set to your domain URL, which is crucial for correctly handling authentication callbacks.
56
+
57
+ ### Connection Steps
58
+
59
+ 1. Open LobeChat Desktop.
60
+ 2. Click the Wi-Fi icon in the upper right corner.
61
+ 3. Enter the address of your self-hosted instance (e.g., `https://your-lobechat-instance.com`).
62
+ 4. Click the "Connect" button.
63
+ 5. You will be redirected to the login page; after completing the authorization, you can use your self-hosted configuration.
64
+
65
+ ## Frequently Asked Questions
66
+
67
+ ### 502 Bad Gateway
68
+
69
+ **Issue:** After clicking the authorization button, a 502 Bad Gateway error occurs when redirected to the `/oidc/consent` path.
70
+
71
+ **Solution:**
72
+
73
+ - Confirm that you have correctly set the `ENABLE_OIDC=1` and `OIDC_JWKS_KEY` environment variables.
74
+ - Ensure that `OIDC_JWKS_KEY` is in valid JSON format without extra single quotes.
75
+ - Check your server logs for specific error messages.
76
+
77
+ If you are using Nginx as a reverse proxy, the issue may be due to oversized request headers. You can try adding the following settings to your Nginx configuration:
78
+
79
+ ```nginx
80
+ proxy_buffer_size 16k;
81
+ proxy_buffers 8 16k;
82
+ proxy_busy_buffers_size 32k;
83
+ ```
84
+
85
+ ### invalid\_redirect\_uri Error
86
+
87
+ **Issue:** Encountering the error "redirect\_uri did not match any of the client's registered redirect\_uris" during the authorization process.
88
+
89
+ **Solution:**
90
+
91
+ Check if the `APP_URL` environment variable matches the URL you are accessing.
92
+
93
+ ### macOS Startup Hangs or Crashes
94
+
95
+ **Issue:** On macOS, the application hangs for a long time or crashes after startup.
96
+
97
+ **Solution:**
98
+
99
+ - Check if you have downloaded the correct macOS architecture version:
100
+ - For Apple Silicon (M3/M4, etc.) Macs, use the `arm64` version.
101
+ - For Intel Macs, use the `x64` version.
102
+ - Example file names:
103
+ - Apple Silicon: `LobeHub-Beta-1.83.6-arm64.dmg` or `LobeHub-Beta-1.83.6-arm64-mac.zip`
104
+ - Intel: `LobeHub-Beta-1.83.6-x64.dmg` or `LobeHub-Beta-1.83.6-mac.zip`
105
+
106
+ ### Image Loading Issues
107
+
108
+ **Issue:** When using a Docker-deployed server, the desktop client cannot load avatars or other image resources after connecting.
109
+
110
+ **Solution:**
111
+
112
+ - If you are using Minio for storage, ensure that cross-origin requests are allowed in the Minio configuration.
113
+ - Add appropriate CORS settings in your Minio service.
@@ -0,0 +1,114 @@
1
+ ---
2
+ title: 与 LobeChat 桌面端自动同步
3
+ description: 配置 LobeChat 桌面端,获取端同步体验
4
+ tags:
5
+ - LobeChat
6
+ - 桌面端
7
+ - 自托管
8
+ - OIDC
9
+ - 配置指南
10
+ ---
11
+
12
+ # 与 LobeChat 桌面端自动同步
13
+
14
+ LobeChat 桌面端为用户提供了更好的使用体验,同时也扩展了 LobeChat 的能力边界,允许用户在离线环境下使用 LobeChat。本文档将指导您如何配置 LobeChat 桌面端以及如何将其与自托管实例连接。
15
+
16
+ ## 系统要求
17
+
18
+ LobeChat 桌面端使用 Electron 构建,支持以下操作系统:
19
+
20
+ - Windows
21
+ - macOS
22
+ - Linux(部分发行版)
23
+
24
+ ## 桌面端版本说明
25
+
26
+ LobeChat 桌面端的版本发布遵循以下逻辑:
27
+
28
+ - **Beta 版本**:所有合并到 main 分支并自动发布版本,都会自动创建为 LobeChat 桌面端的 Beta 版本
29
+ - **Stable 版本**:开发团队会通过手动打标来定期发布稳定版本
30
+
31
+ 如果您希望获得最新功能,可以使用 Beta 版本;如果您注重稳定性,请使用 Stable 版本。
32
+
33
+ ## 与自托管实例连接
34
+
35
+ LobeChat 桌面端可以与您自托管的 LobeChat 实例连接,以便您可以在桌面端使用您的自托管配置。
36
+
37
+ ### 准备工作
38
+
39
+ 在将桌面端与自托管实例连接前,您需要确保您的自托管实例已正确配置 OIDC 相关环境变量。
40
+
41
+ <Callout>
42
+ 请确保您的自托管实例版本为 1.83.6 或更高,以支持桌面端连接功能。
43
+ </Callout>
44
+
45
+ #### OIDC 环境变量配置
46
+
47
+ 您需要在自托管实例中添加以下`ENABLE_OIDC` 和 `OIDC_JWKS_KEY` 这两个环境变量,你可以点击下方按钮一键生成:
48
+
49
+ <OIDCJWKs />
50
+
51
+ 将生成的 JWK 密钥添加到您的环境变量中。
52
+
53
+ 如果您使用一键部署方式(如 Vercel、Railway 等平台)部署 LobeChat,您需要:
54
+
55
+ 1. 将上述环境变量添加到部署平台的环境变量配置中
56
+ 2. 对于 Vercel 部署,请确保 `APP_URL` 环境变量设置为你的域名 URL,这对于正确处理认证回调至关重要
57
+
58
+ ### 连接步骤
59
+
60
+ 1. 打开 LobeChat 桌面端
61
+ 2. 点击右上角 wifi 图标
62
+ 3. 输入您的自托管实例地址(例如:`https://your-lobechat-instance.com`)
63
+ 4. 点击 "连接" 按钮
64
+ 5. 您将被重定向到登录页面,完成授权后即可使用您的自托管配置
65
+
66
+ ## 常见问题
67
+
68
+ ### 502 Bad Gateway
69
+
70
+ **问题:** 点击授权按钮后,跳转到 `/oidc/consent` 路径时出现 502 Bad Gateway 错误。
71
+
72
+ **解决方案:**
73
+
74
+ - 确认您已经正确设置了 `ENABLE_OIDC=1` 和 `OIDC_JWKS_KEY` 环境变量
75
+ - 确保 `OIDC_JWKS_KEY` 是有效的 JSON 格式,没有额外的单引号
76
+ - 检查您的服务端日志,查看具体错误信息
77
+
78
+ 如果您使用 Nginx 作为反向代理,可能是请求头太大导致的问题。可以尝试在 Nginx 配置中添加以下设置:
79
+
80
+ ```nginx
81
+ proxy_buffer_size 16k;
82
+ proxy_buffers 8 16k;
83
+ proxy_busy_buffers_size 32k;
84
+ ```
85
+
86
+ ### invalid\_redirect\_uri 错误
87
+
88
+ **问题:** 授权过程中遇到 "redirect\_uri did not match any of the client's registered redirect\_uris" 错误。
89
+
90
+ **解决方案:**
91
+
92
+ 检查 `APP_URL` 环境变量是否与您访问的 URL 一致
93
+
94
+ ### macOS 启动卡住或闪退
95
+
96
+ **问题:** 在 macOS 上,应用启动后长时间卡住或闪退。
97
+
98
+ **解决方案:**
99
+
100
+ - 检查您是否下载了正确的 macOS 架构版本:
101
+ - 对于 Apple Silicon (M3/M4 等) Mac,应使用 `arm64` 版本
102
+ - 对于 Intel Mac,应使用 `x64` 版本
103
+ - 文件名示例:
104
+ - Apple Silicon: `LobeHub-Beta-1.83.6-arm64.dmg` 或 `LobeHub-Beta-1.83.6-arm64-mac.zip`
105
+ - Intel: `LobeHub-Beta-1.83.6-x64.dmg` 或 `LobeHub-Beta-1.83.6-mac.zip`
106
+
107
+ ### 图片加载问题
108
+
109
+ **问题:** 使用 Docker 部署的服务端,桌面端连接后无法加载头像或其他图片资源。
110
+
111
+ **解决方案:**
112
+
113
+ - 如果您使用 Minio 作为存储,需要在 Minio 配置中允许跨域请求
114
+ - 在您的 Minio 服务中添加适当的 CORS 配置
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.83.6",
3
+ "version": "1.83.8",
4
4
  "description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
5
5
  "keywords": [
6
6
  "framework",
@@ -17,7 +17,7 @@ const doubaoChatModels: AIChatModelCard[] = [
17
17
  'Doubao-1.5全新深度思考模型,在数学、编程、科学推理等专业领域及创意写作等通用任务中表现突出,在AIME 2024、Codeforces、GPQA等多项权威基准上达到或接近业界第一梯队水平。支持128k上下文窗口,16k输出。',
18
18
  displayName: 'Doubao 1.5 Thinking Pro',
19
19
  enabled: true,
20
- id: 'Doubao-1.5-thinking-pro',
20
+ id: 'doubao-1.5-thinking-pro',
21
21
  maxOutput: 16_000,
22
22
  pricing: {
23
23
  currency: 'CNY',
@@ -33,14 +33,14 @@ const doubaoChatModels: AIChatModelCard[] = [
33
33
  vision: true,
34
34
  },
35
35
  config: {
36
- deploymentName: 'doubao-1-5-thinking-pro-vision-250415',
36
+ deploymentName: 'doubao-1-5-thinking-pro-m-250415',
37
37
  },
38
38
  contextWindowTokens: 128_000,
39
39
  description:
40
40
  'Doubao-1.5全新深度思考模型,在数学、编程、科学推理等专业领域及创意写作等通用任务中表现突出,在AIME 2024、Codeforces、GPQA等多项权威基准上达到或接近业界第一梯队水平。支持128k上下文窗口,16k输出。',
41
41
  displayName: 'Doubao 1.5 Thinking Pro Vision',
42
42
  enabled: true,
43
- id: 'Doubao-1.5-thinking-pro-vision',
43
+ id: 'doubao-1.5-thinking-pro-vision',
44
44
  maxOutput: 16_000,
45
45
  pricing: {
46
46
  currency: 'CNY',
@@ -12,17 +12,14 @@ interface SyncProps {
12
12
  const RemoteStatus = memo<SyncProps>(({ onClick }) => {
13
13
  const { t } = useTranslation('electron');
14
14
 
15
- const [isIniting, isSyncActive, useRemoteServerConfig, useRefreshDataWhenActive] =
16
- useElectronStore((s) => [
17
- !s.isInitRemoteServerConfig,
18
- electronSyncSelectors.isSyncActive(s),
19
- s.useDataSyncConfig,
20
- s.useRefreshDataWhenActive,
21
- ]);
15
+ const [isIniting, isSyncActive, useRemoteServerConfig] = useElectronStore((s) => [
16
+ !s.isInitRemoteServerConfig,
17
+ electronSyncSelectors.isSyncActive(s),
18
+ s.useDataSyncConfig,
19
+ ]);
22
20
 
23
21
  // 使用useSWR获取远程服务器配置
24
22
  useRemoteServerConfig();
25
- useRefreshDataWhenActive(isSyncActive);
26
23
 
27
24
  return (
28
25
  <ActionIcon
@@ -1,5 +1,7 @@
1
1
  import useSWR, { SWRHook } from 'swr';
2
2
 
3
+ import { isDesktop } from '@/const/version';
4
+
3
5
  /**
4
6
  * This type of request method is relatively flexible data, which will be triggered on the first time
5
7
  *
@@ -25,7 +27,12 @@ export const useClientDataSWR: SWRHook = (key, fetch, config) =>
25
27
  // Cause issue like this: https://github.com/lobehub/lobe-chat/issues/532
26
28
  // we need to set it to 0.
27
29
  dedupingInterval: 0,
28
- focusThrottleInterval: 5 * 60 * 1000,
30
+ focusThrottleInterval:
31
+ // desktop 1.5s
32
+ isDesktop
33
+ ? 1500
34
+ : // web 300s
35
+ 5 * 60 * 1000,
29
36
  refreshWhenOffline: false,
30
37
  revalidateOnFocus: true,
31
38
  revalidateOnReconnect: true,
@@ -17,7 +17,6 @@ export interface ElectronRemoteServerAction {
17
17
  refreshServerConfig: () => Promise<void>;
18
18
  refreshUserData: () => Promise<void>;
19
19
  useDataSyncConfig: () => SWRResponse;
20
- useRefreshDataWhenActive: (active?: boolean) => SWRResponse;
21
20
  }
22
21
 
23
22
  const REMOTE_SERVER_CONFIG_KEY = 'electron:getRemoteServerConfig';
@@ -109,14 +108,12 @@ export const remoteSyncSlice: StateCreator<
109
108
  },
110
109
  {
111
110
  onSuccess: (data) => {
111
+ if (!isEqual(data, get().dataSyncConfig)) {
112
+ get().refreshUserData();
113
+ }
114
+
112
115
  set({ dataSyncConfig: data, isInitRemoteServerConfig: true });
113
116
  },
114
117
  },
115
118
  ),
116
- useRefreshDataWhenActive: (active) =>
117
- useSWR(['refreshDataWhenActive', active], async () => {
118
- if (!active) return;
119
-
120
- await get().refreshUserData();
121
- }),
122
119
  });
@@ -1,6 +0,0 @@
1
- # LobeHub Desktop
2
-
3
- 构建路径:
4
-
5
- - dist: 构建产物路径
6
- - release: 发布产物路径