30 Commits

Author SHA1 Message Date
YuTengjing
73d46bb4c4 feat(ci): add Claude PR auto-assign reviewer workflow (#13120) 2026-03-19 16:13:01 +08:00
Innei
03f3a2438c 🐛 fix(skills): repair db-migrations frontmatter (#13073) 2026-03-17 23:32:14 +08:00
YuTengjing
97f4a370ab feat: add request trigger tracking, embeddings billing hooks, and memory extraction userId fix (#13061) 2026-03-17 20:54:28 +08:00
YuTengjing
3207d14403 🔨 chore: add batch query methods for UserModel and MessageModel (#13060) 2026-03-17 18:20:03 +08:00
Arvin Xu
517a67ced7 🐛 fix: respect agent-level memory config priority over user settings (#13018)
* update skills

* 🐛 fix: respect agent-level memory config priority over user settings

Agent chatConfig.memory.enabled now takes priority. Falls back to user-level
memory setting when agent config is absent.

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

* 🐛 fix: resolve tsgo type error in memory integration test

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-16 15:48:14 +08:00
Arvin Xu
adbf11dc11 📝 docs: update documents (#12982)
update document
2026-03-14 22:06:09 +08:00
Innei
4438b559e6 feat: add slash action tags, topic reference tool, and command bus system (#12860)
*  feat: add slash action tags in chat input

Made-with: Cursor

*  feat: enhance editor with new slash actions and localization updates

- Added new slash actions: change tone, condense, expand, polish, rewrite, summarize, and translate.
- Updated localization files for English and Chinese to include new action tags and slash commands.
- Removed deprecated useSlashItems component and integrated its functionality directly into InputEditor.

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

*  feat: add slash placement configuration to chat input components

- Introduced `slashPlacement` prop to `ChatInputProvider`, `StoreUpdater`, and `InputEditor` for customizable slash menu positioning.
- Updated initial state to include `slashPlacement` with default value 'top'.
- Adjusted `ChatInput` and `InputArea` components to utilize the new `slashPlacement` prop.

This enhancement allows for better control over the user interface in chat input interactions.

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

*  feat: implement command bus for slash action tags processing

Add command bus system to parse and execute slash commands (compact context,
new topic). Refactor action tag categories from ai/prompt to command/skill.
Add useEnabledSkills hook for dynamic skill registration.

* feat: compress command

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

* refactor: compress

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

* fix: skill inject

*  feat: slash action tags with context engine integration

Made-with: Cursor

*  feat: add topic reference builtin tool and server runtime

Made-with: Cursor

*  feat: add topic mention items and update ReferTopic integration

Made-with: Cursor

* 🐛 fix: preserve editorData through assistant-group edit flow and update RichTextMessage reactively

- EditState now forwards editorData from EditorModal to modifyMessageContent
- modifyMessageContent accepts and passes editorData to updateMessageContent
- RichTextMessage uses useEditor + effect to update document on content change instead of key-based remount
- Refactored RichTextMessage plugins to use shared createChatInputRichPlugins()

*  feat(context-engine): add metadata types and update processors/providers

Made-with: Cursor

*  feat(chat-input): add slash action tags and restore failed input state

* 🔧 chore: update package dependencies and enhance Vite configuration

- Changed @lobehub/ui dependency to a specific package URL.
- Added multiple SPA entry points and layout files to the Vite warmup configuration.
- Removed unused monorepo packages from sharedOptimizeDeps and added various dayjs locales for better localization support.

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

* 🔧 chore: update @lobehub/ui dependency to version 5.4.0 in package.json

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

* 🐛 fix: correct SkillsApiName.runSkill to activateSkill and update trimmed content assertions

* 🐛 fix: resolve type errors in context-engine tests and InputEditor slashPlacement

* 🐛 fix: update runSkill to activateSkill in conversationLifecycle test

* 🐛 fix: avoid regex backtracking in placeholder parser

*  feat(localization): add action tags and tooltips for slash commands across multiple languages

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

* 🐛 fix: preserve file attachments when /newTopic has no text content

* cleanup

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

---------

Signed-off-by: Innei <tukon479@gmail.com>
2026-03-13 22:17:36 +08:00
Arvin Xu
b4624e6515 🔨 chore: add Response API support (#12918)
* add response api framework

* finish response api structure

* finish response api structure

*  feat: implement basic text generation for Response API (LOBE-5858)

- Add instructions extraction from system/developer input messages
- Add instructions param to ExecAgentParams, append to agent systemRole
- Implement extractPrompt, extractAssistantContent, extractUsage in ResponsesService
- Wire up execAgent + executeSync flow for non-streaming and streaming
- Add logprobs field to output_text content parts for schema compliance
- Fix truncation field to output string enum instead of object

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

*  feat: implement real token-level streaming for Response API (LOBE-5859)

- Replace fake streaming (executeSync → emit events) with real streaming
- Subscribe to InMemoryStreamEventManager for live stream_chunk events
- Run executeSync in background, convert text chunks to output_text.delta SSE events
- Add missing schema fields: item_id on content_part/text events, logprobs on delta/done events
- Fix content_part.added/done to include item_id per OpenResponses spec

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

*  feat: implement tool calling output extraction for Response API (LOBE-5860)

- Add extractOutputItems to convert AgentState messages to OpenResponses output items
- Extract assistant tool_calls → function_call output items
- Extract tool result messages → function_call_output output items
- Skip message items for assistant messages that have tool_calls (avoid duplicates)
- Add status field to function_call_output items per OpenResponses spec
- Update FunctionCallOutputItemSchema with optional status field
- Output array reflects execution order: function_call → function_call_output → message

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

*  feat: implement multi-turn conversations via previous_response_id (LOBE-5861)

Encode topicId in response.id to enable stateless multi-turn conversation
chaining. When previous_response_id is provided, extract topicId and pass
to execAgent via appContext, which automatically loads history messages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* 🐛 fix: add missing type fields for OpenResponses compliance (logprobs, item_id, input_tokens_details)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 10:39:08 +08:00
YuTengjing
f1dd2fc458 📝 docs: add catch error logging rule to TypeScript skill (#12903) 2026-03-11 12:10:36 +08:00
Arvin Xu
aa8082d6b2 feat: lobehub cli for better agency agent (#12897)
* fix cli alias

* 🐛 fix(cli): fix gen text non-streaming mode and streaming SSE parsing

- Add `responseMode: 'json'` for non-streaming requests to get plain JSON instead of SSE
- Fix streaming SSE parser to handle LobeHub's JSON string format (e.g. `"Hello"`)
- Support both OpenAI and Anthropic response formats in non-streaming mode
- Add E2E tests for all generate commands (text, list, tts, asr, alias)
- Update skills knowledge.md docs with new kb commands

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

*  feat(cli): unify skill install command and add e2e tests

Merge import-github/import-url/import-market into a single `skill install <source>` command with auto-detection (GitHub URL/shorthand, ZIP URL, or marketplace identifier). Add alias `skill i`. Add comprehensive e2e and unit tests for skill commands.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* 🔨 chore: fix linter formatting in memory e2e test

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* 🐛 fix: add vitest-environment node declaration to aiProvider test

Fix server-side env variable access error by declaring node environment.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix cli review

* fix test

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 11:06:52 +08:00
Arvin Xu
860e11ab3a ♻️ refactor(cli): extract shared @lobechat/local-file-shell package (#12865)
* ♻️ refactor(cli): extract shared @lobechat/local-file-shell package

Extract common file and shell operations from Desktop and CLI into a
shared package to eliminate ~1500 lines of duplicated code. CLI now
uses @lobechat/file-loaders for rich format support (PDF, DOCX, etc.).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* update

* update commands

* update version

* update deps

* refactor version issue

*  feat(local-file-shell): add cwd support, move/rename ops, improve logging

- Add missing `cwd` parameter to `runCommand` (align with Desktop)
- Add `moveLocalFiles` with batch support and detailed error handling
- Add `renameLocalFile` with path validation and traversal prevention
- Add error logging in shell runner's error/completion handlers

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* support update model and provider in cli

* fix desktop build

* fix

* 🐛 fix: pin fast-xml-parser to 5.4.2 in bun overrides

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 00:04:22 +08:00
lobehubbot
d54b30750a Merge remote-tracking branch 'origin/main' into canary 2026-03-09 15:05:28 +00:00
Arvin Xu
4e6790e3d7 👷 build: add api key hash column migration (#12862)
*  feat(database): extract openapi database changes

* 📝 docs: update db-migrations and version-release skills

---------

Co-authored-by: MarioJames <mocha.wyh@msn.com>
Co-authored-by: YuTengjing <ytj2713151713@gmail.com>
2026-03-09 23:04:45 +08:00
Arvin Xu
c6de80931e 🐛 fix: fix agent runtime error handle (#12834)
* improve inspect partial ability

* fix error

* fix runtime error
2026-03-09 12:24:13 +08:00
Arvin Xu
4363994945 feat: support use remote device in IM integration (#12798)
* support timezone in system prompt

refactor to improve user prompts

refactor tool engine

refactor tools map mode

add bot callback service

clean

improve cli

update agentic tracing

refactor cli login

refactor cli

add device auth

improve device gateway implement

implement gateway pipeline

support device Gateway connect

support gateway

* revert electron device

* inject builtins agent prompts

* update tracing

* add testing

* refactor the activeDeviceId

* refactor BotCallbackService

* fix test and lint

* fix test and lint

* add tests

* fix tests

* fix lint
2026-03-09 01:17:56 +08:00
Arvin Xu
a1a89b3531 💄 style: improve server agent harness (#12611)
* add device gateway

* improve persona memory

* support auto renaming

* support memory

* fix memory captureAt

* add more db testing

* add more db testing

* add agent tracing tool

* add agent tracing tool

* fix lint

* fix lint

* update skills

* Potential fix for code scanning alert no. 178: Workflow does not contain permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2026-03-03 17:35:18 +08:00
YuTengjing
9ab2f219e4 🌐 locale: add usernameTooLong translations with CJK spacing fix (#12615) 2026-03-03 16:13:18 +08:00
CanisMinor
43578a9bcc 📝 docs: Polishing and improving product documentation (#12612)
* 🔖 chore(release): release version v2.1.34 [skip ci]

* 📝 docs: Polish documents

* 📝 docs: Fix typo

* 📝 docs: Update start

* 📝 docs: Fix style

* 📝 docs: Update start

* 📝 docs: Update layout

* 📝 docs: Fix typo

* 📝 docs: Fix typo

---------

Co-authored-by: lobehubbot <i@lobehub.com>
2026-03-03 16:01:41 +08:00
YuTengjing
6ecba929b7 🔨 chore: remove dead eslint disable comments for deleted rules (#12597) 2026-03-02 23:18:01 +08:00
Arvin Xu
d68acec58e feat: support Discord IM bot intergration (#12517)
* clean

fix tools calling results

improve display

support discord bot

finish bot integration

* improve next config

* support queue callback mode

* support queue callback mode

* improve error

* fix build

* support serverless gateway

* support serverless gateway

* support serverless enable

* improve ui

* improve ui

* add credentials config

* improve and refactor data working

* update config

* fix integration

* fix types

* fix types

* fix types

* fix types

* move files

* fix update

* fix update

* fix update
2026-03-01 19:54:38 +08:00
Innei
794fe5f60b ♻️ refactor: restructure SPA routes to src/routes and src/router (#12542)
* 📝 docs: add SPA routes restructure design and implementation plan

* ♻️ refactor: restructure SPA routes to src/routes and src/router

- Move SPA page components from src/app/[variants] to src/routes/
  - (main) -> Desktop pages
  - (mobile) -> Mobile pages
  - (desktop) -> Desktop-specific pages
  - onboarding -> Onboarding pages
  - share -> Share pages
- Move router configurations from src/app/[variants]/router to src/router/
  - desktopRouter.config.tsx
  - desktopRouter.config.desktop.tsx
  - mobileRouter.config.tsx
- Keep auth pages in src/app/[variants]/(auth) for SSR
- Update all import paths:
  - @/app/[variants]/ -> @/routes/
  - Relative paths adjusted for new directory structure
- Update CLAUDE.md and project-overview skill documentation

* 🔧 chore: restore imports for RouteConfig and ErrorBoundary in desktopRouter.config.desktop.tsx

- Reintroduced the imports for RouteConfig, ErrorBoundary, and redirectElement in the desktop router configuration file.
- Ensured proper organization and functionality of the desktop routing setup.

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

* 🐛 fix: update import paths after routes restructure

- Fix imports from old `src/app/[variants]/` to new `src/routes/` paths
- Update Title, Sidebar, MakedownRender, McpList imports
- Fix desktop-onboarding/storage import path
- Run lint --fix to sort imports

* 📝 docs: SPA routes convention and spa-routes skill

- Add roots vs features rules to CLAUDE.md and AGENTS.md
- Add .agents/skills/spa-routes for route/feature file division
- Phase 1: move page route logic to src/features/Pages, thin route files

Made-with: Cursor

* 🌐 chore: translate non-English comments to English in memory module (#12547)

Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

* ♻️ refactor: move router and entries to src/spa, platform-based warmup

- Move src/router and entry.*.tsx to src/spa/
- Update HTML, vite.config, and entry imports
- Warmup only the entry matching current platform (web/mobile)
- Update CLAUDE.md, AGENTS.md, and spa-routes skill

Made-with: Cursor

* 🗂️ chore: restructure SPA routes and configurations

- Deleted outdated SPA routes and implementation plan documents.
- Migrated SPA page components to new `src/routes/` directory.
- Moved route configurations to `src/router/`.
- Updated import paths across the project to reflect new structure.
- Revised AI documentation to align with the updated directory layout.

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

---------

Signed-off-by: Innei <tukon479@gmail.com>
Co-authored-by: LobeHub Bot <i@lobehub.com>
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-01 18:35:38 +08:00
YuTengjing
306c50704e 🐛 fix: improve crawler error handling and timeout cancellation (#12487) 2026-02-26 22:59:10 +08:00
Arvin Xu
93bb83db5d 🔨 chore: improve version sync (#12422)
* update workflow

* update skills

* update skills
2026-02-22 01:09:23 +08:00
Arvin Xu
e7598fe90b feat: support agent benchmark (#12355)
* improve total

fix page size issue

fix error message handler

fix eval home page

try to fix batch run agent step issue

fix run list

fix dataset loading

fix abort issue

improve jump and table column

fix error streaming

try to fix error output in vercel

refactor qstash workflow client

improve passK

add evals to proxy

refactor metrics

try to fix build

refactor tests

improve detail page

fix passK issue

improve eval-rubric

fix types

support passK

fix type

update

fix db insert issue

improve dataset ui

improve run config

finish step limit now

add step limited

100% coverage to models

add failed tests todo

support interruptOperation

fix lint

improve report detail

improve pass rate

improve sort order issue

fix timeout issue

Update db schema

完整 case 跑通

update database

improve error handling

refactor to improve database

优化 test case 的处理流程

优化部分细节体验和实现

基本完成 Benchmark 全流程功能

优化 run case 展示

优化 run case 序号问题

优化 eval test case 页面

新增 eval test 模式

新增 dataset 页面

update schema

support

finish create test run

fix

update

improve import exp

refactor data flow

improve import workflow

rubric Benchmark detail 页面

improve import ux

update schema

finish eval home page

add eval workflow endpoint

implement benchmark run model

refactor RAG eval

implement backend

update db schema

update db migration

init benchmark

* support rerun error test case

* fix tests

* fix tests
2026-02-21 20:36:40 +08:00
YuTengjing
abe4c969a5 feat: add video generation feature 2026-02-14 20:16:25 +08:00
Innei
fcdaf9d814 🔧 chore: update eslint v2 configuration and suppressions (#12133)
* v2 init

* chore: update eslint suppressions and package dependencies

- Removed several eslint suppressions related to array sorting and reversing from eslint-suppressions.json to clean up the configuration.
- Updated @lobehub/lint package version from 2.0.0-beta.6 to 2.0.0-beta.7 in package.json for improvements and bug fixes.
- Made minor formatting adjustments in vitest.config.mts and various SKILL.md files for better readability and consistency.

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

* fix: clean up import statements and formatting

- Removed unnecessary whitespace in replaceComponentImports.ts for improved readability.
- Standardized import statements in contextEngineering.ts and createAgentExecutors.ts by adding missing spaces for consistency.

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

* chore: update eslint suppressions and clean up code formatting

* 🐛 fix: use vi.hoisted for mock variable initialization

Fix TDZ error in persona service test by using vi.hoisted() to ensure
mock variables are available when vi.mock factory runs.

---------

Signed-off-by: Innei <tukon479@gmail.com>
2026-02-11 13:04:48 +08:00
Innei
046eb72961 ♻️ refactor(store): migrate to class-based actions with flattenActions (#12081)
*  feat(store): introduce StoreSetter interface and refactor agent group actions

- Added StoreSetter interface to manage state updates in a more flexible manner.
- Refactored ChatGroupInternalAction, ChatGroupCurdAction, and ChatGroupMemberAction to utilize the new StoreSetter for state management.
- Enhanced action methods to improve clarity and maintainability.
- Introduced createActionProxy utility to streamline action handling across slices.
- Updated lifecycle and member slices to align with the new structure, ensuring consistent state management practices.

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

* refactor squash

refactor: replace createActionProxy with flattenActions for action handling

- Updated multiple store files to utilize flattenActions instead of createActionProxy, improving the handling of action methods and ensuring proper prototype method binding.
- Removed createActionProxy utility as it is no longer needed, streamlining the action management process across the application.

This change enhances maintainability and consistency in state management practices.

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

chore: format code

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

fix: correct assignment syntax in GroupChatSupervisor and ResourceSyncEngine

- Updated assignment syntax from object-like notation to standard assignment for error handling and state updates in GroupChatSupervisor and ResourceSyncEngine classes.
- Ensured proper variable assignments for error handling and state management, enhancing code clarity and functionality.

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

fix: update transformApiArgumentsToAiState return type and logic

- Changed the return type of transformApiArgumentsToAiState from Promise<string> to Promise<string | undefined> to better reflect possible outcomes.
- Modified the return statement to return undefined instead of an empty string when the builtinToolLoading for the given key is true, improving clarity in the function's behavior.

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

* feat(upload): enhance uploadBase64FileWithProgress return type and add dimensions

- Introduced a new interface, UploadWithProgressResult, to define the structure of the result returned by uploadBase64FileWithProgress.
- Updated the return type of uploadBase64FileWithProgress and uploadFileWithProgress methods to reflect the new interface, improving type safety and clarity.
- This change allows for better handling of image dimensions and file metadata during the upload process.

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

* refactor(zustand): migrate to class-based actions and enhance action composition

- Updated the implementation of actions from plain StateCreator objects to class-based actions, improving encapsulation and maintainability.
- Introduced a new pattern for defining actions using private fields to prevent internal state leakage.
- Replaced createActionProxy with flattenActions for better method binding and prototype support in action handling.
- Enhanced the structure for multi-class slices, allowing for cleaner composition of actions within store files.

This refactor streamlines state management practices and improves code clarity across the application.

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

---------

Signed-off-by: Innei <tukon479@gmail.com>
2026-02-11 12:58:46 +08:00
Innei
4db39075a9 feat(electron): refactor RecentlyViewed with Pinned + Recent architecture (#11774)
*  feat(electron): refactor RecentlyViewed with Pinned + Recent architecture

- Add Pinned section for user-pinned pages (persisted to localStorage)
- Add Recent section with auto-deduplication and 20 items limit
- Support dynamic title updates (e.g., conversation names instead of generic "Chat")
- Add Pin/Unpin toggle on hover
- Keep navigation history (back/forward) independent from recent pages

Closes LOBE-4212
Closes LOBE-4230

* 📝 docs(linear): update issue management guidelines

- Revise description for clarity on triggering conditions for Linear issues.
- Add critical section on PR creation with Linear issues, emphasizing immediate comment requirements.
- Update completion comment format to include structured summary and key changes.
- Clarify workflow steps and correct examples for task completion and status updates.

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

*  feat(electron): history stack

- Introduce a new plugin system for RecentlyViewed, allowing dynamic resolution of page references.
- Implement caching for display data, improving performance and user experience.
- Refactor existing page handling to support various page types (agents, groups, etc.) with dedicated plugins.
- Update Recent and Pinned pages management to utilize the new plugin system for better data integrity and retrieval.

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

---------

Signed-off-by: Innei <tukon479@gmail.com>
2026-02-11 12:58:45 +08:00
Innei
13e0923c30 chore: update Linear skill description for clarity and usage guidelines
Signed-off-by: Innei <tukon479@gmail.com>
2026-02-11 12:58:43 +08:00
Innei
346fc4617e ♻️ refactor: migrate AI Rules to Claude Code Skills (#11737)
♻️ refactor: migrate AI Rules to Claude Code Skills system

Migrate all AI Rules from .cursor/rules/ to .agents/skills/ directory:
- Move 23 skills to .agents/skills/ (main directory)
- Update symlinks: .claude/skills, .cursor/skills, .codex/skills
- Create project-overview skill from project documentation
- Add references/ subdirectories for complex skills
- Remove LobeChat references from skill descriptions
- Delete obsolete .cursor/rules/ and .claude/commands/prompts/ directories

Skills structure enables better portability and maintainability across AI tools.
2026-01-23 22:30:18 +08:00