9493 Commits

Author SHA1 Message Date
lobehubbot
59e19310fe 🔖 chore(release): release version v2.1.45 [skip ci] v2.1.45 2026-03-26 05:58:23 +00:00
Arvin Xu
b005a9c73b 👷 build: add agent task system database schema (#13280)
* 🗃️ chore: add agent task system database schema

Add 6 new tables for the Agent Task System:
- tasks: core task with tree structure, heartbeat, scheduling
- task_dependencies: inter-task dependency graph (blocks/relates)
- task_documents: MVP workspace document pinning
- task_topics: topic tracking with handoff (jsonb) and review results
- task_comments: user/agent comments with author tracking (text id: cmt_)
- briefs: unresolved notification system (text id: brf_)

All sub-tables include userId FK for row-level user isolation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* 🗃️ chore: add self-referential FK on tasks.parentTaskId (ON DELETE SET NULL)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* 🐛 fix: use foreignKey() for self-referential parentTaskId to avoid TS circular inference

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* 🗃️ chore: add FK on task_topics.topic_id → topics.id (ON DELETE SET NULL)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* 🐛 fix: resolve pre-existing TS type-check errors

- Fix i18next defaultValue type (string | null → string)
- Fix i18next options type mismatches
- Fix fieldTags.webhook possibly undefined

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* 🗃️ chore: add FK on tasks.currentTopicId → topics.id (ON DELETE SET NULL)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* 🗃️ chore: add FK constraints for assignee, author, topic, and parent fields

- tasks.assigneeUserId → users.id (ON DELETE SET NULL)
- tasks.assigneeAgentId → agents.id (ON DELETE SET NULL)
- tasks.parentTaskId → tasks.id (ON DELETE SET NULL)
- tasks.currentTopicId → topics.id (ON DELETE SET NULL)
- task_comments.authorUserId → users.id (ON DELETE SET NULL)
- task_comments.authorAgentId → agents.id (ON DELETE SET NULL)
- task_topics.topicId → topics.id (ON DELETE SET NULL)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* 🗃️ chore: change task_topics.topicId FK to ON DELETE CASCADE

Topic deleted → task_topic mapping row removed (not just nulled).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* ♻️ refactor: use inline .references() for currentTopicId FK

No circular inference issue — only parentTaskId (self-ref) needs foreignKey().

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* 🗃️ chore: add FK on task_comments.briefId and topicId (ON DELETE SET NULL)

- task_comments.briefId → briefs.id (SET NULL)
- task_comments.topicId → topics.id (SET NULL)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* ♻️ refactor: merge briefs table into task.ts to fix circular dependency

brief.ts imported task.ts (briefs.taskId FK) and task.ts imported
brief.ts (taskComments.briefId FK), causing circular dependency error.
Merged briefs into task.ts since briefs are part of the task system.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* 🗃️ chore: add FK on tasks.createdByAgentId → agents.id (ON DELETE SET NULL)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 13:56:01 +08:00
lobehubbot
b53abaa3b2 🔖 chore(release): release version v2.1.44 [skip ci] v2.1.44 2026-03-20 10:39:27 +00:00
YuTengjing
0edc57319e 🚀 release: 20260320 (#13155)
fix (#13110).
Fixed empty editor state structure and wide screen layout (#13131).
Fixed missing `BusinessAuthProvider` slot in auth layout (#13130).
Fixed artifacts code scroll preservation while streaming (#13114).
Fixed SSRF block error distinction from network errors (#13103).
Fixed Responses API tool pairing and context limit errors (#13078).
Fixed missing `userId` in embeddings API calls (#13077) and
Fixed unsupported xAI reasoning penalties pruning (#13066).
Fixed market OIDC lost call tools error (#13025).
Fixed `jsonb ?` operator usage to avoid Neon `rt_fetch` bug (#13040).
Fixed model provider popup problems (#13012).
Fixed agent-level memory config priority over user settings (#13018).
Fixed multi-provider model item selection (#12968).
Fixed agent stream error in local dev (#13054).
Fixed skill crash (#13011).
Fixed desktop agent-browser upgrade to v0.20.1 (#12985).
Fixed topic share modal inside router (#12951).
Fixed Enter key submission during IME composition (#12963).
Fixed error collapse default active key (#12967).
2026-03-20 18:37:09 +08:00
YuTengjing
abd152b805 🐛 fix: misc UI/UX improvements and bug fixes (#13153) 2026-03-20 16:42:16 +08:00
LobeHub Bot
c0834fb59d test: add unit tests for rbac utils (#13150)
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-20 16:33:41 +08:00
CanisMinor
2067cb2300 💄 style: add image/video switch (#13152)
* style: add image/video switch

* style: update i18n
2026-03-20 15:55:53 +08:00
Innei
cada9a06fc 🔧 chore(vercel): add SPA asset cache headers and no-store for dev proxy (#13151)
Made-with: Cursor
v2.2.0-nightly.202603200623
2026-03-20 14:45:19 +08:00
Innei
cd75228933 👷 build(ci): add dedicated docker canary tag (#13148) 2026-03-20 14:38:58 +08:00
CanisMinor
57469f860e 💄 style: redesign image / video (#13126)
* ♻️ refactor: Refactor image and video

* chore: rabase canary

* style: update

* style: update

* style: update

* style: update

* style: update

* style: update

* style: update

* chore: update i18n

* style: update

* fix: fix config

* fix: fix proxy

* fix: fix type

* chore: fix test
2026-03-20 14:10:01 +08:00
Arvin Xu
d3ea4a4894 ♻️ refactor: refactor agent-runtime hooks mode (#13145)
*  feat: add Agent Runtime Hooks — external lifecycle hook system

Hooks are registered once and automatically adapt to runtime mode:
- Local: handler functions called directly (in-process)
- Production: webhook configs persisted to Redis, delivered via HTTP/QStash

- HookDispatcher: register, dispatch, serialize hooks per operationId
- AgentHook type: id, type (beforeStep/afterStep/onComplete/onError),
  handler function, optional webhook config
- Integrated into AgentRuntimeService.createOperation + executeStep
- Hooks persisted in AgentState.metadata._hooks for cross-request survival
- Dispatched at both normal completion and error paths
- Non-fatal: hook errors never affect main execution flow

LOBE-6208

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

*  test: add HookDispatcher unit tests (19 tests)

Tests cover:
- register/unregister/hasHooks
- Local mode dispatch: matching types, multiple handlers, error isolation
- Production mode dispatch: webhook delivery, body merging, mode isolation
- Serialization: getSerializedHooks filters webhook-only hooks
- All hook types: beforeStep, afterStep, onComplete, onError

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

*  feat: migrate SubAgent to hooks + add afterStep dispatch + finalState

- AgentHookEvent: added finalState field (local-mode only, stripped from webhooks)
- AgentRuntimeService: dispatch afterStep hooks alongside legacy callbacks
- AiAgentService: createThreadHooks() replaces createThreadMetadataCallbacks()
  for SubAgent Thread execution — same behavior, using hooks API
- HookDispatcher: strip finalState from webhook payloads (too large)

LOBE-6208

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* 🐛 fix: add Vercel bypass header to QStash hook webhooks

Preserves x-vercel-protection-bypass header when delivering hook
webhooks via QStash, matching existing behavior in
AgentRuntimeService.deliverWebhook and libs/qstash.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

*  feat: migrate Eval Run to hooks + add finalState to AgentHookEvent

Eval Run now uses hooks API instead of raw completionWebhook:
- executeTrajectory: hook with local handler + webhook fallback
- executeThreadTrajectory: hook with local handler + webhook fallback
- Local mode now works for eval runs (previously production-only)

Also:
- AgentHookEvent: added finalState field (local-only, stripped from webhooks)
  for consumers that need deep state access

LOBE-6208

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* 🐛 fix: dispatch beforeStep hooks + fix completion event payload fields

P1: Add hookDispatcher.dispatch('beforeStep') alongside legacy
onBeforeStep callback. All 4 hook types now dispatch correctly:
beforeStep, afterStep, onComplete, onError.

P2: Fix completion event payload to use actual AgentState fields
(state.cost.total, state.usage.llm.*, state.messages) instead of
non-existent state.session.* properties. Matches the field access
pattern in triggerCompletionWebhook.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* 🐛 fix: update eval test assertions for hooks migration + fix status type

- Test: update executeTrajectory assertion to expect hooks array
  instead of completionWebhook object
- Fix: add fallback for event.status (string | undefined) when passing
  to recordTrajectoryCompletion/recordThreadCompletion (status: string)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* 🐛 fix: update SubAgent test assertions for hooks migration

Update execGroupSubAgentTask tests to expect hooks array instead of
stepCallbacks object, matching the SubAgent → hooks migration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 12:05:25 +08:00
Rylan Cai
6ce9d9a814 🐛 fix: agent stream error in local dev (#13054)
* 🐛 fix: close local agent streams on terminal errors

* ♻️ refactor: revert redundant cli stream error handling

* 🧪 test: remove redundant cli stream error test

* wip: prune tests

* 🐛 fix: guard terminal agent runtime end step index
2026-03-20 11:39:54 +08:00
Neko
f51da14f07 🔧 chore(locales): use "created" for "sent" in "sent x messages" (#13140) 2026-03-20 11:08:13 +08:00
Protocol Zero
bc8debe836 🐛 fix(chat): strip forkedFromIdentifier before LLM API request (#13142)
fix(chat): strip forkedFromIdentifier before LLM API request

Fork & Chat stores forkedFromIdentifier in agent.params for DB lookup.
Spreading params into the chat payload forwarded it to Responses API,
causing strict providers (e.g. AiHubMix) to reject the request.

Remove the field in getChatCompletion alongside existing non-API keys.

Fixes lobehub/lobehub#13071

Made-with: Cursor
2026-03-20 11:07:29 +08:00
Neko
1b909a74d7 🔧 chore(locales): missing category locale for productivity (#13141) 2026-03-20 03:46:23 +08:00
Arvin Xu
04f963d1da ♻️ refactor: use incremental diff for snapshot messages to prevent OOM (#13136)
* ♻️ refactor: use incremental diff for snapshot messages to prevent OOM

Replace full messages/messagesAfter duplication per step with baseline + delta approach:
- Step 0 and compression resets store full messagesBaseline
- Other steps store only messagesDelta (new messages added)
- Strip llm_stream events from snapshot (not useful for post-analysis)
- Strip messages from done.finalState (reconstructible from delta chain)
- Strip duplicate toolResults from context.payload
- Reduce context_engine_result event size by removing messages and toolsConfig
- Add reconstructMessages() utility for rebuilding full state from delta chain
- AiAgentService constructor now accepts runtimeOptions for DI

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* ♻️ refactor: add incremental toolset delta for snapshot

- Store operationToolSet as toolsetBaseline in step 0 only (immutable)
- Track activatedStepTools changes via per-step activatedStepToolsDelta
- Strip operationToolSet/toolManifestMap/tools/toolSourceMap from done.finalState
- Add reconstructToolsetBaseline() and reconstructActivatedStepTools() utilities

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* 🐛 fix: correct snapshot delta recording and restore context-engine output

- P1: messagesDelta now always stores only appended messages (afterMessages.slice),
  fixing duplication when isBaseline was true (step 0 / compression reset)
- P2: Restore context_engine_result.output (processedMessages) — needed by
  inspect CLI for --env, --system-role, and -m commands
- Add P1 regression test for message deduplication

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 01:01:35 +08:00
YuTengjing
d6f75f3282 feat(model-runtime): add xiaomimimo to RouterRuntime base runtime map (#13137) 2026-03-20 01:01:06 +08:00
YuTengjing
563f4a25f1 💄 style: add XiaomiMiMo LobeHub-hosted model cards and fix pricing (#13133) 2026-03-19 23:51:23 +08:00
Zhijie He
e2d25be729 💄 style: add mimo-v2-pro & mimo-v2-omni support (#13123) 2026-03-19 22:14:20 +08:00
Innei
80cb6c9d11 feat(chat-input): add category-based mention menu (#13109)
*  feat(chat-input): add category-based mention menu with keyboard navigation

Replace flat mention list with a structured category menu (Agents, Members, Topics).
Supports home/category/search views, Fuse.js fuzzy search, floating-ui positioning,
and full keyboard navigation.

* 🔧 chore: update @lobehub/editor to version 4.3.0 and refactor type definition in useMentionCategories

Signed-off-by: Innei <tukon479@gmail.com>

*  feat(MentionMenu): enhance icon rendering logic in MenuItem component

Updated the MenuItem component to improve how icons are rendered. Now, it checks if the icon is a valid React element or a function, ensuring better flexibility in icon usage. This change enhances the overall user experience in the mention menu.

Signed-off-by: Innei <tukon479@gmail.com>

* 🔧 chore: update @lobehub/editor to version 4.3.1 in package.json

Signed-off-by: Innei <tukon479@gmail.com>

---------

Signed-off-by: Innei <tukon479@gmail.com>
2026-03-19 21:48:10 +08:00
YuTengjing
57ec43cd00 🐛 fix(database): add drizzle-zod and zod as peer dependencies to fix type-check errors (#13132) 2026-03-19 21:24:41 +08:00
Innei
0f67a5b8d7 💄 style(desktop): improve WelcomeStep layout centering in onboarding (#13125)
* 💄 style(desktop): improve WelcomeStep layout centering in onboarding

Made-with: Cursor

* 🐛 fix(desktop): validate remote server URL in isRemoteServerConfigured

Made-with: Cursor
2026-03-19 21:18:41 +08:00
Innei
8d387a98a0 🐛 fix(editor): correct empty editor state structure and wide screen layout (#13131)
- Fix EMPTY_EDITOR_STATE with proper Lexical node structure (root id, paragraph id)
- Add flex-grow to WideScreenContainer for proper editor canvas expansion

Made-with: Cursor
2026-03-19 21:07:18 +08:00
YuTengjing
3931aa9f76 🐛 fix(auth): add BusinessAuthProvider slot to auth layout (#13130) 2026-03-19 18:56:45 +08:00
YuTengjing
73d46bb4c4 feat(ci): add Claude PR auto-assign reviewer workflow (#13120) 2026-03-19 16:13:01 +08:00
Innei
f827b870c3 feat(version): display actual desktop app version with canary suffix (#13110)
*  feat(version): display actual desktop app version with canary suffix

Add support for fetching and displaying the desktop application's actual version number in the About section. When running on desktop, the version now displays the desktop app's version (including canary suffix if applicable), falling back to the web version if unavailable.

- Add getAppVersion IPC method in SystemController
- Create versionDisplay utility module with comprehensive tests
- Integrate desktop version fetching in Version component

* ♻️ refactor(desktop): inject about version at build time
v2.2.0-nightly.202603190626
2026-03-19 14:24:03 +08:00
Neko
efd99850df feat(agentDocuments): added agent documents impl, and tools (#13093) 2026-03-19 14:05:02 +08:00
Neko
87c770cda7 🔨 chore: use percentage value for Codecov (#13121)
build: use percentage value
2026-03-19 13:28:48 +08:00
YuTengjing
715481c471 🐛 fix(portal): preserve artifacts code scroll while streaming (#13114) v0.0.0-nightly.pr13110.6936 2026-03-19 00:35:20 +08:00
YuTengjing
25e1a64c1b 💄 style: update Grok 4.20 to 0309 and add MiniMax M2.7 models (#13112) 2026-03-19 00:05:07 +08:00
Innei
465c9699e7 feat(context-engine): inject referenced topic context into last user message (#13104)
*  feat: inject referenced topic context into last user message

When users @refer_topic in chat, inject the referenced topic's summary
or recent messages directly into the context, reducing unnecessary tool calls.

* 🐛 fix: include agentId and groupId in message retrieval for context engineering

Signed-off-by: Innei <tukon479@gmail.com>

*  feat: skip topic reference resolution for messages with existing topic_reference_context

Added logic to prevent double injection of topic references when messages already contain the topic_reference_context. Updated tests to verify the behavior for both cases: when topic references should be resolved and when they should be skipped.

Signed-off-by: Innei <tukon479@gmail.com>

---------

Signed-off-by: Innei <tukon479@gmail.com>
2026-03-18 21:58:41 +08:00
Innei
ac29897d72 ♻️ refactor(perf): user message renderer (#13108)
refactor(perf): user message renderer
2026-03-18 21:58:29 +08:00
YuTengjing
1df5ae32f1 🐛 fix: distinguish SSRF block errors from network errors (#13103) 2026-03-18 18:16:19 +08:00
Innei
8a90f79c11 ♻️ refactor(nav): remove devOnly mode from nav layout and stabilize Footer (#13101)
* ♻️ refactor(nav): remove devOnly mode from nav layout and stabilize Footer during panel transitions

- Remove devOnly filtering from useNavLayout, treat all items as non-dev mode
- Move Pages to top nav position, remove video/image/settings/memory nav items
- Extract Footer from SideBarLayout into NavPanelDraggable outside animation layer
- Show settings ActionIcon in Footer when dev mode is enabled (hidden on settings page)

* 🔧 fix(footer): update settings icon in Footer component

- Replace Settings2 icon with Settings icon in the Footer when dev mode is enabled, ensuring consistency in the user interface.

Signed-off-by: Innei <tukon479@gmail.com>

---------

Signed-off-by: Innei <tukon479@gmail.com>
2026-03-18 15:44:51 +08:00
LobeHub Bot
91ec7b412b 🌐 chore: translate non-English comments to English in ProfileEditor and related features (#13048)
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 15:40:07 +08:00
YuTengjing
e9766be3f3 🐛 fix: pass userId in initModelRuntimeFromDB (#13100) 2026-03-18 15:11:29 +08:00
Rylan Cai
52652866e0 feat: support server context compression (#12976)
* ♻️ refactor: add eval-only server context compression

* ♻️ refactor: align eval compression with runtime step flow

* ♻️ refactor: trim redundant call_llm diff

*  add mid-run context compression step

* 📝 document post compression helper

* 🐛 revert unnecessary agent runtime service diff

* ♻️ refactor: clean up context compression follow-up logic

* ♻️ refactor: move compression gate before call llm

* ♻️ refactor: make call llm compression gate explicit

* ♻️ refactor: restore agent-side compression checks

* ♻️ refactor: rename agent llm continuation helper

* ♻️ refactor: inline agent compression helper

* ♻️ refactor: preserve trailing user message during compression

* 📝 docs: clarify toLLMCall refactor direction

*  test: add coverage for context compression flow

*  reset: unstash
2026-03-18 12:48:34 +08:00
YuTengjing
95ef230354 💄 style: add GPT-5.4 mini and nano models (#13094) 2026-03-18 12:34:31 +08:00
lobehubbot
b894622dfe Merge remote-tracking branch 'origin/main' into canary 2026-03-18 04:29:39 +00:00
Arvin Xu
ae77fee1b8 👷 build: add settings column to agent_bot_providers (#13081) 2026-03-18 12:28:58 +08:00
YuTengjing
7cd4b1942f 💄 style: use credit terminology in auto top-up tooltips (#13091) 2026-03-18 11:12:39 +08:00
Rylan Cai
69c24c714e 🔧 chore(eval): improve trajectory workflow controls and execution metadata (#13049)
* 🔧 chore(search): reduce Exa default result count

* 🐛 fix(eval): relax run input schema limits

*  feat(agent): persist tool execution time in message metadata

* 🔧 chore(eval): add flow control to trajectory workflows

* 🧪 test: adjust Exa numResults expectation
2026-03-18 10:29:49 +08:00
Sirui He
3a789dc612 🐛 fix: SPA HTML entry returns stale content after server upgrade (#12998)
fix: add no-cache header to SPA HTML entry point

Prevent stale SPA HTML from being served after server upgrades.
JS/CSS assets still cache normally via hashed filenames.
2026-03-18 01:27:52 +08:00
Xial
46455cb6c3 🐛 fix: load PDF.js worker from local assets via Vite ?url import (#13006) 2026-03-18 01:26:10 +08:00
YuTengjing
81becc3583 🐛 fix(model-runtime): handle Responses API tool pairing and context limit errors (#13078) 2026-03-18 00:07:10 +08:00
YuTengjing
cb0037ce1e 🐛 fix: pass userId to all embeddings API calls (#13077) 2026-03-17 23:44:34 +08:00
Innei
03f3a2438c 🐛 fix(skills): repair db-migrations frontmatter (#13073) 2026-03-17 23:32:14 +08:00
Innei
4994d19a9c 🐛 fix(desktop): remove electron-liquid-glass to fix click event blocking (#13070)
* 🐛 fix(desktop): remove electron-liquid-glass to fix click event blocking

The electron-liquid-glass native addon was blocking all click events in the
Electron desktop app window. Remove the dependency and restore vibrancy-based
transparency with semi-transparent body background via `.desktop` CSS class.

* 🔨 chore(desktop): remove electron-liquid-glass from native modules config
2026-03-17 22:56:29 +08:00
YuTengjing
f8d51bbf4f 🐛 fix(model-runtime): filter internal thinking content in openai-compatible payloads (#13067) 2026-03-17 22:28:08 +08:00
YuTengjing
189e5d5a20 🐛 fix(model-runtime): prune unsupported xAI reasoning penalties (#13066) 2026-03-17 22:27:59 +08:00