mirror of
https://github.com/lobehub/lobehub
synced 2026-04-21 09:37:28 +00:00
807 commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
c0db58e622
|
✨ feat(topic): add completed status with dropdown action and filter (#14005)
Some checks are pending
E2E CI / Check Duplicate Run (push) Waiting to run
E2E CI / Test Web App (push) Blocked by required conditions
Release Desktop Canary / Calculate Canary Version (push) Waiting to run
Release Desktop Canary / Code quality check (push) Blocked by required conditions
Release Desktop Canary / Build Desktop App (push) Blocked by required conditions
Release Desktop Canary / Merge macOS Release Files (push) Blocked by required conditions
Release Desktop Canary / Publish Canary Release (push) Blocked by required conditions
Release Desktop Canary / Publish to S3 (push) Blocked by required conditions
Release Desktop Canary / Cleanup Old Canary Releases (push) Blocked by required conditions
Release ModelBank / Build ModelBank (push) Waiting to run
Release ModelBank / Publish ModelBank (push) Blocked by required conditions
Test CI / Check Duplicate Run (push) Waiting to run
Test CI / Test Packages (push) Blocked by required conditions
Test CI / Test App (shard 1/3) (push) Blocked by required conditions
Test CI / Test App (shard 2/3) (push) Blocked by required conditions
Test CI / Test App (shard 3/3) (push) Blocked by required conditions
Test CI / Merge and Upload App Coverage (push) Blocked by required conditions
Test CI / Test Desktop App (push) Blocked by required conditions
Test CI / Test Database (push) Blocked by required conditions
* ✨ feat(topic): add completed status with dropdown action and filter - Surface ChatTopicStatus (active/completed/archived) on topic list items and pass to dropdown menu - Add markTopicCompleted / unmarkTopicCompleted store actions wired into the topic item dropdown - Show CheckCircle2 icon on completed topics in the sidebar list - Add topicIncludeCompleted user preference (default false) and an "Include Completed" toggle in the topic filter menu (agent + group routes) - Wire excludeStatuses and triggers filters through TopicModel, TRPC router, service, and store SWR keys so completed topics are excluded by default Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 🌐 i18n(topic): add zh-CN/en-US for completed status keys Translate actions.markCompleted / actions.unmarkCompleted and filter.filter / filter.showCompleted for dev preview. CI's pnpm i18n will fill in remaining locales. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ♻️ refactor(topic): scope completed exclusion to routes with the toggle Move the topicIncludeCompleted preference read out of the chat-store useFetchTopics action and into the (main) agent/group sidebars where the "Include Completed" filter actually lives. Popup and mobile topic views call useFetchTopics without excludeStatuses, so completed topics remain reachable on surfaces that don't expose the toggle (e.g. the popup window for a deep-linked completed topic, the mobile TopicModal). Also switch ChatTopicStatus imports in the topic item / dropdown files to @lobechat/types to match the rest of the topic-feature imports. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ✅ test(topic-model): cover excludeStatuses + triggers filters Add cases to the TopicModel.query suite for the new params introduced alongside the topic.status column: - triggers (positive trigger filter) on the container branch - excludeStatuses on the container, agent, and groupId branches (verifies null status rows are still returned) - status / completedAt are populated on returned items Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 💄 style(topic): move "Mark Completed" to top of agent topic dropdown Promote the completed-status toggle to the first menu item, with a divider before favorite, so the most-used status action sits at the top of the dropdown. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
c5db823a69
|
💄 style: add Kimi K2.6 to LobeHub-hosted card (#14006) | ||
|
|
569dcc8765
|
💄 style(thread): sync id allocation + ChatMiniMap polish (#14000)
Some checks are pending
E2E CI / Test Web App (push) Blocked by required conditions
Release Desktop Canary / Calculate Canary Version (push) Waiting to run
Release Desktop Canary / Code quality check (push) Blocked by required conditions
Release Desktop Canary / Build Desktop App (push) Blocked by required conditions
Release Desktop Canary / Merge macOS Release Files (push) Blocked by required conditions
Release Desktop Canary / Publish Canary Release (push) Blocked by required conditions
E2E CI / Check Duplicate Run (push) Waiting to run
Release Desktop Canary / Publish to S3 (push) Blocked by required conditions
Release Desktop Canary / Cleanup Old Canary Releases (push) Blocked by required conditions
Test CI / Check Duplicate Run (push) Waiting to run
Test CI / Test Packages (push) Blocked by required conditions
Test CI / Test App (shard 1/3) (push) Blocked by required conditions
Test CI / Test App (shard 2/3) (push) Blocked by required conditions
Test CI / Test App (shard 3/3) (push) Blocked by required conditions
Test CI / Merge and Upload App Coverage (push) Blocked by required conditions
Test CI / Test Desktop App (push) Blocked by required conditions
Test CI / Test Database (push) Blocked by required conditions
* ✨ feat(heterogeneous-agents): preserve CC subagent lineage in adapter
Claude Code tags subagent events (Agent / Task tool spawns) with
parent_tool_use_id pointing back at the outer tool_use. The adapter
used to flatten these, breaking the main-agent step tracker — each
subagent turn introduces a NEW message.id, which the adapter read as
"new main-agent step" and forced stream_end + stream_start(newStep),
producing orphan assistant bubbles and double-counted usage.
- ToolCallPayload.parentToolCallId carries the pointer to downstream
consumers so they can group subagent inner tools under their parent.
- claudeCode.ts reads raw.parent_tool_use_id and:
* skips main-agent step boundary on subagent message.id changes
* skips model tracking for subagent events (the result event has
the authoritative usage, would double-count otherwise)
* drops subagent text / reasoning in this adapter pass — the
subagent's final answer is delivered via the outer tool_result;
verified against a real CC trace where 76 subagent assistant
events carried only tool_use, zero text / thinking
* stamps parentToolCallId onto subagent tool_use payloads
- 6 new unit tests cover lineage propagation, no newStep for subagent
message.id changes, no turn_metadata emission, text/reasoning drop,
main-agent resuming step boundary, and subagent tool_result
passthrough.
Refs LOBE-7319, LOBE-7260
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* ✨ feat(types): foundation types for CC Task block (LOBE-7392)
Sets up the data shape for rendering CC subagent spawns as inline
`task` blocks inside the parent assistantGroup, replacing the
role:'task' message intermediary that was previously proposed in
PR #13928. Pure data layer — no DB schema migration, no new
columns.
- TaskBlock + AssistantContentBlock.tasks?: derived view that the
MessageTransformer will populate by joining Threads onto the
parent message's tool_use entries (follow-up commit). Carries
threadId, subagentType, description, status — enough for the
folded inline header without re-fetching the thread on every
render pass.
- ThreadMetadata gains sourceToolCallId, subagentType, description.
sourceToolCallId disambiguates parallel subagents that share a
sourceMessageId (one assistant turn can spawn multiple Task
tool_uses in one batch).
- CreateThreadParams.id + zod schema field + thread router
passthrough lets clients allocate the threadId synchronously
before the create mutation resolves. The CC adapter emits
Task tool_use synchronously while the create call is async, so
having the id up-front lets us persist subagent inner messages
with the right threadId without a queue or blocking the stream.
- ClaudeCodeApiName.Task + TaskArgs match the CC tool_use shape
(description, prompt, subagent_type) so executor / renderer can
type the input safely.
Refs LOBE-7392
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* ♻️ refactor: extract subagent assistant handler + drop ThreadMetadata.description
Two review-feedback cleanups on the LOBE-7392 foundation:
1. **Adapter — early-return + shared helper.** The main-agent path no
longer carries `if (!isSubagentEvent)` guards; subagent events short-
circuit into a dedicated `handleSubagentAssistant` that only extracts
`tool_use` blocks, and both paths share a new `emitToolChunk` helper
for the `tools_calling` + `tool_start` emission. Adding a new
subagent suppress-rule (no model / no text / no step) now lives in
one method instead of sprinkling guards across the main handler.
2. **ThreadMetadata — drop `description`, use `Thread.title`.** Thread
already has a `title` column; storing the CC Task `description`
input there is the canonical spot and removes the redundant metadata
field. `TaskBlock.description` is collapsed into `TaskBlock.title`
(single source), and the MessageTransformer will populate it from
`thread.title` at read time. Also adds `status?: ThreadStatus` on
`TaskBlock` so the renderer gets the processing / completed / failed
state without a separate lookup.
Behavior unchanged — all 56 adapter tests still pass.
Refs LOBE-7392, LOBE-7319
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* 🐛 fix(thread-router): translate id-collision into CONFLICT error
ThreadModel.create uses onConflictDoNothing() and returns undefined
when a caller-provided id collides with an existing row. With the
new client-side id passthrough (introduced in
|
||
|
|
a0471d5906
|
✨ feat(chat-input): branch ahead/behind badge + GitCtr refactor (#13980)
* 💄 style(todo-progress): replace green bar with inline progress ring Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 💄 style(chat-input): split branch and diff blocks, add changed-files popover Branch now has its own hover tooltip for the full name; the diff stat is a sibling block that opens a lazy-loaded popover listing changed files. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ✨ feat(chat-input): show ahead/behind commit count vs upstream Adds a badge next to the branch chip showing commits pending push (↑, blue) and pull (↓, red) against the branch's upstream tracking ref. Hidden when no upstream is configured or both counts are zero. Refreshed on focus, after checkout, and on manual refresh from the branch switcher. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ♻️ refactor(desktop): extract git IPC methods into dedicated GitController Moves detectRepoType, getGitBranch, getLinkedPullRequest, listGitBranches, getGitWorkingTree{Status,Files}, getGitAheadBehind, and checkoutGitBranch out of SystemCtr into a new GitCtr (groupName = 'git'). Shared helpers (resolveGitDir / resolveCommonGitDir / detectRepoType) become pure functions under utils/git.ts so SystemCtr's selectFolder can still probe the picked folder without crossing controller boundaries. Renderer side: new electronGitService wraps ipc.git.*, and all six chat-input hooks plus BranchSwitcher are switched over. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 💄 style(chat-input): inline ahead/behind arrows into branch chip Moves the ↑/↓ counts out of a separate status block and inside the branch trigger next to the label, so they sit with the branch they describe instead of after the file-change badge. Tooltip folds into the branch tooltip (full name · N to push · M to pull) so a single hover covers both pieces of info. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 🐛 fix(desktop): parse git status with -z to avoid filename misparse The previous getGitWorkingTreeFiles split every line on ' -> ' to detect renames, but only R/C status codes emit that delimiter. Legitimate filenames containing ' -> ' (or spaces, or embedded newlines) were misparsed — the popover would report a truncated path or lose the entry entirely. Switch both getGitWorkingTreeStatus and getGitWorkingTreeFiles to `git status --porcelain -z`: NUL-terminated records, no C-style quoting, no \n splitting hazards. Rename/copy entries emit two NUL-separated tokens (DEST\0SRC) which we consume as a pair so counts and paths stay correct. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 🐛 fix(todo-progress): hide stale todos when a new user turn starts Add `selectCurrentTurnTodosFromMessages` that scopes the todos lookup to messages after the last user message. The inline TodoProgress component now uses it, so a completed 8/8 progress bar from a previous operation no longer lingers across the next user turn. The original `selectTodosFromMessages` is unchanged because the agent runtime step context still needs cross-turn visibility of the plan. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 🔒 fix(desktop): tighten GitHub remote detection to host position Replace substring check `config.includes('github.com')` with a regex anchored to URL host position so look-alikes like `evilgithub.com` and `github.com.attacker.com` no longer classify as GitHub. Closes CodeQL "Incomplete URL substring sanitization" on PR #13980. Not a real security issue (the config file is local and the classification only drives a UI icon), but the tightened check is strictly more correct and silences the scanner. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
730169e6b6
|
✨ feat(electron): add + button to TabBar for new topic in active context (#13972)
* ✨ feat(electron): add + button to TabBar to open new topic in active context Introduce a pluggable `createNewTabAction` extension on RecentlyViewed plugins so each page type can decide whether (and how) to spawn a new tab from the active tab. Implemented for agent / agent-topic / group / group-topic — clicking `+` creates a fresh topic under the current agent/group and opens it as a new tab; other page types hide the button by default. * ✨ feat(electron): support new tab from page context Page plugin now implements `createNewTabAction`, creating a fresh untitled document via `usePageStore().createPage` and opening it as a new `page` tab. * 🐛 fix(electron): refresh page list after creating a new page via TabBar + `createPage` only hits the service; without refreshing the documents list, the sidebar / PageExplorer wouldn't show the freshly-created page until the next full reload. * 🐛 fix(electron): highlight new page in sidebar when opened via TabBar + Switch to `createNewPage`, which runs the full optimistic flow — dispatches the new document into the sidebar list and sets `selectedPageId` — so the nav item active state stays in sync with the freshly-opened page tab. * 🐛 fix(electron): dispatch real page doc into sidebar list for TabBar + The earlier `createNewPage` approach relied on an optimistic temp document that SWR revalidation can clobber before the real doc replaces it, leaving the new page absent from the sidebar. Create the page via `createPage` first, then synthesize a `LobeDocument` from the server response and dispatch it into the list alongside setting `selectedPageId` — the nav item now appears and highlights in sync with the new tab. |
||
|
|
6b6915d147
|
✨ feat(onboarding): add preset agent naming suggestions (#13931)
* ✨ feat(onboarding): add preset agent naming suggestions * 🐛 fix(test): align AgentDocumentsGroup test assertions with title-first rendering #13940 changed DocumentItem to prefer title over filename, but the AgentDocumentsGroup tests from #13924 were still asserting on filename strings. Update all text matchers to use titles (Brief / Example). |
||
|
|
0213656565
|
🐛 fix: message gateway (#13979)
* fix: local webhook typing * feat: add dormant status * feat: add bot status tag * feat: add bot connection status and refresh status * feat: support bot status list refresh * fix: bot status * chore: add test timeout |
||
|
|
8240e8685d
|
🐛 fix(desktop): repo-type detection for submodule/worktree + chat & sidebar polish (#13978)
* 🐛 fix(desktop): detect repo type for submodule and worktree directories Route detectRepoType through resolveGitDir so directories where `.git` is a pointer file (submodules, worktrees) are correctly identified as git/github repos instead of falling back to the plain folder icon. Fixes LOBE-7373 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 🐛 fix(desktop): reprobe repo type for stale recent-dir entries The recents picker rendered `entry.repoType` directly from localStorage, so any submodule/worktree entry cached while `detectRepoType` still returned `undefined` stayed stuck on the folder icon even after the main-process fix. Wrap each row icon in a component that calls `useRepoType`, which re-probes missing entries and backfills the cache. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 🐛 fix(chat-input): clear autocomplete hint on IME start to prevent freeze Dispatch KEY_ESCAPE_COMMAND on compositionstart so the autocomplete plugin removes PlaceholderInline/PlaceholderBlock nodes before the IME begins composing. Composing next to those placeholder nodes caused the editor to freeze during pinyin input with a visible hint. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ♻️ refactor(topic-sidebar): split project grouping into ByProjectMode Extracts project-specific group rendering from ByTimeMode into its own ByProjectMode folder, with a shared GroupedAccordion container. Project groups get a folder-icon column aligned with the topic item layout and a "new topic in {directory}" action. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 🐛 fix(desktop): read config via commondir for linked worktrees `resolveGitDir` returns `.git/worktrees/<name>/` for linked worktrees — that dir has its own `HEAD` but no `config`, so `detectRepoType` still returned `undefined` and worktrees missed the repo icon. Resolve the `commondir` pointer first so `config` is read from the shared gitdir. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
46df77ac3f
|
💄 style(tab-bar): blend inactive tabs with titlebar, show close icon by default (#13973)
* 💄 style(tab-bar): blend inactive tabs with titlebar, show close icon by default Inactive tabs now use a transparent background and gain a subtle hover fill, matching Chrome's tab chrome so the titlebar feels visually unified. The close icon is always visible instead of fading in on hover, so users don't have to hunt for it on narrow tabs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 🐛 fix(desktop): CMD+N now actually clears active topic on agent page Previously the File → 新建话题 (CMD+N) handler only `navigate()`d to the agent base path. When the user was on `/agent/:aid?topic=xxx`, this stripped the URL param but `ChatHydration`'s URL→store updater skips `undefined` values, so `activeTopicId` in the chat store was never cleared and the subscriber would push the stale topic right back into the URL. Call `switchTopic(null)` on the store directly when an agent is active so the change propagates store→URL via the existing subscriber. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 🐛 fix(hetero-agent): don't surface self-cancelled exits as runtime errors User-initiated cancel/stop and Electron before-quit kill the agent process with SIGINT/SIGTERM, producing non-zero exit codes (130/143/137). Mark these via session.cancelledByUs so the exit handler routes them through the complete broadcast — otherwise a user cancel or app shutdown would look like an agent failure (e.g. "Agent exited with code 143" leaking into other live CC sessions' topics). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ✨ feat(tab-bar): show running indicator dot on tab when agent is generating Adds a useTabRunning hook that reads agent runtime state from the chat store for agent / agent-topic tabs, and renders a small gold dot over the tab avatar/icon while the conversation is generating. Other tab types stay unaffected. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 💄 style(claude-code): render ToolSearch select: queries as inline tags Parses select:A,B,C into individual tag chips (monospace, subtle pill background) instead of a comma-joined string, so the names of tools being loaded read more clearly. Keyword queries keep the existing single-highlight rendering. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ✨ feat(git-status): show +N ±M -K diff badge next to branch name Surface uncommitted-file count directly in the runtime-config status bar so the dirty state is visible at a glance without opening the branch dropdown. Each segment is color-coded (added / modified / deleted) and hidden when zero; a tooltip shows the verbose breakdown. Implementation: - Backend buckets `git status --porcelain` lines into added / modified / deleted / total via X+Y status pair - New always-on useWorkingTreeStatus SWR hook (focus revalidation, 5s throttle) shared by GitStatus and BranchSwitcher — single fetch path - BranchSwitcher's "uncommitted changes: N files" now reads `total` Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 🐛 fix(assistant-group): show only delete button while tool call is in progress When the last child of an assistantGroup is a running tool call, `contentId` is undefined and the action bar fell through to a branch that dropped the `menu` and `ReactionPicker`, leaving a single copy icon with no overflow. Replace the legacy `continueGeneration / delAndRegenerate / del` bar with a del-only bar in this state — delete is the only action that makes sense before any text block is finalized. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 🐛 fix(conversation-flow): aggregate per-step nested metadata.usage in assistantGroup After hetero-agent moved to per-step usage writes (`metadata: { usage: {...} }`), the assistantGroup virtual message stopped showing the cumulative token total across steps and instead surfaced only the last step's numbers. Root cause: splitMetadata only recognised the legacy flat shape (`metadata.totalTokens`, etc.) and didn't read the new nested shape, so each child block went into aggregateMetadata with `usage: undefined`. The sum was empty, and the final group inherited a single child's metadata.usage purely because Object.assign collapsed groupMetadata down to the last child. - splitMetadata now reads both nested (`metadata.usage` / `metadata.performance`) and flat (legacy) shapes; nested takes priority - Add `'usage'` / `'performance'` to the usage/performance field sets in parse and FlatListBuilder so the nested objects don't leak into "other metadata" - Regression test: multi-step assistantGroup chain sums child usages Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 💄 style(hetero-agent): tone down full-access badge to match left bar items The badge was shouting in colorWarning + 500 weight; reduce to colorTextSecondary at normal weight so it sits at the same visual rank as the working-dir / git buttons on the left. The CircleAlert icon still carries the warning semantics. Also force cursor:default so the non-interactive label doesn't pick up an I-beam over its text. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
6ca5fc4bdc
|
✨ feat(hetero-agent): Claude Code runtime, cwd, and sidebar polish (#13970)
* ✨ feat(hetero-agent): synthesize pluginState.todos from CC TodoWrite Adapter now translates Claude Code's declarative TodoWrite tool_use input into the shared StepContextTodos shape and attaches it to tool_result. Selector drops the GTD identifier filter so any producer honoring pluginState.todos lights up the TodoProgress card. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 🐛 fix(hetero-agent): skip TodoWrite pluginState synthesis on error results A failed TodoWrite (is_error=true) means the snapshot was never applied on CC's side. Since selectTodosFromMessages now picks the latest pluginState.todos from any producer, leaking a failed-write snapshot could overwrite the live todo UI with changes that never actually happened. Drain the cache either way so a retry with a fresh tool_use id doesn't inherit stale args. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 🐛 fix(hetero-agent): prefer topic-level cwd on send; route UI changes to active topic Topic-level workingDirectory now takes priority over agent-level on the send path, matching what the topic is actually pinned to. The UI picker writes to the active topic's metadata (not the agent default), and warns before switching when doing so would invalidate an existing CC session. * ✨ feat(tab): reset tab cache when page type changes to stop stale metadata bleed Switching a tab from one page type to another (e.g. agent → home) kept the previous page's cached title/avatar, so the new page rendered with the wrong header. Reset the cache on type change; preserve the merge only when the type stays the same. * 🐛 fix(hetero-agent): kill CC process tree on cancel so tool children exit SIGINT to just the claude binary was leaving bash/grep/etc. tool subprocesses running, which kept the CLI hung waiting on them. Spawn the child detached (Unix) so we can signal the whole group via process.kill(-pid, sig); use taskkill /T /F on Windows. Escalate SIGINT → SIGKILL after 2s for tool calls that swallow SIGINT, and do the same tree kill on disposeSession's SIGTERM path. * ✨ feat(hetero-agent): show "Full access" badge in CC working-directory bar Claude Code runs locally with full read/write on the working directory and permission mode switching isn't wired up yet — the badge sets that expectation up-front instead of leaving users guessing. Tooltip spells out the constraint for anyone who wants detail. * ♻️ refactor(agent-list): show runtime name (Claude Code/Codex) instead of generic "External" tag The "External" tag on heterogeneous agents didn't tell users which runtime backs the agent — multiple CLI runtimes (Claude Code, Codex, …) looked identical in the sidebar. Map the heterogeneous type to its display name so the tag identifies the actual runtime, with the raw type as a fallback for any future provider we haven't mapped yet. --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
77fd0f13f0
|
🐛 fix(hetero-agent): persist streamed text alongside tool writes; collapse workflow summary (#13968)
* 🐛 fix(hetero-agent): persist accumulated text alongside tools[] writes Carry the latest streamed content/reasoning into the same UPDATE that writes tools[], so the DB row stays in sync with the in-memory stream. Without this, gateway `tool_end → fetchAndReplaceMessages` reads a tools-only row and clobbers the UI's streamed text. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ✨ feat(workflow-summary): collapse summary when many tool kinds When a turn calls >4 distinct tool kinds, list only the top 3 by count and append "+N more · X calls total[ · Y failed]". Keeps the inline summary scannable on long tool-heavy turns instead of running off the line. Short turns keep the existing full list. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 💄 style(claude-code): use chip style for Skill inspector name Replace the colon+highlight text with a pill-shaped chip containing the SkillsIcon and skill name. Gives the Skill activation readout visual parity with other tool chips and prevents long skill names from overflowing the inspector line. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ✅ test(agent-documents): assert on rendered title, not filename #13940 changed DocumentItem to prefer document.title over filename, but the sidebar test still expected 'brief.md' / 'example.com'. Align the assertions with the current behavior so the suite is green on canary. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 💄 style(tab-bar): show agent avatar on agent/topic tabs Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
2711aa9191
|
✨ feat(desktop): add dedicated topic popup window with cross-window sync (#13957)
* ✨ feat(desktop): add dedicated topic popup window with cross-window sync Introduce a standalone Vite entry for the desktop "open topic in new window" action. The popup is a lightweight SPA (no sidebar, no portal) hosting only the Conversation, and stays in sync with the main window through a BroadcastChannel bus. - Add popup.html + entry.popup.tsx + popupRouter.config.tsx - Add /popup/agent/:aid/:tid and /popup/group/:gid/:tid routes - Reuse main Conversation/ChatInput; wrap in MarketAuth + Hotkeys providers - Pin-on-top button in the popup titlebar (new windows IPC: set/isAlwaysOnTop) - Group topic "open in new window" now uses groupId (previously misused agentId) - Cross-window sync: refreshMessages/refreshTopic emit via BroadcastChannel; subscriber revalidates local SWR caches with echo-loop suppression - Hide WorkingPanel toggle inside /popup (no WorkingSidebar present) - RendererUrlManager dispatches /popup/* to popup.html in prod; dev middleware rewrites SPA deep links while skipping asset/module requests * 💄 style(desktop): restore loading splash in popup window * ♻️ refactor(desktop): replace cross-window sync with popup-ownership guard The BroadcastChannel-based bidirectional sync between the main SPA and the topic popup window had edge cases during streaming. Drop it in favour of a simpler ownership model: when a topic is already open in a popup, the main window shows a "focus popup" redirect instead of rendering a second conversation. - Remove src/libs/crossWindowBus.ts and src/features/CrossWindowSync - Remove postMessagesMutation/postTopicsMutation calls from refresh actions - Add windows.listTopicPopups + windows.focusTopicPopup IPC - Main process broadcasts topicPopupsChanged on popup open/close; parses (scope, id, topicId) from the popup window's /popup/... path - Renderer useTopicPopupsRegistry subscribes to broadcasts and fetches the initial snapshot; useTopicInPopup selects by scope - New TopicInPopupGuard component with "Focus popup window" button - Desktop-only index.desktop.tsx variants for (main)/agent and (main)/group render the guard when the current topic is owned by a popup - i18n: topic.inPopup.title / description / focus in default + en/zh * 🐛 fix(desktop): re-evaluate popup guard when topic changes Subscribe to the popups array and derive findPopup via useMemo so scope changes (e.g. switching topic in the sidebar while a popup is open) correctly re-compute the guard and let the main window render the newly active topic. * 🐛 fix(desktop): focus detached topic popup from main window * ✨ feat(desktop): add open in popup window action to menu for active topic Signed-off-by: Innei <tukon479@gmail.com> * 🎨 style: sort imports to satisfy simple-import-sort rule * ✨ feat(error): add resetPath prop to ErrorCapture and ErrorBoundary for customizable navigation Signed-off-by: Innei <tukon479@gmail.com> * ♻️ refactor: restore ChatHydration in ConversationArea for web/mobile routes Reintroduce ChatHydration component to agent and group ConversationArea so that URL query sync (topic/thread) works on web and mobile routes, not only on desktop entry files. * ✨ feat(electron): enforce absolute base URL in renderer config to fix asset resolution in popup windows Signed-off-by: Innei <tukon479@gmail.com> --------- Signed-off-by: Innei <tukon479@gmail.com> |
||
|
|
7fe751eaec
|
✨ feat: billboard in sidebar (#13962)
* feat: support billboard * feat: support BillBoard display * fix: carousel dot style * chore: adjust Anouncements copy * feat: add annoucements animations * feat: support i18n and show less and more * fix: notification copy * chore: remove show less and show more * feat:support Billboard title i18n * fix: show billboard in time window * feat: add schema validation * Potential fix for pull request finding 'Unused variable, import, function or class' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Potential fix for pull request finding 'Unused variable, import, function or class' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * fix: test case --------- Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> |
||
|
|
d581937196
|
✨ feat(cc): account card, topic filter, and CC integration polish (#13955)
* 💄 style(error): refine error page layout and stack panel Replace Collapse with Accordion for a clickable full-row header, move stack below action buttons as a secondary branch, and wrap in a Block that softens to filled when collapsed and outlined when expanded. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 💄 style(cc): boost topic loading ring contrast in light mode Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 💄 style(error): reload page on retry instead of no-op navigate The retry button called navigate(resetPath) which often landed on the same path and re-triggered the same error, feeling broken. Switch to window.location.reload() so the error page actually recovers, and drop the now-unused resetPath prop across route configs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 🐛 fix(cc-agent): send prompt via stdin stream-json to avoid CLI arg parsing Previously the Claude Code prompt was appended as a positional CLI arg, so any prompt starting with `-` / `--` (dashes, 破折号) got misinterpreted as a flag by the CC CLI's argparser. Switch the claude-code preset to `--input-format stream-json` and write the prompt as a newline-delimited JSON user message on stdin for all messages (not just image-attached ones). Unifies the image and text paths and paves the way for LOBE-7346 Phase 2 (persistent process + native queue/interrupt). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ♻️ refactor(cc): extract per-tool inspectors into Inspector/ folder Mirrors the Inspector/<Tool>/index.tsx convention used by builtin-tool-skills, builtin-tool-skill-store, and builtin-tool-activator. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ♻️ refactor(cc): flatten Inspector/ to per-tool tsx files Drop the per-tool subfolder wrapper (Inspector/Edit/index.tsx → Inspector/Edit.tsx) since each tool is a single file — no co-located assets to justify the folder. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ✨ feat(topic): add filter with By project grouping and sort-by option Split the legacy topicDisplayMode enum into independent topicGroupMode (byTime / byProject / flat) and topicSortBy (createdAt / updatedAt), and surface them from a new sidebar Filter dropdown. Adds groupTopicsByProject so topics can be grouped by their workingDirectory, with favorites pinned and the "no project" bucket placed last. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ✨ feat(cc): show Claude Code account and subscription on profile Add a getClaudeAuthStatus IPC that shells out to claude auth status --json, and render the returned email + subscription tag on the CC Status Card. The auth fetch runs independently of tool detection so a failure can't flip the CLI card to unavailable. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 💄 style(home): show running spinner badge on agent/inbox avatars Replace NavItem's generic loading state with a bottom-right spinner badge on the avatar, so a running agent stays clearly labelled without hiding the avatar. Inbox entries switch to per-agent isAgentRunning so only the actively running inbox shows the badge. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 💄 style(cc): default-expand Edit and Write tool renderers Add ClaudeCodeApiName.Edit and Write to ClaudeCodeRenderDisplayControls so their inspectors render expanded by default, matching TodoWrite. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 🔧 chore(cc): drop default system prompt when creating Claude Code agent Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Update avatar URL for Claude Code * ✅ test(workflow-collapse): stub ShikiLobeTheme on @lobehub/ui mock @lobehub/editor's init code reads ShikiLobeTheme from @lobehub/ui, which some transitive import pulls in during the test. Add the stub to match the pattern used in WorkingSidebar/index.test.tsx. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 🐛 fix(cc): fall back to Desktop path instead of `/` when no cwd is set - Selector prefers desktopPath over homePath before it resolves nothing, so the renderer always forwards a sensible cwd. - Main-process spawn mirrors the same fallback with app.getPath('desktop'), covering cases where Electron is launched from Finder (parent cwd is `/`). Fixes LOBE-7354 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 🐛 fix(topic): use remote app origin for topic copy link Desktop 下 window.location.origin 是 app://renderer,复制出来的链接无法分享。 改用 useAppOrigin(),与分享链接保持一致(web 用 window.location.origin, desktop 用 electron store 的 remoteServerUrl)。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
7d5889a7ed
|
✨ feat(heterogeneous-agent): git-aware runtime config + topic rename modal + inspectors (#13951)
* ✨ feat(cc-desktop): git-aware runtime config + topic rename modal + inspectors Cluster of desktop UX improvements around the Claude Code integration: - CC chat input runtime bar: branch switcher, git status, and a richer working-directory bar powered by a new SystemCtr git API (branch list / current status) and `useGitInfo` hook. - Topic rename: switch to a dedicated RenameModal component; add an auto-rename action in the conversation header menu. - ToolSearch inspector for the CC tool client. - Shared DotsLoading indicator. - Operation slice tidy-ups for CC flows. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ♻️ refactor(types): rename heterogeneous provider type `claudecode` → `claude-code` Align the type literal with the npm/CLI naming convention used elsewhere (@lobechat/builtin-tool-claude-code, claude-code provider id) so the union matches the rest of the codebase. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 💄 style(cc-desktop): polish TodoWrite labels, branch switcher refresh, and chat input affordances - TodoWrite render + inspector: i18n the header label (Todos / Current step / All tasks completed), surface the active step inline as highlighted text, and switch the in-progress accent from primary to info for better contrast. - BranchSwitcher: move the refresh button into the dropdown's section header, switch the search and create-branch inputs to the filled variant, and reuse DropdownMenuItem for the create-branch entry instead of a custom footer chip. - GitStatus: drop the inline refresh affordance (now lives in the switcher), collapse trigger styles, and split the PR badge with its own separator. - WorkingDirectory / WorkingDirectoryBar: tighten paddings and gaps so the runtime config row reads at a consistent height. - InputEditor: skip inline placeholder completion when the cursor is not at end of paragraph — inserting a placeholder mid-text triggered nested editor updates that froze the input. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 🐛 fix(cc-desktop): probe repoType for working dirs not cached in recents GitStatus was gated on the `repoType` stored in `recentDirs`, but legacy string entries and agent-config-driven paths that never went through the folder picker have no cached `repoType`. As a result, branch / PR status silently disappeared for valid git repos until users re-selected the folder. Promote `detectRepoType` to a public IPC method and add a `useRepoType` hook that uses the cached value as a fast path, otherwise probes the filesystem via SWR and backfills the recents entry so subsequent reads hit cache. Both runtime config bars (CC mode + heterogeneous chat input) now resolve `repoType` through the hook. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 💄 style(shared-tool-ui): rework Bash/Grep/Glob inspector rows - RunCommand: terminal-prompt icon + mono command text instead of underline highlight - Grep: split pattern by `|` into mono tag chips - Glob: single mono tag chip matching Grep - Switch rows to baseline alignment so the smaller mono text lines up with the label Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 🐛 fix(DotsLoading): allow optional color in styles params The Required<StyleArgs> generic forced color to string, but it's only defaulted at the CSS level via fallback to token.colorTextSecondary. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
5dc94cbc45
|
✨ feat(cc-agent): improve for CC integration mode (#13950)
* ✨ feat(cc-agent-profile): swap model/skills pickers for CC CLI status in CC mode When an agent runs under the Claude Code heterogeneous runtime, its model and tools are owned by the external CLI, so the profile page's model selector and integration-skills block are misleading. Replace them with a card that re-detects `claude --version` on mount and shows the resolved binary path — useful when CLAUDE_CODE_BIN or similar points at a non-default CLI. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 💄 style(cc-agent-profile): hide cron for CC agent and polish render previews - Hide cron sidebar entry when current agent is heterogeneous (CC) - Allow model avatar in agent header emoji picker - Add padding to Glob/Grep/Read/Write preview boxes for consistent spacing - Simplify NavPanelDraggable by removing slide animation layer Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ♻️ refactor(shared-tool-ui): extract ToolResultCard for Read/Write/Glob/Grep renders Hoist the shared card shell (icon + header + preview box) into @lobechat/shared-tool-ui/components so the four Claude Code Render files no longer duplicate container/header/previewBox styles. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 💄 style(agent-header): restyle title and expand actions menu Bold the topic title, render the working directory as plain text (no chip/icon), move the "..." menu to the left, and expand it with pin/rename/copy working directory/copy session ID/delete. Fall back to "New Topic" when no topic is active. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 💄 style(topic-list): replace spinning loader with ring-and-arc loading icon Adds a reusable RingLoadingIcon (static track + rotating arc, mirroring the send-button style) and swaps the topic-item loader over to it so the loading state reads as a polished ring rather than a thin spinning dash. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 💄 style(topic-list): switch unread indicator to a radar ping effect Replaces the glowing neon-dot pulse with a smaller 6px core dot plus a CSS-keyframe ripple ring that scales out and fades, giving the unread marker a subtler, more refined cadence. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * 💄 style(cc-chat-input): drop file upload in CC mode, surface typo toggle Claude Code brings its own file handling and knowledge context, so the paperclip dropdown only showed "Upload Image" + a useless "View More" link — confusing and not clean. Replace fileUpload with typo in the heterogeneous chat input, and fold ServerMode back into a single Upload/index.tsx now that the ClientMode/ServerMode split is gone. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
13fe968480
|
✨ feat: claude code intergration polish (#13942)
* 🐛 fix(cc-resume): guard resume against cwd mismatch (LOBE-7336) Claude Code CLI stores sessions per-cwd under `~/.claude/projects/<encoded-cwd>/`, so resuming a session from a different working directory fails with "No conversation found with session ID". Persist the cwd alongside the session id on each turn and skip `--resume` when the current cwd can't be verified against the stored one, falling back to a fresh session plus a toast explaining the reset. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ✨ feat(cc-desktop): Claude Code desktop polish + completion notifications Bundles the follow-on UX improvements for Claude Code on desktop: - Completion notifications: CC / Codex / ACP runs now fire a desktop notification (when the window is hidden) plus dock badge when the turn finishes, matching the Gateway client-mode behavior. - Inspector + renders: add Skill and TodoWrite inspectors, wire them through Render/index + renders registry, expose shared displayControls. - Adapter: extend claude-code adapter with additional event coverage and regression tests. - Sidebar / home menu: clean up Topic list item and dropdown menu, rename "Claude Code Agent" entry point to "Add Claude Code" across EN/ZH. - Assorted: NotificationCtr, Browser, WorkflowCollapse, ServerMode upload, agent/tool selectors — small follow-ups surfaced while building the above. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ✅ test(browser): mock electron.app for badge-clear on focus Browser.focus handler now calls app.setBadgeCount / app.dock.setBadge to clear the completion badge when the user returns. Tests imported the Browser module without exposing app on the electron mock, causing a module-load failure. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ✨ feat(cc-topic): folder chip + unify cwd into workingDirectory (#13949) ✨ feat(cc-topic): show bound folder chip and unify cwd into workingDirectory Replace the separate `ccSessionCwd` metadata field with the existing `workingDirectory` so a CC topic's bound cwd has one source of truth: persisted on first CC execution, read back by resume validation, and surfaced in a clickable folder chip next to the topic title on desktop. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
9a2ee8a58f
|
✨ feat(onboarding): add wrap-up button for agent onboarding (#13934)
Let users finish agent onboarding explicitly once they've engaged enough, instead of waiting for the agent to trigger finishOnboarding. - New WrapUpHint component above ChatInput; shows in summary phase or discovery phase after ≥3 user messages - Confirm modal before finish; reuses existing finishOnboarding service - Tightened Phase 2 (user_identity) system prompt: MUST save fullName before leaving phase, handle ambiguous name responses explicitly |
||
|
|
75b55edca1
|
✨ feat: promote agent documents as primary workspace panel (#13924)
* ♻️ refactor: adopt Notebook list + EditorCanvas for agent documents The agent working sidebar previously used a FileTree directory view and a hand-rolled Markdown+TextArea editor with manual save. Agent documents already back onto the canonical `documents` table via an FK, so they can reuse the exact same rendering surface as Notebook. - AgentDocumentsGroup: replace FileTree with a flat card list styled after Portal/Notebook/DocumentItem (icon + title + description + delete). - AgentDocumentEditorPanel: drop the bespoke draft/save/segmented view logic; mount the shared <EditorCanvas documentId={doc.documentId} sourceType="notebook" /> inside an EditorProvider so auto-save and rich editing are handled by useDocumentStore. * ✨ feat: promote agent documents as the primary workspace panel - Replace the agent-document sidebar with a Notebook-style list: pill filter (All/Docs/Web), per-item createdAt, globe icon for sourceType=web. - Add a stable panel header "Resources" with a close button (small size, consistent with other chat header actions); no border divider. - Wire clicks to the shared Portal Document view via openDocument(), retiring the inline AgentDocumentEditorPanel. - Portal/Document/Header now resolves title directly from documentId via documentService.getDocumentById + a skeleton loading state. - Portal top-right close icon switched to `X`. - Layout: move AgentWorkingSidebar to the rightmost position; auto-collapse the left navigation sidebar while Portal is open (PortalAutoCollapse). - Header: remove dead NotebookButton, drop the Notebook menu item; add a WorkingPanelToggle visible only when the working panel is collapsed. - ProgressSection hides itself when the topic has no GTD todos. - Builtin tool list removes Notebook; migrate CreateDocument Render and Streaming renderers to builtin-tool-agent-documents (notebook package kept for legacy rendering of historical tool calls). - agent_documents list UI now reads from a separate SWR key (documentsList) so the agent-store context mapping doesn't strip documentId/sourceType/createdAt from the UI payload. - i18n: add workingPanel.resources.filter.{all,documents,web}, viewMode.{list,tree}, and the expanded empty-state copy; zh-CN translations seeded for preview. - New local-testing reference: agent-browser-login (inject better-auth cookie for authenticated agent-browser sessions). * update * 🐛 fix: satisfy tsc strict i18next keys, remove duplicate getDocumentById, coerce showLeftPanel * ♻️ refactor: graduate agent working panel out of labs |
||
|
|
03d2068a5d
|
✨ feat(onboarding): add feature flags and footer promotion pipeline (#13853)
* ✨ feat(onboarding): enhance agent onboarding experience and add feature flags - Added new promotional messages for agent onboarding in both Chinese and default locales. - Updated HighlightNotification component to support action handling and target attributes. - Introduced feature flags for agent onboarding in the configuration schema and tests. - Implemented logic to conditionally display onboarding options based on feature flags and user state. - Added tests for the onboarding flow and promotional notifications in the footer. This update aims to improve the user experience during the onboarding process and ensure proper feature management through flags. Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat(home): add footer promotion pipeline with feature-flag gating Extract resolveFooterPromotionState for agent onboarding vs Product Hunt promos. Normalize isMobile boolean, refine HighlightNotification CTA layout, extend tests. Made-with: Cursor * ✨ feat(locales): add agent onboarding promotional messages in multiple languages Added new promotional messages for agent onboarding across various locales, enhancing the user experience with localized action labels, descriptions, and titles. This update supports a more engaging onboarding process for users globally. Signed-off-by: Innei <tukon479@gmail.com> * 💄 chore: refresh quick wizard onboarding promo * 🐛 fix(chat): keep long mixed assistant content outside workflow fold * ✨ feat(onboarding): add agent onboarding feedback panel and service LOBE-7210 Made-with: Cursor * ✨ feat(markdown-patch): add shared markdown patch tool with SEARCH/REPLACE hunks Introduce @lobechat/markdown-patch util and expose patchDocument API on the web-onboarding and agent-documents builtin tools so agents can apply byte-exact SEARCH/REPLACE hunks instead of resending full document content. * ✨ feat(onboarding): prefer patchDocument for non-empty documents Teach the onboarding agent (systemRole) and context engine (OnboardingActionHintInjector) to prefer patchDocument over updateDocument when SOUL.md or User Persona already has content, keeping updateDocument reserved for the initial seed write or full rewrites. * 🐛 fix(conversation): add rightActions to ChatInput component Updated the AgentOnboardingConversation component to include rightActions in the ChatInput, enhancing the functionality of the onboarding conversation interface. Signed-off-by: Innei <tukon479@gmail.com> * Add specialized onboarding approval UI * 🐛 fix(serverConfig): handle fetch errors in server config actions Updated the server configuration action to include error handling for fetch failures, ensuring that the server config is marked as initialized when an error occurs. Additionally, modified the SWR mock to simulate error scenarios in tests. Signed-off-by: Innei <tukon479@gmail.com> * 🐛 fix(tests): update Group component tests with new data-testid attributes Added data-testid attributes for workflow and answer segments in the Group component tests to improve test targeting. Adjusted the isFirstBlock property for consistency and ensured the component renders correctly with the provided props. Signed-off-by: Innei <tukon479@gmail.com> --------- Signed-off-by: Innei <tukon479@gmail.com> |
||
|
|
2298ad8ce1
|
✨ chore(heterogeneous-agent): integrate heterogeneous agents with claude code (#13754)
* ♻️ refactor(acp): move agent provider to agencyConfig + restore creation entry - Move AgentProviderConfig from chatConfig to agencyConfig.heterogeneousProvider - Rename type from 'acp' to 'claudecode' for clarity - Restore Claude Code agent creation entry in sidebar + menu - Prioritize heterogeneousProvider check over gateway mode in execution flow - Remove ACP settings from AgentChat form (provider is set at creation time) - Add getAgencyConfigById selector for cleaner access - Use existing agent workingDirectory instead of duplicating in provider config Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> ✨ feat(acp): defer terminal events + extract model/usage per turn Three improvements to ACP stream handling: 1. Defer agent_runtime_end/error: Previously the adapter emitted terminal events from result.type directly into the Gateway handler. The handler immediately fires fetchAndReplaceMessages which reads stale DB state (before we persist final content/tools). Fix: intercept terminal events in the executor's event loop and forward them only AFTER content + metadata has been written to DB. 2. Extract model/usage per assistant event: Claude Code sets model name and token usage on every assistant event. Adapter now emits a 'step_complete' event with phase='turn_metadata' carrying these. Executor accumulates input/output/cache tokens across turns and persists them onto the assistant message (model + metadata.totalTokens). 3. Missing final text fix: The accumulated assistant text was being written AFTER agent_runtime_end triggered fetchAndReplaceMessages, so the UI rendered stale (empty) content. Deferred terminals solve this. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> 🐛 fix(acp): eliminate orphan-tool warning flicker during streaming Root cause: LobeHub's conversation-flow parser (collectToolMessages) filters tool messages by matching `tool_call_id` against `assistant.tools[].id`. The previous flow created tool messages FIRST, then updated assistant.tools[], which opened a brief window where the UI saw tool messages that had no matching entry in the parent's tools array — rendering them as "orphan" with a scary "请删除" warning to the user. Fix: Reorder persistNewToolCalls into three phases: 1. Pre-register tool entries in assistant.tools[] (id only, no result_msg_id) 2. Create the tool messages in DB (tool_call_id matches pre-registered ids) 3. Back-fill result_msg_id and re-write assistant.tools[] Between phase 1 and phase 3 the UI always sees consistent state: every tool message in DB has a matching entry in the parent's tools array. Verified: orphan count stays at 0 across all sampled timepoints during streaming (vs 1+ before fix). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> 🐛 fix(acp): dedupe tool_use + capture tool_result + persist result_msg_id Three critical fixes to ACP tool-call handling, discovered via live testing: 1. **tool_use dedupe** — Claude Code stream-json previously produced 15+ duplicate tool messages per tool_call_id. The adapter now tracks emitted ids so each tool_use → exactly one tool message. 2. **tool_result content capture** — tool_result blocks live in `type: 'user'` events in Claude Code's stream-json, not in assistant events. The adapter now handles the 'user' event type and emits a new `tool_result` HeterogeneousAgentEvent which the executor consumes to call messageService.updateToolMessage() with the actual result content. Previously all tool messages had empty content. 3. **result_msg_id on assistant.tools[]** — LobeHub's parse() step links tool messages to their parent assistant turn via tools[].result_msg_id. Without it, the UI renders orphan-message warnings. The executor now captures the tool message id returned by messageService.createMessage and writes it back into the assistant.tools[] JSONB. Also adds vitest config + 9 unit tests for the adapter covering lifecycle, content mapping, and tool_result handling. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> ✨ feat(acp): integrate external AI agents via ACP protocol Adds support for connecting external AI agents (Claude Code and future agents like Codex, Kimi CLI) into LobeHub Desktop via a new heterogeneous agent layer that adapts agent-specific protocols to the unified Gateway event stream. Architecture: - New @lobechat/heterogeneous-agents package: pluggable adapters that convert agent-specific outputs to AgentStreamEvent - AcpCtr (Electron main): agent-agnostic process manager with CLI presets registry, broadcasts raw stdout lines to renderer - acpExecutor (renderer): subscribes to broadcasts, runs events through adapter, feeds into existing createGatewayEventHandler - Tool call persistence: creates role='tool' messages via messageService before emitting tool_start/tool_end to the handler Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ♻️ refactor: rename acpExecutor to heterogeneousAgentExecutor - Rename file acpExecutor.ts → heterogeneousAgentExecutor.ts - Rename ACPExecutorParams → HeterogeneousAgentExecutorParams - Rename executeACPAgent → executeHeterogeneousAgent - Change operation type from execAgentRuntime to execHeterogeneousAgent - Change operation label to "Heterogeneous Agent Execution" - Change error type from ACPError to HeterogeneousAgentError - Rename acpData/acpContext variables to heteroData/heteroContext Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ♻️ refactor: rename AcpCtr and acp service to heterogeneousAgent Desktop side: - AcpCtr.ts → HeterogeneousAgentCtr.ts - groupName 'acp' → 'heterogeneousAgent' - IPC channels: acpRawLine → heteroAgentRawLine, etc. Renderer side: - services/electron/acp.ts → heterogeneousAgent.ts - ACPService → HeterogeneousAgentService - acpService → heterogeneousAgentService - Update all IPC channel references in executor Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🔧 chore: switch CC permission mode to bypassPermissions Use bypassPermissions to allow Bash and other tool execution. Previously acceptEdits only allowed file edits, causing Bash tool calls to fail during CC execution. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🐛 fix: don't fallback activeAgentId to empty string in AgentIdSync Empty string '' causes chat store to have a truthy but invalid activeAgentId, breaking message routing. Pass undefined instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🐛 fix: use AI_RUNTIME_OPERATION_TYPES for loading and cancel states stopGenerateMessage and cancelOperation were hardcoding ['execAgentRuntime', 'execServerAgentRuntime'], missing execHeterogeneousAgent. This caused: - CC execution couldn't be cancelled via stop button - isAborting flag wasn't set for heterogeneous agent operations Now uses AI_RUNTIME_OPERATION_TYPES constant everywhere to ensure all AI runtime operation types are handled consistently. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ✨ feat: split multi-step CC execution into separate assistant messages Claude Code's multi-turn execution (thinking → tool → final text) was accumulating everything onto a single assistant message, causing the final text response to appear inside the tool call message. Changes: - ClaudeCodeAdapter: detect message.id changes and emit stream_end + stream_start with newStep flag at step boundaries - heterogeneousAgentExecutor: on newStep stream_start, persist previous step's content, create a new assistant message, reset accumulators, and forward the new message ID to the gateway handler This ensures each LLM turn gets its own assistant message, matching how Gateway mode handles multi-step agent execution. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🐛 fix: fix multi-step CC execution and add DB persistence tests Adapter fixes: - Fix false step boundary on first assistant after init (ghost empty message) Executor fixes: - Fix parentId chain: new-step assistant points to last tool message - Fix content contamination: sync snapshot of content accumulators on step boundary - Fix type errors (import path, ChatToolPayload casts, sessionId guard) Tests: - Add ClaudeCodeAdapter unit tests (multi-step, usage, flush, edge cases) - Add ClaudeCodeAdapter E2E test (full multi-step session simulation) - Add registry tests - Add executor DB persistence tests covering: - Tool 3-phase write (pre-register → create → backfill) - Tool result content + error persistence - Multi-step parentId chain (assistant → tool → assistant) - Final content/reasoning/model/usage writes - Sync snapshot preventing cross-step contamination - Error handling with partial content persistence - Full multi-step E2E (Read → Write → text) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🔧 chore: add orphan tool regression tests and debug trace - Add orphan tool regression tests for multi-turn tool execution - Add __HETERO_AGENT_TRACE debug instrumentation for event flow capture Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ✨ feat: support image attachments in CC via stream-json stdin - Main process downloads files by ID from cloud (GET {domain}/f/{fileId}) - Local disk cache at lobehub-storage/heteroAgent/files/ (by fileId) - When fileIds present, switches to --input-format stream-json + stdin pipe - Constructs user message with text + image content blocks (base64) - Pass fileIds through executor → service → IPC → controller Closes LOBE-7254 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ♻️ refactor: pass imageList instead of fileIds for CC vision support - Use imageList (with url) instead of fileIds — Main downloads from URL directly - Cache by image id at lobehub-storage/heteroAgent/files/ - Only images (not arbitrary files) are sent to CC via stream-json stdin Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🐛 fix: read imageList from persisted DB message instead of chatUploadFileList chatUploadFileList is cleared after sendMessageInServer, so tempImages was empty by the time the executor ran. Now reads imageList from the persisted user message in heteroData.messages instead. Also removes debug console.log/console.error statements. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * update i18n * 🐛 fix: prevent orphan tool UI by deferring handler events during step transition Root cause: when a CC step boundary occurs, the adapter produces [stream_end, stream_start(newStep), stream_chunk(tools_calling)] in one batch. The executor deferred stream_start via persistQueue but forwarded stream_chunk synchronously — handler received tools_calling BEFORE stream_start, dispatching tools to the OLD assistant message → UI showed orphan tool warning. Fix: add pendingStepTransition flag that defers ALL handler-bound events through persistQueue until stream_start is forwarded, guaranteeing correct event ordering. Also adds: - Minimal regression test in gatewayEventHandler confirming correct ordering - Multi-tool per turn regression test from real LOBE-7240 trace - Data-driven regression replaying 133 real CC events from regression.json Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ✨ feat: add lab toggle for heterogeneous agent (Claude Code) - Add enableHeterogeneousAgent to UserLabSchema + defaults (off by default) - Add selector + settings UI toggle (desktop only) - Gate "Claude Code Agent" sidebar menu item behind the lab setting - Remove regression.json (no longer needed) - Add i18n keys for the lab feature Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🐛 fix: gate heterogeneous agent execution behind isDesktop check Without this, web users with an agent that has heterogeneousProvider config would hit the CC execution path and fail (no Electron IPC). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ♻️ refactor: rename tool identifier from acp-agent to claude-code Also update operation label to "External agent running". Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ✨ feat: add CLI agent detectors for system tools settings Detect agentic coding CLIs installed on the system: - Claude Code, Codex, Gemini CLI, Qwen Code, Kimi CLI, Aider - Uses validated detection (which + --version keyword matching) - New "CLI Agents" category in System Tools settings - i18n for en-US and zh-CN Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🐛 fix: fix token usage over-counting in CC execution Two bugs fixed: 1. Adapter: same message.id emitted duplicate step_complete(turn_metadata) for each content block (thinking/text/tool_use) — all carry identical usage. Now deduped by message.id, only emits once per turn. 2. Executor: CC result event contains authoritative session-wide usage totals but was ignored. Now adapter emits step_complete(result_usage) from the result event, executor uses it to override accumulated values. Fixes LOBE-7261 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🔧 chore: gitignore cc-stream.json and .heterogeneous-tracing/ Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🔧 chore: untrack .heerogeneous-tracing/ Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ✨ feat: wire CC session resume for multi-turn conversations Reads `ccSessionId` from topic metadata and passes it as `resumeSessionId` into the heterogeneous-agent executor, which forwards it into the Electron main-process controller. `sendPrompt` then appends `--resume <id>` so the next turn continues the same Claude Code session instead of starting fresh. After each run, the CC init-event session_id (captured by the adapter) is persisted back onto the topic so the chain survives page reloads. Also stops killing the session in `finally` — it needs to stay alive for subsequent turns; cleanup happens on topic deletion or app quit. * 🐛 fix: record cache token breakdown in CC execution metadata The prior token-usage fix only wrote totals — `inputCachedTokens`, `inputWriteCacheTokens` and `inputCacheMissTokens` were dropped, so the pricing card rendered zero cached/write-cache tokens even though CC had reported them. Map the accumulated Anthropic-shape usage to the same breakdown the anthropic usage converter emits, so CC turns display consistently with Gateway turns. Refs LOBE-7261 * ♻️ refactor: write CC usage under metadata.usage instead of flat fields Flat `inputCachedTokens / totalInputTokens / ...` on `MessageMetadata` are the legacy shape; new code should put usage under `metadata.usage`. Move the CC executor to the nested shape so it matches the convention the rest of the runtime is migrating to. Refs LOBE-7261 * ♻️ refactor(types): mark flat usage fields on MessageMetadata as deprecated Stop extending `ModelUsage` and redeclare each token field inline with a `@deprecated` JSDoc pointing to `metadata.usage` (nested). Existing readers still type-check, but IDEs now surface the deprecation so writers migrate to the nested shape. * ♻️ refactor(types): mark flat performance fields on MessageMetadata as deprecated Stop extending `ModelPerformance` and redeclare `duration` / `latency` / `tps` / `ttft` inline with `@deprecated`, pointing at `metadata.performance`. Mirrors the same treatment just done for the token usage fields. * ✨ feat: CC agent gets claude avatar + lands on chat page directly Skip the shared createAgent hook's /profile redirect for the Claude Code variant — its config is fixed so the profile editor would be noise — and preseed the Claude avatar from @lobehub/icons-static-avatar so new CC agents aren't blank. * 🐛 fix(conversation-flow): read usage/performance from nested metadata `splitMetadata` only scraped the legacy flat token/perf fields, so messages written under the new canonical shape (`metadata.usage`, `metadata.performance`) never populated `UIChatMessage.usage` and the Extras panel rendered blank. - Prefer nested `metadata.usage` / `metadata.performance` when present; keep flat scraping as fallback for pre-migration rows. - Add `usage` / `performance` to FlatListBuilder's filter sets so the nested blobs don't leak into `otherMetadata`. - Drop the stale `usage! || metadata` fallback in the Assistant / CouncilMember Extra renders — with splitMetadata fixed, `item.usage` is always populated when usage data exists, and passing raw metadata as ModelUsage is wrong now that the flat fields are gone. * 🐛 fix: skip stores.reset on initial dataSyncConfig hydration `useDataSyncConfig`'s SWR onSuccess called `refreshUserData` (which runs `stores.reset()`) whenever the freshly-fetched config didn't deep-equal the hard-coded initial `{ storageMode: 'cloud' }` — which happens on every first load. The reset would wipe `chat.activeAgentId` just after `AgentIdSync` set it from the URL, and because `AgentIdSync`'s sync effects are keyed on `params.aid` (which hasn't changed), they never re-fire to restore it. Result: topic SWR saw `activeAgentId === ''`, treated the container as invalid, and left the sidebar stuck on the loading skeleton. Gate the reset on `isInitRemoteServerConfig` so it only runs when the user actually switches sync modes, not on the first hydration. * ✨ feat(claude-code): wire Inspector layer for CC tool calls Mirrors local-system: each CC tool now has an inspector rendered above the tool-call output instead of an opaque default row. - `Inspector.tsx` — registry that passes the CC tool name itself as the shared factories' `translationKey`. react-i18next's missing-key fallback surfaces the literal name (Bash / Edit / Glob / Grep / Read / Write), so we don't add CC-specific entries to the plugin locale. - `ReadInspector.tsx` / `WriteInspector.tsx` — thin adapters that map Anthropic-native args (`file_path` / `offset` / `limit`) onto the shared inspectors' shape (`path` / `startLine` / `endLine`), so shared stays pure. Bash / Edit / Glob / Grep reuse shared factories directly. - Register `ClaudeCodeInspectors` under `claude-code` in the builtin-tools inspector dispatch. Also drops the redundant `Render/Bash/index.tsx` wrapper and pipes the shared `RunCommandRender` straight into the registry. * ♻️ refactor: use agentSelectors.isCurrentAgentHeterogeneous Two callsites (ConversationArea / useActionsBarConfig) were reaching into `currentAgentConfig(...)?.agencyConfig?.heterogeneousProvider` inline. Switch them to the existing `isCurrentAgentHeterogeneous` selector so the predicate lives in one place. * update * ♻️ refactor: drop no-op useCallback wrapper in AgentChat form `handleFinish` just called `updateConfig(values)` with no extra logic; the zustand action is already a stable reference so the wrapper added no memoization value. Leftover from the ACP refactor (930ba41fe3) where the handler once did more work — hand the action straight to `onFinish`. * update * ⏪ revert: roll back conversation-flow nested-shape reads Unwind the `splitMetadata` nested-preference + `FlatListBuilder` filter additions from 306fd6561f. The nested `metadata.usage` / `metadata.performance` promotion now happens in `parse.ts` (and a `?? metadata?.usage` fallback at the UI callsites), so conversation-flow's transformer layer goes back to its original flat-field-only behavior. * update * 🐛 fix(cc): wire Stop to cancel the external Claude Code process Previously hitting Stop only flipped the `execHeterogeneousAgent` operation to `cancelled` in the store — the spawned `claude -p` process kept running and kept streaming/persisting output for the user. The op's abort signal had no listeners and no `onCancelHandler` was registered. - On session start, register an `onCancelHandler` that calls `heterogeneousAgentService.cancelSession(sessionId)` (SIGINT to the CLI). - Read the op's `abortController.signal` and short-circuit `onRawLine` so late events the CLI emits between SIGINT and exit don't leak into DB writes. - Skip the error-event forward in `onError` / the outer catch when the abort came from the user, so the UI doesn't surface a misleading error toast on top of the already-cancelled operation. Verified end-to-end: prompt that runs a long sequence of Reads → click Stop → `claude -p` process is gone within 2s, op status = cancelled, no error message written to the conversation. * ✨ feat(sidebar): mark heterogeneous agents with an "External" tag Pipes the agent's `agencyConfig.heterogeneousProvider.type` through the sidebar data flow and renders a `<Tag>` next to the title for any agent driven by an external CLI runtime (Claude Code today, more later). Mirrors the group-member External pattern so future provider types just need a label swap — the field is a string, not a boolean. - `SidebarAgentItem.heterogeneousType?: string | null` on the shared type - `HomeRepository.getSidebarAgentList` selects `agents.agencyConfig` and derives the field via `cleanObject` - `AgentItem` shows `<Tag>{t('group.profile.external')}</Tag>` when the field is present Verified client-side by injecting `heterogeneousType: 'claudecode'` into a sidebar item at runtime — the "外部" tag renders next to the title in the zh-CN locale. * ♻️ refactor(i18n): dedicated key for the sidebar external-agent tag Instead of reusing `group.profile.external` (which is about group members that are user-linked rather than virtual), add `agentSidebar.externalTag` specifically for the heterogeneous-runtime tag. Keeps the two concepts separate so we can swap this one to "Claude Code" / provider-specific labels later without touching the group UI copy. Remember to run `pnpm i18n` before the PR so the remaining locales pick up the new key. * 🐛 fix: clear remaining CI type errors Three small fixes so `tsgo --noEmit` exits clean: - `AgentIdSync`: `useChatStoreUpdater` is typed off the chat-store key, whose `activeAgentId` is `string` (initial ''). Coerce the optional URL param to `''` so the store key type matches; `createStoreUpdater` still skips the setState when the value is undefined-ish. - `heterogeneousAgentExecutor.test.ts`: `scope: 'session'` isn't a valid `MessageMapScope` (the union dropped that variant); switch the fixture to `'main'`, which is the correct scope for agent main conversations. - Same test file: `Array.at(-1)` is `T | undefined`; non-null assert since the preceding calls guarantee the slot is populated. * 🐛 fix: loosen createStoreUpdater signature to accept nullable values Upstream `createStoreUpdater` types `value` as exactly `T[Key]`, so any call site feeding an optional source (URL param, selector that may return undefined) fails type-check — even though the runtime already guards `typeof value !== 'undefined'` and no-ops in that case. Wrap it once in `store/utils/createStoreUpdater.ts` with a `T[Key] | null | undefined` value type so callers can pass `params.aid` directly, instead of the lossy `?? ''` fallback the previous commit used (which would have written an empty-string sentinel into the chat store). Swap the import in `AgentIdSync.tsx`. --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
316349ea06
|
💄 style: remove 'Management' from API Key tab title (#13919)
fix: remove 'Management' from API Key tab title |
||
|
|
d707f60365
|
✨ feat: add Claude Opus 4.7 with xhigh effort tier (#13903) | ||
|
|
f1d615fa9f
|
✨ feat(document): add history management and compare workflow (#13725)
* Add document history versioning and TRPC APIs * 🩹 Improve document history patching for rekeyed editor nodes * Refine PageEditor history timeline UI * Enhance modal API documentation and update modal implementation guidelines. Introduce new modal components and migration notes for transitioning from legacy `@lobehub/ui` to `@lobehub/ui/base-ui`. Update version history localization for improved clarity in UI. Add new CompareModal components for document history comparison. Signed-off-by: Innei <tukon479@gmail.com> * 🔥 chore(docs): remove document history tech spec Made-with: Cursor * Enhance document history management by introducing a 30-day limit for history queries and updating related APIs. Refactor history service methods to support new options for filtering history based on the saved date. Improve UI elements in the PageEditor history timeline for better user experience. Signed-off-by: Innei <tukon479@gmail.com> * Add document history management features and improve API integration - Introduced constants for document history retention and limits. - Updated document history service to compact history based on new retention limits. - Refactored PageEditor to utilize constants for document history limits. - Added new TRPC router for document history management. - Enhanced JSON diffing capabilities for better patching of document history. Signed-off-by: Innei <tukon479@gmail.com> * ♻️ refactor: sync document history schema and simplify history service - Sync simplified document_history table from feat/document-history-db - Remove version/storage_kind/payload/base_version, use editor_data + saved_at - Rewrite pagination with composite (savedAt, id) cursor - Update TRPC APIs from version-based to historyId-based - Replace DocumentVersionControl with AutoSaveHint - Add integration tests for history service * ✨ feat: add per-source document history retention limits - autosave / manual: retain 20 entries each - restore / system: retain 5 entries each - trimHistoryBySource now deletes in batches of 100 to avoid unbounded overflow - removed obsolete constants: PATCH_THRESHOLD, RETENTION_LIMIT, SNAPSHOT_INTERVAL - added integration tests for large overflow trimming * ✨ add llm_call history source and queue-based snapshot for page agent * 💄 restyle document history list to Notion timeline * 💄 fix history timeline alignment, unify fonts and highlight current * ✨ feat(PageEditor): refine document history compare UI and date formatting Made-with: Cursor * ✨ feat(editor): add validation for editor data and update related interfaces - Introduced `isValidEditorData` function to validate editor data structure. - Updated `GetHistoryItemOutput` and `DocumentHistoryItemResult` interfaces to allow `editorData` to be `null`. - Modified `getDocumentEditorData` to return `null` for invalid editor data. - Added integration tests to ensure proper handling of invalid editor data in document history service. - Enhanced editor actions to prevent saving of invalid editor data. Signed-off-by: Innei <tukon479@gmail.com> * 💾 chore(database): split document history indexes * Fix manual saves and optimize history item rendering * 🌐 locale: add missing llm_call translation key in en-US file.json Add pageEditor.history.saveSource.llm_call = \"AI Edit\" to match the default locale and prevent raw i18n key from showing in the history panel. --------- Signed-off-by: Innei <tukon479@gmail.com> |
||
|
|
13d1b011b7
|
🐛 fix(app): include working panel into Lab feature, minor fixes (#13889)
* 🐛 fix(app): include working panel into Lab feature, minor fixes * 🐛 fix(app): conditional disabled. |
||
|
|
a7339bea13
|
🌐 chore(locale): update page editor placeholder to new AI command prompt (#13872)
Update `pageEditor.editorPlaceholder` from `Start writing your page. Press / to open the command menu` to `Press "/" for AI and commands.` across all supported locales and the default locale source. |
||
|
|
9608494b0a
|
💄 style(chat): tighten execServerAgentRuntime loading copy (#13855)
💄 style(chat): tighten `execServerAgentRuntime` loading copy
Current text was trying to do too much in one line — status + two
separate user affordances — and read as an explanation, not a status.
Replaces it with a status-first line that mentions where the work is
happening and the single reassurance users actually need.
- EN: "Task is running in the server. You are safe to leave this page."
- zh-CN: "任务正在服务器运行,您可以放心离开此页面。"
Only en-US and zh-CN are edited; CI translates the rest from the
default file.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
||
|
|
bc7b798dbb
|
🐛 fix(conversation): improve workflow display when user intervention is pending (#13847)
* 🐛 fix(conversation): improve workflow display when user intervention is pending Made-with: Cursor * 🐛 fix(builtin-tool-activator): add ActivatedToolInfo typing to requestedTools for tsgo compat requestedTools was inferred as `{ identifier, name }[]` which lacks the `avatar` property required by `ActivatedToolInfo`, causing tsgo errors. |
||
|
|
632a6383f0
|
✨ feat(app): working panel, and many agent document feat (#13766) | ||
|
|
15fcce97c9
|
♻️ refactor: add more tools in lobe-agent-manangerment(modify、update、delete) (#13842)
* feat: add more tools in lobe-agent-manangerment * feat: add the ensureAgentLoaded to modify it * feat: add the update prompt tools |
||
|
|
fd0d846975
|
✨ feat: support layout custom sort and fix copy (#13812)
* fix: menu locale keys * feat: support resort sidebar * feat: add lock to middle messages * feat: add memory menu and default hidden * fix: lint error * fix: legacy secion order * chore: add test cases * chore: remove top zone * feat: custom sidebar reorder * chore: fix sidebar items |
||
|
|
73be58ba12
|
✨ feat: support message gateway (#13761)
* feat: support message gateway * feat: sync message gateway connections * chore: add cloudflare http v2 * fix: typing interval * feat: add connnectionMode to gateway * chore: add applicationId when connect * fix: judge typing supoort by triggerTyping implementation * fix: skip message gateway & start connnections * fix: qq platform hint * chore: skip webhook mode in gateway connection * fix: test case * fix: message gateway check * chore: add failaure case post * fix: test case * feat: add GatewayManager for webhook-mode platforms |
||
|
|
2c79b5ab78
|
🐛 fix: refine ProviderBizError classification for insufficient balance and quota limit (#13740)
* 🐛 fix: refine ProviderBizError classification for insufficient balance and quota limit errors Extract inline "Insufficient Balance" check into a dedicated `isInsufficientQuotaError` utility with case-insensitive matching and broader patterns. Add "too many tokens" pattern to `isQuotaLimitError` for Moonshot rate-limit messages. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * update * 🐛 fix: remove "account has been deactivated" from InsufficientQuota patterns Account deactivation can be triggered by policy, security, or account review — not just billing. Classifying it as InsufficientQuota misleads users into topping up balance when the fix is usually permission or support escalation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ✨ feat: add AccountDeactivated error type for deactivated/suspended accounts Separate account deactivation from InsufficientQuota so users get actionable guidance (contact support) instead of misleading billing advice. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
08769e5bf1
|
🐛 fix: layout recent locale and support dismiss banner (#13739)
* fix: CN locale for rencents * fix: community profile setup modal * feat: support skill banner dismiss |
||
|
|
48d0a759a8
|
🐛 fix(chat): refine workflow collapse headline (#13717)
* 🐛 fix(chat): refine workflow collapse headline * 🐛 fix(chat): use state machine for workflow headline * 🐛 fix(chat): backtrack workflow headline state * ♻️ refactor(chat): simplify workflow headline selector * 💄 style(chat): use lucide workflow collapse arrow * ♻️ refactor(chat): use accordion indicator layout * Move workflow duration text beside the title * Localize workflow tool display labels * Update Page workflow localization labels * fix: sort imports in toolDisplayNames.test.ts |
||
|
|
5d135b3ae1
|
🔨 fix: layout sidebar en More (#13723)
* fix: layout sidebar en More * chore: update i18n files |
||
|
|
17b3acead6
|
feat(subscription): add cross-platform subscription support for mobile IAP (#13413)
feat(subscription): add cross-platform subscription i18n and mobile subscription router - Add crossPlatform.title/desc/manageOnMobile translations for 18 languages - Register mobileSubscriptionRouter in mobile tRPC router - Add mobileSubscription business router placeholder Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
2c397390b4
|
✨ feat: layout sidebar impl (#13719)
* ♻️ Restructure sidebar layout: extract Lobe AI entry, move New Agent button - Extract Lobe AI (InboxItem) from agent list to standalone top entry in sidebar body - Move "New Agent" button from header to below Lobe AI entry - Add "Create" to bottom menu items alongside Community and Resources - Filter hidden items in BottomMenu component Fixes LOBE-6938 https://claude.ai/code/session_01RtfXck3GUngoLAgP2yHArz * ✨ Add unified Recents section to home page - New TRPC router `recent.getAll` aggregating topics, documents, files, and tasks - New client service and SWR-based store integration for recents data - Unified Recents component on home page with type-based icons - Items sorted by updatedAt, limited to 10, mixed across all types Fixes LOBE-6938 https://claude.ai/code/session_01RtfXck3GUngoLAgP2yHArz * ⚡ Prefetch agent config on hover for faster page loads - Add usePrefetchAgent hook using SWR mutate to warm cache - Trigger prefetch on mouseEnter for sidebar agent items - Reduces or eliminates loading screen when navigating to agent pages Fixes LOBE-6938 https://claude.ai/code/session_01RtfXck3GUngoLAgP2yHArz * ✨ Redesign agent homepage with info, recent topics, and tasks - New AgentHome feature replacing the old AgentWelcome component - Agent info section: avatar, name, description, opening questions - Recent Topics: horizontal scrollable cards for agent-specific topics - Tasks section: list with status labels for agent-assigned tasks - Preserve ToolAuthAlert for tool authorization flows Fixes LOBE-6938 https://claude.ai/code/session_01RtfXck3GUngoLAgP2yHArz * fix: common misstakes in layout * chore: add fetch Recents cache * chore: add back createagents * chore: add back lobe ai * feat: add display count * feat: add create agent button * feat: add sidebar section order * chore: move divider * ✨ feat: show current page size in display items submenu Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ✨ feat: add sidebar display management with customize sidebar modal - Add "Hide section" and "Customize sidebar" to Recents/Agents dropdown menus - Create CustomizeSidebarModal with eye toggle for section visibility - BottomMenu (Community/Resources) also manageable via modal - Show customize sidebar button in footer when all sections hidden - Add hiddenSidebarSections to store with localStorage persistence - Rename "Display Items" to "Show" in dropdown menus - Add 12px margin between accordion sections and bottom menu - Add i18n keys for en-US and zh-CN Fixes LOBE-6938 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 💄 style: use SlidersHorizontal icon for customize sidebar Replace Settings2/PanelLeft icon with SlidersHorizontal to avoid confusion with the settings gear icon. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 💄 style: refine sidebar customization UX - Move Settings entry from Footer to BottomMenu alongside Community/Resources - Add Settings to Customize sidebar modal with eye toggle - Allow hiding all sections (remove disabled constraint) - Move Customize sidebar button next to help button in Footer - Merge Agent dropdown: group Create items with Category items - Use SlidersHorizontal icon for Customize sidebar Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ✨ feat: add recents item actions and "more" drawer - Add inline rename (same as Agent Topic) and delete to Recents items - Topic/document/file support rename + delete, task supports delete only - Add "more" button when items exceed pageSize, opens AllRecentsDrawer - AllRecentsDrawer shows all cached recents from store (up to 50) - Fetch max(pageSize, 50) items to support drawer without extra request Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ✨ feat: add create agent/group modal with ChatInput and examples - Add CreateAgentModal using base-ui Modal with ChatInputProvider - Show suggestion examples (agent/group mode) in 2-column grid - Submit triggers sendAsAgent/sendAsGroup to auto-generate via Agent Builder - "Create Blank" button for skipping the prompt - Integrate modal into AgentModalProvider for shared state across sidebar - Wire up AddButton, NewAgentButton, and dropdown menus to open modal Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: optimitic update rename * chore: prefetch agent detail * feat: add recent topic meta data * feat: add recents search * ⚡ perf: optimize recents API with single UNION query and prefetch - Replace 3 separate DB queries with single UNION ALL query (RecentModel) - Add optimistic updates for rename and delete actions - Add hover prefetch for resources (usePrefetchResource) - Add hover prefetch for agent config on topic/task items - Change default pageSize to 5 for both Agents and Recents - Unify delete confirmation messages per item type Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: adjust settings page * chore: optimize side bar * feat: recents support right click * chore: add pin icon to Agents * chore: add custom side bar modal * chore: reserve rencent drawer status * feat: add prefetch route * feat: add LobeAI prefetch * fix: document and task rename and delete operation lost * fix: group route id * fix: lint error --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
c879629439
|
✨ feat: add prompt rewrite & translate feat (#13523) | ||
|
|
1ecf7d2be8
|
💄 style(image,video): extend more AIGC params support (#13597)
* 🐛 fix(image,video): preserve prompt and image when switching model * ✨ feat(image): smart imageUrl ↔ imageUrls conversion on model switch - When switching from multi-image to single-image model: use imageUrls[0] as imageUrl - When switching from single-image to multi-image model: wrap imageUrl into [imageUrl] as imageUrls - Preserves prompt and other compatible parameters - Add test cases for bidirectional conversion ♻️ refactor(image): simplify preserveImageInputParams logic - Remove intermediate variables for cleaner code readability - Condense 9 intermediate variables to 3 core ones - Inline condition checks for simpler if statements - Improve code clarity without changing functionality * 🐛 fix(image): preserve imageUrl when target imageUrls default is empty array * chore: format imageUrl & imageUrls * feat: support imageUrls for videoGen fix: fix ci error fix: fix ci error fix: fix + button fix: fix batch images display fix: fix muti images upload display fix: fix ci error style: add Seedance 2.0 support style: add Seedance 2.0 support fix: fix veo imageUrls logic * style: add watermark & prompt_extend & web_search support style: update minimax & seedream price style: fix fix ui error style: update z-image style: fix video ui style: fix seedance & seedream params style: fix seedance & seedream params style: fix seedance & seedream params fix ci error Update createImage.ts fix ci error fix ci error fix ci error fix ci error fix ci error fix ci error fix: fix optimize_prompt_options * fix rebase issue * fix: seedance 2.0 price missing * fix: apply some suggestions |
||
|
|
4787bed380
|
💄 style: Update agent onboarding style (#13678)
* 💄 style: Update onboarding * style: update * 💄 style: Update i18n * fix: test |
||
|
|
4f1d2d494f
|
✨ feat(conversation): assistant group workflow collapse and activate-tools inspector (#13696)
* refactor(workflow): rewrite WorkflowSummary with status dot and minimal flat style * refactor(workflow): rewrite WorkflowCollapse with unified borderless container * ✨ feat(workflow): add WorkflowExpandedList component and fix type errors * ♻️ refactor(workflow): add missing Workflow components with Minimal Flat design - WorkflowReasoningLine: cssVar tokens, aligned padding - WorkflowToolDetail: new expandable result panel with motion animation - WorkflowToolLine: expand chevron, getToolColor, detail panel integration - WorkflowExpandedList: flat rendering with reasoning + tool lines * Add tool call collapse support Made-with: Cursor * 💄 style(workflow): align WorkflowCollapse UI with @lobehub/ui design system - Align border-radius, gap, padding tokens across all Workflow components - Replace chevron expand/collapse with status icons (CheckCircle2, CircleX, Loader2) - Use @lobehub/ui Highlighter for tool detail panel with JSON auto-formatting - Use @lobehub/ui Flexbox for WorkflowExpandedList with proper gap and padding - Fix delete action to use removeToolFromMessage instead of deleteAssistantMessage - Wire debug button to existing Tool/Debug panel with full tabs - Fix auto-collapse to only trigger on incomplete→complete transition - Single ChevronDown with rotation for WorkflowSummary (match @lobehub/ui pattern) * 💄 style(workflow): use AccordionItem and inspectorTextStyles for WorkflowCollapse - Replace custom WorkflowSummary with @lobehub/ui AccordionItem - Use StatusIndicator pattern (Block outlined 24x24) for status icon - Apply inspectorTextStyles.root for title text (colorTextSecondary) - Remove WorkflowSummary.tsx (dead code) - Match Tool component AccordionItem usage (paddingBlock/Inline=4, borderless) * 💄 style(workflow): remove divider and gap from WorkflowExpandedList * 💄 style(workflow): align WorkflowCollapse title bar with Thinking component * 💄 style(workflow): unify inner item spacing, font size, and colors * ✨ feat(workflow): add streaming scroll behavior with max-height and auto-scroll * 💄 refactor(assistant-group): refine workflow collapse UI and duration - Use Accordion for collapse; align tool/reasoning lines with generation state - Show workflow header duration from summed block performance, not reasoning only Made-with: Cursor * ✨ feat(inspector): enhance ActivateToolsInspector to display not found tools count - Added localization for not found tools message in English, Chinese, and default locales. - Updated ActivateToolsInspector to show a tooltip with the count of tools not found. - Modified StatusIndicator to support a warning state for scenarios where no tools are activated but some are not found. Signed-off-by: Innei <tukon479@gmail.com> * 💄 style(workflow): simplify padding in WorkflowExpandedList component - Removed unnecessary paddingInline from Flexbox elements in WorkflowExpandedList for cleaner layout. Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat(assistant-group): introduce constants and utility functions for workflow management - Added constants for workflow timing, limits, and tool display names to enhance the assistant group's functionality. - Implemented utility functions for processing and scoring post-tool answers, improving the workflow's response handling. - Created new components for rendering content blocks and managing scroll behavior in the assistant group. Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat(assistant-group): enhance ContentBlock and Group components with content handling logic - Added logic to conditionally render message content based on content availability and tool presence in ContentBlock. - Introduced utility functions to determine substantive content and reasoning in Group, improving block partitioning for workflow management. - Updated partitioning logic to handle trailing reasoning candidates and streamline answer and working block separation. Signed-off-by: Innei <tukon479@gmail.com> * 🙈 chore(gitignore): clarify superpowers local paths Document that `.superpowers/` and `docs/superpowers/` are plugin/local outputs and must not be committed. Made-with: Cursor * 👷 chore(ci): restore auto-tag-release workflow from canary Revert unintended workflow edits so release tagging stays on main with sync-main-to-canary dispatch. Made-with: Cursor --------- Signed-off-by: Innei <tukon479@gmail.com> |
||
|
|
1eb1fca7f2
|
🌐 chore: update execServerAgentRuntime i18n copy (#13698)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
6d731dd116
|
✨ feat: add StreamLake Provider support (#13651)
* ✨ feat: add StreamLake (快手) support
* style: add thinking support
style: add thinking support
style: add thinking support
style: add thinking support
style: add thinking support
|
||
|
|
475622a4b9
|
✨ feat: support multi media and multiple connection mode (#13624)
* test: add feishu and qq test cases * feat: support qq websocket mode * feat: support slack websocket mode * feat: feishu/lark support websocket connectMode * chore: add default connection mode * fix: discord 401 sign error * fix: feishu websocket need verification token * fix: heartbeate interval * fix: get effective connnection mode * chore: extract getEffectiveConnectionMode utils * chore: merge with default settings * chore: add connectionMode fallback * fix: file extract error * fix: list platforms by connectionMode * fix: qq bot gateway * fix: support fileList * feat: support video list * chore: migrate local testing to references * chore: add bot skill * fix: telegram file serialize error * feat: extract file extract logic to platform client * fix: wechat file read * feat: skip no metion in thread and set default message mode to queue * chore: refact download resources * fix: feishu adapter mention and dm error * fix: feishu thread id * fix: slack remove action * fix: bot resovle files |
||
|
|
4d7cbfea8e
|
🐛 fix: skip sendMessageInServer in Gateway mode + NavItem loading fix + i18n (#13681)
* 🐛 fix: reuse existing messages in execAgent when existingMessageIds provided When existingMessageIds contains [userMsgId, assistantMsgId], skip creating new messages and reuse the existing ones. This fixes duplicate messages in Gateway mode where sendMessageInServer already created the messages before execAgentTask is called. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🐛 fix: allow clicking NavItem while loading Loading state should only show a visual indicator, not block onClick. This fixes topic sidebar items being unclickable during agent execution. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Revert "🐛 fix: reuse existing messages in execAgent when existingMessageIds provided" This reverts commit 43b808024d5c4a0074b692a85083a72046ab47e0. * 🐛 fix: skip sendMessageInServer in Gateway mode to avoid duplicate messages Gateway mode now calls execAgentTask directly instead of going through sendMessageInServer first. The backend creates user + assistant messages and topic in one call. executeGatewayAgent handles topic switching internally after receiving the server response. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🌐 chore: add i18n for execServerAgentRuntime operation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🐛 fix: move temp message cleanup after executeGatewayAgent succeeds Keep temp messages visible during the gateway call so the UI isn't blank. On failure, mark the operation as failed instead of silently returning — temp messages remain so the user sees something went wrong. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ♻️ refactor: remove manual temp message cleanup in gateway mode switchTopic handles new topic navigation, and fetchAndReplaceMessages replaces the message list from DB — no need to manually delete temp messages. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🐛 fix: clear _new key temp messages when gateway creates new topic Pass clearNewKey: true to switchTopic so temp messages from the optimistic create don't persist in the _new key after switching to the server-created topic. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ♻️ refactor: import ExecAgentResult from @lobechat/types Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
e65e2c3628
|
✨ feat(desktop): embed CLI in app and PATH install (#13669)
* ✨ feat(desktop): embed CLI in app and PATH install Made-with: Cursor * ✨ feat(desktop): add CLI command execution feature and UI integration - Implemented `runCliCommand` method in `ElectronSystemService` to execute CLI commands. - Added `CliTestSection` component for testing CLI commands within the app. - Updated `SystemCtr` to include CLI command execution functionality. - Enhanced `generateCliWrapper` to create short aliases for CLI commands. - Integrated CLI testing UI in the system tools settings page. Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat: enhance working directory handling for desktop - Updated working directory logic to prioritize topic-level settings over agent-level. - Introduced local storage management for agent working directories. - Modified tests to reflect changes in working directory behavior. - Added checks to ensure working directory retrieval is only performed on desktop environments. Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat(desktop): implement CLI command routing and cleanup - Introduced `CliCtr` for executing CLI commands, enhancing the desktop application with CLI capabilities. - Updated `ShellCommandCtr` to route specific commands to `CliCtr`, improving command handling. - Removed legacy CLI path installation methods from `SystemCtr` and related services. - Cleaned up localization files by removing obsolete entries related to CLI path installation. Signed-off-by: Innei <tukon479@gmail.com> * 🚸 settings(system-tools): show CLI embedded test only in dev mode Made-with: Cursor --------- Signed-off-by: Innei <tukon479@gmail.com> |
||
|
|
eebf9cb056
|
chore: add gatewayMode translations for labs (#13680)
* 🌐 i18n: add gatewayMode translations for labs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Update labs.json
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
||
|
|
6d0c8d710a
|
🐛 fix: video page icon collision, missing locale keys, and model query param (#13671) | ||
|
|
e10265fadd
|
✨ feat: add skill panel and fix skill icon (#13666)
* fix: custom agent skill icon * feat: support skill detail * chore: remove unnecessary custom tag |