mirror of
https://github.com/lobehub/lobe-chat.git
synced 2026-06-14 03:30:19 +00:00
🐛 fix(onboarding): resolve agent route loading stall and branch redirect (#14795)
* 🐛 fix(onboarding): refresh branch config before redirect
* 🐛 fix(onboarding): refresh agent route flag before branch guard
* 🐛 fix(onboarding): simplify agent branch guard
* 🐛 fix(onboarding): eliminate agent route loading stall
- Make AgentModel.getBuiltinAgent idempotent under concurrent callers.
The web-onboarding builtin agent was inserted by both the bootstrap
query and the standalone useInitBuiltinAgent SWR in parallel; the
insert loser hit agents_slug_user_id_unique and SWR sat in its ~5s
error-retry window before the row could be read.
- Prefetch /onboarding/agent and /onboarding/classic chunks while the
shared-prefix steps are visible, so the branch redirect no longer
pays a cold chunk load.
* 🐛 fix(onboarding): skip prefetch under test and complete fixture
- Add `__TEST__` Vite define so renderer code can branch on Vitest runs
(set true in vitest.config.mts, false in sharedRendererDefine).
- Guard the shared-prefix chunk prefetch with `if (__TEST__) return`.
Otherwise the fire-and-forget `import('@/routes/onboarding/agent')`
resolves after the test asserts and tries to load builtin-agents,
which the test's partial `vi.mock('@lobechat/const')` doesn't supply
(`DEFAULT_MODEL` missing), surfacing as 25 unhandled rejections.
- Fix `extract.runtime.test.ts` fixture to include the new required
`agentBenchmarkLoCoMo` field on `MemoryExtractionPrivateConfig`,
added in 20267fc77c.
This commit is contained in:
@@ -35,6 +35,7 @@ export default defineConfig({
|
||||
'__DEV__': process.env.NODE_ENV !== 'production' ? 'true' : 'false',
|
||||
'__ELECTRON__': 'false',
|
||||
'__MOBILE__': 'false',
|
||||
'__TEST__': 'true',
|
||||
},
|
||||
optimizeDeps: {
|
||||
exclude: ['crypto', 'util', 'tty'],
|
||||
|
||||
Reference in New Issue
Block a user