@lobehub/lobehub 2.0.0-next.190 → 2.0.0-next.192

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.
Files changed (98) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/changelog/v1.json +18 -0
  3. package/e2e/docs/testing-tips.md +30 -0
  4. package/e2e/src/steps/discover/smoke.steps.ts +11 -33
  5. package/locales/zh-CN/auth.json +1 -1
  6. package/package.json +1 -2
  7. package/packages/const/src/utils/merge.test.ts +679 -0
  8. package/packages/context-engine/src/processors/__tests__/AgentCouncilFlatten.test.ts +0 -20
  9. package/packages/context-engine/src/processors/__tests__/MessageContent.test.ts +5 -23
  10. package/packages/context-engine/src/providers/SystemRoleInjector.ts +0 -1
  11. package/packages/conversation-flow/src/__tests__/fixtures/inputs/agentCouncil/simple.json +4 -19
  12. package/packages/conversation-flow/src/__tests__/fixtures/inputs/agentCouncil/with-supervisor-reply.json +4 -23
  13. package/packages/conversation-flow/src/__tests__/fixtures/inputs/agentGroup/speak-different-agent.json +3 -13
  14. package/packages/conversation-flow/src/__tests__/fixtures/inputs/assistant-chain-with-followup.json +3 -8
  15. package/packages/conversation-flow/src/__tests__/fixtures/inputs/assistantGroup/assistant-with-tools.json +21 -17
  16. package/packages/conversation-flow/src/__tests__/fixtures/inputs/assistantGroup/tools-with-branches.json +15 -15
  17. package/packages/conversation-flow/src/__tests__/fixtures/inputs/branch/active-index-1.json +3 -13
  18. package/packages/conversation-flow/src/__tests__/fixtures/inputs/branch/assistant-branch.json +2 -9
  19. package/packages/conversation-flow/src/__tests__/fixtures/inputs/branch/assistant-group-branches.json +0 -11
  20. package/packages/conversation-flow/src/__tests__/fixtures/inputs/branch/assistant-user-branch.json +5 -15
  21. package/packages/conversation-flow/src/__tests__/fixtures/inputs/branch/conversation.json +4 -14
  22. package/packages/conversation-flow/src/__tests__/fixtures/inputs/branch/multi-assistant-group.json +0 -13
  23. package/packages/conversation-flow/src/__tests__/fixtures/inputs/branch/nested.json +2 -15
  24. package/packages/conversation-flow/src/__tests__/fixtures/inputs/compare/simple.json +4 -9
  25. package/packages/conversation-flow/src/__tests__/fixtures/inputs/compare/with-tools.json +8 -17
  26. package/packages/conversation-flow/src/__tests__/fixtures/inputs/linear-conversation.json +3 -7
  27. package/packages/conversation-flow/src/__tests__/fixtures/inputs/tasks/simple.json +1 -7
  28. package/packages/conversation-flow/src/__tests__/fixtures/inputs/tasks/with-summary.json +10 -11
  29. package/packages/conversation-flow/src/__tests__/fixtures/outputs/agentCouncil/simple.json +2 -32
  30. package/packages/conversation-flow/src/__tests__/fixtures/outputs/agentCouncil/with-supervisor-reply.json +8 -46
  31. package/packages/conversation-flow/src/__tests__/fixtures/outputs/agentGroup/speak-different-agent.json +5 -24
  32. package/packages/conversation-flow/src/__tests__/fixtures/outputs/assistant-chain-with-followup.json +5 -13
  33. package/packages/conversation-flow/src/__tests__/fixtures/outputs/assistantGroup/assistant-with-tools.json +6 -16
  34. package/packages/conversation-flow/src/__tests__/fixtures/outputs/assistantGroup/tools-with-branches.json +6 -17
  35. package/packages/conversation-flow/src/__tests__/fixtures/outputs/branch/active-index-1.json +4 -18
  36. package/packages/conversation-flow/src/__tests__/fixtures/outputs/branch/assistant-branch.json +4 -16
  37. package/packages/conversation-flow/src/__tests__/fixtures/outputs/branch/assistant-group-branches.json +0 -19
  38. package/packages/conversation-flow/src/__tests__/fixtures/outputs/branch/assistant-user-branch.json +8 -24
  39. package/packages/conversation-flow/src/__tests__/fixtures/outputs/branch/conversation.json +7 -23
  40. package/packages/conversation-flow/src/__tests__/fixtures/outputs/branch/multi-assistant-group.json +0 -15
  41. package/packages/conversation-flow/src/__tests__/fixtures/outputs/branch/nested.json +4 -25
  42. package/packages/conversation-flow/src/__tests__/fixtures/outputs/compare/simple.json +2 -13
  43. package/packages/conversation-flow/src/__tests__/fixtures/outputs/compare/with-tools.json +4 -20
  44. package/packages/conversation-flow/src/__tests__/fixtures/outputs/linear-conversation.json +4 -12
  45. package/packages/conversation-flow/src/__tests__/fixtures/outputs/tasks/simple.json +2 -14
  46. package/packages/conversation-flow/src/__tests__/fixtures/outputs/tasks/with-summary.json +20 -22
  47. package/packages/conversation-flow/src/__tests__/indexing.test.ts +0 -35
  48. package/packages/conversation-flow/src/__tests__/structuring.test.ts +0 -41
  49. package/packages/conversation-flow/src/transformation/FlatListBuilder.ts +0 -4
  50. package/packages/conversation-flow/src/transformation/__tests__/BranchResolver.test.ts +0 -10
  51. package/packages/conversation-flow/src/transformation/__tests__/ContextTreeBuilder.test.ts +0 -19
  52. package/packages/conversation-flow/src/transformation/__tests__/FlatListBuilder.test.ts +0 -37
  53. package/packages/conversation-flow/src/transformation/__tests__/MessageCollector.test.ts +0 -12
  54. package/packages/conversation-flow/src/transformation/__tests__/MessageTransformer.test.ts +0 -2
  55. package/packages/database/package.json +1 -1
  56. package/packages/database/src/client/db.test.ts +19 -144
  57. package/packages/database/src/client/db.ts +26 -234
  58. package/packages/database/src/models/__tests__/_util.ts +19 -3
  59. package/packages/database/src/models/message.ts +0 -1
  60. package/packages/prompts/src/prompts/chatMessages/index.test.ts +0 -1
  61. package/packages/prompts/src/prompts/groupChat/__snapshots__/index.test.ts.snap +0 -21
  62. package/packages/prompts/src/prompts/groupChat/index.test.ts +0 -3
  63. package/packages/types/src/message/ui/chat.ts +0 -2
  64. package/src/app/[variants]/(main)/settings/provider/features/ModelList/ModelItem.tsx +8 -7
  65. package/src/features/Conversation/store/slices/data/action.test.ts +0 -14
  66. package/src/features/Conversation/store/slices/data/reducer.test.ts +0 -21
  67. package/src/features/Conversation/store/slices/data/reducer.ts +1 -1
  68. package/src/features/Conversation/store/slices/message/action/crud.test.ts +0 -10
  69. package/src/libs/next/config/define-config.ts +1 -1
  70. package/src/server/modules/Mecha/ContextEngineering/__tests__/serverMessagesEngine.test.ts +3 -5
  71. package/src/server/routers/lambda/__tests__/message.test.ts +1 -2
  72. package/src/server/services/agentRuntime/AgentRuntimeService.ts +109 -109
  73. package/src/server/services/agentRuntime/types.ts +8 -8
  74. package/src/server/services/doc/index.tsx +2 -2
  75. package/src/server/services/generation/index.ts +2 -2
  76. package/src/server/services/message/index.ts +3 -3
  77. package/src/server/services/usage/index.ts +4 -4
  78. package/src/services/chat/chat.test.ts +0 -6
  79. package/src/services/chat/mecha/contextEngineering.test.ts +3 -29
  80. package/src/services/chat/mecha/modelParamsResolver.test.ts +803 -0
  81. package/src/store/chat/agents/GroupOrchestration/createGroupOrchestrationExecutors.ts +0 -2
  82. package/src/store/chat/agents/__tests__/createAgentExecutors/call-tool.test.ts +0 -6
  83. package/src/store/chat/agents/__tests__/createAgentExecutors/fixtures/mockMessages.ts +0 -3
  84. package/src/store/chat/agents/createAgentExecutors.ts +4 -4
  85. package/src/store/chat/slices/aiAgent/actions/__tests__/agentGroup.test.ts +0 -2
  86. package/src/store/chat/slices/aiAgent/actions/__tests__/runAgent.test.ts +0 -3
  87. package/src/store/chat/slices/aiChat/actions/conversationLifecycle.ts +0 -1
  88. package/src/store/chat/slices/builtinTool/actions/__tests__/search.test.ts +0 -4
  89. package/src/store/chat/slices/message/reducer.test.ts +0 -5
  90. package/src/store/chat/slices/message/reducer.ts +1 -1
  91. package/src/store/chat/slices/message/selectors/displayMessage.test.ts +0 -13
  92. package/src/store/chat/slices/message/selectors/displayMessage.ts +3 -34
  93. package/src/store/chat/slices/portal/selectors.test.ts +0 -7
  94. package/src/store/chat/slices/thread/action.test.ts +0 -1
  95. package/src/store/chat/slices/translate/action.test.ts +0 -1
  96. package/src/store/tool/slices/oldStore/action.test.ts +0 -1
  97. package/packages/database/src/client/pglite.ts +0 -17
  98. package/packages/database/src/client/pglite.worker.ts +0 -25
package/CHANGELOG.md CHANGED
@@ -2,6 +2,56 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ## [Version 2.0.0-next.192](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.191...v2.0.0-next.192)
6
+
7
+ <sup>Released on **2026-01-02**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Fix model edit icon missing.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Fix model edit icon missing, closes [#11105](https://github.com/lobehub/lobe-chat/issues/11105) ([0f88995](https://github.com/lobehub/lobe-chat/commit/0f88995))
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 2.0.0-next.191](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.190...v2.0.0-next.191)
31
+
32
+ <sup>Released on **2026-01-02**</sup>
33
+
34
+ #### ♻ Code Refactoring
35
+
36
+ - **misc**: Refactor to remove meta in message.
37
+
38
+ <br/>
39
+
40
+ <details>
41
+ <summary><kbd>Improvements and Fixes</kbd></summary>
42
+
43
+ #### Code refactoring
44
+
45
+ - **misc**: Refactor to remove meta in message, closes [#11103](https://github.com/lobehub/lobe-chat/issues/11103) ([527c1cd](https://github.com/lobehub/lobe-chat/commit/527c1cd))
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 2.0.0-next.190](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.189...v2.0.0-next.190)
6
56
 
7
57
  <sup>Released on **2026-01-02**</sup>
package/changelog/v1.json CHANGED
@@ -1,4 +1,22 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "fixes": [
5
+ "Fix model edit icon missing."
6
+ ]
7
+ },
8
+ "date": "2026-01-02",
9
+ "version": "2.0.0-next.192"
10
+ },
11
+ {
12
+ "children": {
13
+ "improvements": [
14
+ "Refactor to remove meta in message."
15
+ ]
16
+ },
17
+ "date": "2026-01-02",
18
+ "version": "2.0.0-next.191"
19
+ },
2
20
  {
3
21
  "children": {
4
22
  "improvements": [
@@ -64,6 +64,36 @@ HEADLESS=false pnpm exec cucumber-js --config cucumber.config.js --tags "@smoke"
64
64
 
65
65
  ## 常见问题
66
66
 
67
+ ### waitForLoadState ('networkidle') 超时
68
+
69
+ **原因**: `networkidle` 表示 500ms 内没有网络请求。在 CI 环境中,由于分析脚本、外部资源加载、轮询等持续网络活动,这个状态可能永远无法达到。
70
+
71
+ **错误示例**:
72
+
73
+ ```
74
+ page.waitForLoadState: Timeout 10000ms exceeded.
75
+ =========================== logs ===========================
76
+ "load" event fired
77
+ ============================================================
78
+ ```
79
+
80
+ **解决**:
81
+
82
+ - **避免使用 `networkidle`** - 这是不可靠的等待策略
83
+ - **直接等待目标元素** - 使用 `expect(element).toBeVisible({ timeout: 30_000 })` 替代
84
+ - 如果必须等待页面加载完成,使用 `domcontentloaded` 或 `load` 事件
85
+
86
+ ```typescript
87
+ // ❌ 不推荐 - networkidle 在 CI 中容易超时
88
+ await this.page.waitForLoadState('networkidle', { timeout: 10_000 });
89
+ const element = this.page.locator('[data-testid="my-element"]');
90
+ await expect(element).toBeVisible();
91
+
92
+ // ✅ 推荐 - 直接等待目标元素
93
+ const element = this.page.locator('[data-testid="my-element"]');
94
+ await expect(element).toBeVisible({ timeout: 30_000 });
95
+ ```
96
+
67
97
  ### 测试超时 (function timed out)
68
98
 
69
99
  **原因**: 元素定位失败或等待时间不足
@@ -9,50 +9,40 @@ import { CustomWorld } from '../../support/world';
9
9
 
10
10
  // Home Page Steps
11
11
  Then('I should see the featured assistants section', async function (this: CustomWorld) {
12
- await this.page.waitForLoadState('networkidle', { timeout: 10_000 });
13
-
14
12
  // Look for "Featured Agents" heading text (i18n key: home.featuredAssistants)
15
13
  // Supports: en-US "Featured Agents", zh-CN "推荐助理"
16
14
  const featuredSection = this.page
17
15
  .getByRole('heading', { name: /featured agents|推荐助理/i })
18
16
  .first();
19
- await expect(featuredSection).toBeVisible({ timeout: 10_000 });
17
+ await expect(featuredSection).toBeVisible({ timeout: 30_000 });
20
18
  });
21
19
 
22
20
  Then('I should see the featured MCP tools section', async function (this: CustomWorld) {
23
- await this.page.waitForLoadState('networkidle', { timeout: 10_000 });
24
-
25
21
  // Look for "Featured Skills" heading text (i18n key: home.featuredTools)
26
22
  // Supports: en-US "Featured Skills", zh-CN "推荐技能"
27
23
  const mcpSection = this.page.getByRole('heading', { name: /featured skills|推荐技能/i }).first();
28
- await expect(mcpSection).toBeVisible({ timeout: 10_000 });
24
+ await expect(mcpSection).toBeVisible({ timeout: 30_000 });
29
25
  });
30
26
 
31
27
  // Assistant List Page Steps
32
28
  Then('I should see the search bar', async function (this: CustomWorld) {
33
- await this.page.waitForLoadState('networkidle', { timeout: 10_000 });
34
-
35
29
  // SearchBar component has data-testid="search-bar"
36
30
  const searchBar = this.page.locator('[data-testid="search-bar"]').first();
37
- await expect(searchBar).toBeVisible({ timeout: 10_000 });
31
+ await expect(searchBar).toBeVisible({ timeout: 30_000 });
38
32
  });
39
33
 
40
34
  Then('I should see the category menu', async function (this: CustomWorld) {
41
- await this.page.waitForLoadState('networkidle', { timeout: 10_000 });
42
-
43
35
  // CategoryMenu component has data-testid="category-menu"
44
36
  const categoryMenu = this.page.locator('[data-testid="category-menu"]').first();
45
- await expect(categoryMenu).toBeVisible({ timeout: 10_000 });
37
+ await expect(categoryMenu).toBeVisible({ timeout: 30_000 });
46
38
  });
47
39
 
48
40
  Then('I should see assistant cards', async function (this: CustomWorld) {
49
- await this.page.waitForLoadState('networkidle', { timeout: 10_000 });
50
-
51
41
  // Look for assistant items by data-testid
52
42
  const assistantItems = this.page.locator('[data-testid="assistant-item"]');
53
43
 
54
44
  // Wait for at least one item to be visible
55
- await expect(assistantItems.first()).toBeVisible({ timeout: 10_000 });
45
+ await expect(assistantItems.first()).toBeVisible({ timeout: 30_000 });
56
46
 
57
47
  // Check we have multiple items
58
48
  const count = await assistantItems.count();
@@ -60,22 +50,18 @@ Then('I should see assistant cards', async function (this: CustomWorld) {
60
50
  });
61
51
 
62
52
  Then('I should see pagination controls', async function (this: CustomWorld) {
63
- await this.page.waitForLoadState('networkidle', { timeout: 10_000 });
64
-
65
53
  // Pagination component has data-testid="pagination"
66
54
  const pagination = this.page.locator('[data-testid="pagination"]').first();
67
- await expect(pagination).toBeVisible({ timeout: 10_000 });
55
+ await expect(pagination).toBeVisible({ timeout: 30_000 });
68
56
  });
69
57
 
70
58
  // Model List Page Steps
71
59
  Then('I should see model cards', async function (this: CustomWorld) {
72
- await this.page.waitForLoadState('networkidle', { timeout: 10_000 });
73
-
74
60
  // Model items have data-testid="model-item"
75
61
  const modelItems = this.page.locator('[data-testid="model-item"]');
76
62
 
77
63
  // Wait for at least one item to be visible
78
- await expect(modelItems.first()).toBeVisible({ timeout: 10_000 });
64
+ await expect(modelItems.first()).toBeVisible({ timeout: 30_000 });
79
65
 
80
66
  // Check we have multiple items
81
67
  const count = await modelItems.count();
@@ -83,22 +69,18 @@ Then('I should see model cards', async function (this: CustomWorld) {
83
69
  });
84
70
 
85
71
  Then('I should see the sort dropdown', async function (this: CustomWorld) {
86
- await this.page.waitForLoadState('networkidle', { timeout: 10_000 });
87
-
88
72
  // SortButton has data-testid="sort-dropdown"
89
73
  const sortDropdown = this.page.locator('[data-testid="sort-dropdown"]').first();
90
- await expect(sortDropdown).toBeVisible({ timeout: 10_000 });
74
+ await expect(sortDropdown).toBeVisible({ timeout: 30_000 });
91
75
  });
92
76
 
93
77
  // Provider List Page Steps
94
78
  Then('I should see provider cards', async function (this: CustomWorld) {
95
- await this.page.waitForLoadState('networkidle', { timeout: 10_000 });
96
-
97
79
  // Look for provider items by data-testid
98
80
  const providerItems = this.page.locator('[data-testid="provider-item"]');
99
81
 
100
82
  // Wait for at least one item to be visible
101
- await expect(providerItems.first()).toBeVisible({ timeout: 10_000 });
83
+ await expect(providerItems.first()).toBeVisible({ timeout: 30_000 });
102
84
 
103
85
  // Check we have multiple items
104
86
  const count = await providerItems.count();
@@ -107,13 +89,11 @@ Then('I should see provider cards', async function (this: CustomWorld) {
107
89
 
108
90
  // MCP List Page Steps
109
91
  Then('I should see MCP cards', async function (this: CustomWorld) {
110
- await this.page.waitForLoadState('networkidle', { timeout: 10_000 });
111
-
112
92
  // Look for MCP items by data-testid
113
93
  const mcpItems = this.page.locator('[data-testid="mcp-item"]');
114
94
 
115
95
  // Wait for at least one item to be visible
116
- await expect(mcpItems.first()).toBeVisible({ timeout: 10_000 });
96
+ await expect(mcpItems.first()).toBeVisible({ timeout: 30_000 });
117
97
 
118
98
  // Check we have multiple items
119
99
  const count = await mcpItems.count();
@@ -121,9 +101,7 @@ Then('I should see MCP cards', async function (this: CustomWorld) {
121
101
  });
122
102
 
123
103
  Then('I should see the category filter', async function (this: CustomWorld) {
124
- await this.page.waitForLoadState('networkidle', { timeout: 10_000 });
125
-
126
104
  // CategoryMenu component has data-testid="category-menu" (shared across list pages)
127
105
  const categoryFilter = this.page.locator('[data-testid="category-menu"]').first();
128
- await expect(categoryFilter).toBeVisible({ timeout: 10_000 });
106
+ await expect(categoryFilter).toBeVisible({ timeout: 30_000 });
129
107
  });
@@ -214,7 +214,7 @@
214
214
  "stats.topicsRank.right": "消息数",
215
215
  "stats.topicsRank.title": "话题内容量",
216
216
  "stats.updatedAt": "更新至",
217
- "stats.welcome": "{{name}},这是你与 {{appName}} 一起记录协作的第 <span>{{days}}</span> 天",
217
+ "stats.welcome": "{{username}},这是你与 {{appName}} 一起记录协作的第 <span>{{days}}</span> 天",
218
218
  "stats.words": "累计字数",
219
219
  "tab.apikey": "API Key",
220
220
  "tab.profile": "账号",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/lobehub",
3
- "version": "2.0.0-next.190",
3
+ "version": "2.0.0-next.192",
4
4
  "description": "LobeHub - an open-source,comprehensive AI Agent 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",
@@ -154,7 +154,6 @@
154
154
  "@codesandbox/sandpack-react": "^2.20.0",
155
155
  "@dnd-kit/core": "^6.3.1",
156
156
  "@dnd-kit/utilities": "^3.2.2",
157
- "@electric-sql/pglite": "0.2.17",
158
157
  "@emotion/react": "^11.14.0",
159
158
  "@fal-ai/client": "^1.8.0",
160
159
  "@formkit/auto-animate": "^0.9.0",