Commit Graph

37 Commits

Author SHA1 Message Date
lee
8062658e29 fix(acp): dedupe slash command results [T-04-25-fix-slash-command-search] 2026-04-25 16:40:13 +08:00
xintaofei
10922dd71a fix(acp): reconnect agent when folder selector switches working directory 2026-04-22 12:38:31 +08:00
xintaofei
5dd1deb986 fix(transport): replace Tauri listen() to avoid unlisten race crashing on WKWebView
Call plugin:event|listen/unlisten directly and guard the client-side listener
registry cleanup, so unsubscribe always reaches the backend even when the
registration eval has not yet populated window.__TAURI_EVENT_LISTENERS__.
Prevents the intermittent `listeners[eventId].handlerId` TypeError and the
resulting leaked listener.
2026-04-22 11:25:38 +08:00
xintaofei
d9323d7399 refactor(workspace): migrate from per-folder windows to single-window workspace
Replace the legacy folder + welcome routes with a unified /workspace route
that hosts all folders, conversations, tabs, and terminals in one window.

- Persist opened tabs to the database (opened_tabs entity + migration)
  so tab layout survives restarts and deep-link bootstrap restores state
- Replace FolderContext shim with AppWorkspaceProvider, ActiveFolderProvider,
  and TabProvider; expose both opened (folders) and full DB (allFolders)
  listings via list_all_folder_details
- Return conversations across all non-deleted folders from list_all when
  no folder filter is given, so the sidebar can show every folder's history
- Add ConversationContextBar above the chat input with folder picker
  (auto-opens unopened folders on select), branch picker, and commit /
  push / merge / stash entries to restore BranchDropdown functionality
- Rework sidebar with stats header, search, flat / folder-grouped view
  modes (localStorage-persisted), reveal-in-sidebar event subscriber,
  and per-folder context menu (focus, close tabs, remove from workspace);
  indent conversations under folder headers in grouped mode
- Gate terminal creation on active folder and show folder context
- Remove deprecated BranchDropdown, FolderNameDropdown, welcome route,
  and per-folder window commands
- Localize all new strings across 10 locales
2026-04-20 21:22:36 +08:00
xintaofei
7a92f3eef7 fix(acp): clear Claude API retry banner when streaming content resumes 2026-04-17 14:27:39 +08:00
xintaofei
834340e536 feat(acp): forward meta/locations fields and use parentToolUseId for precise Agent child grouping
Forward the previously-dropped `locations` and `meta` fields from ACP
SDK ToolCall/ToolCallUpdate events through to the frontend. The meta
field carries `claudeCode.parentToolUseId` which enables precise
parent-child matching for concurrent Agent tool calls during streaming.

- Forward locations/meta in Rust AcpEvent types and connection handlers
- Use parentToolUseId for exact agent→child mapping, with position-based
  fallback for agents that don't provide it (Codex, OpenCode)
- Replace `any` types with proper ToolCallMeta / unknown types
- Add runtime guards for meta field parsing (defensive against
  unexpected shapes from different agents)
- Cache inferLiveToolName results per tool_call_id to avoid redundant
  computation across Phase 1 and Phase 2
- Lazy-construct agentStats only when children exist
2026-04-17 08:24:12 +08:00
xintaofei
7808a5f0d0 feat(acp): notify when permission approval is requested
Send a system notification when an agent triggers a permission request while the app window is not visible.
2026-04-14 15:31:12 +08:00
xintaofei
f9923df1fe feat(acp): surface Claude API retry state in chat input
Enable raw Claude SDK forwarding for ACP sessions and emit only system/api_retry events to the frontend.

Show a localized single-line retry banner with loading under the conversation input, including error details and retry progress.
2026-04-14 14:59:32 +08:00
xintaofei
96acd6039d perf(frontend): optimize ACP tool call output handling to reduce CPU and memory pressure
Replace raw_output single-string accumulation with a chunks array to
eliminate O(n^2) string concatenation on every 200ms terminal poll event.
Batch tool_call_update dispatches via requestAnimationFrame so multiple
agents no longer trigger 25+ React re-renders per second.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 22:05:26 +08:00
xintaofei
1c1738298b fix(acp): harden session-page connection and localize backend errors
- Session-page connect never triggers download/install; returns
  SdkNotInstalled immediately and prompts the user to install from
  Agent Settings instead
- Binary agents now accept any cached version via
  find_best_cached_binary_for_agent so stale caches still connect
- Bound Initialize handshake with a 60s timeout and convert it to
  AcpError::InitializeTimeout via a sentinel in run_connection
- Spawn background task owns ConnectionManager map insertion and
  removes the entry on exit through an RAII guard that survives
  panics, preventing leaked stale entries
- AcpError gains SdkNotInstalled and InitializeTimeout variants plus
  a stable code() identifier; AcpEvent::Error carries code so the
  frontend can render localized messages by key
- Frontend preflight now runs for all connect sources; error event
  handler switches on code to show translated text for
  initialize_timeout, sdk_not_installed, platform_not_supported,
  process_exited, spawn_failed and download_failed
- Remove ConnectionStatus::Downloading enum variant, all frontend
  branches, and i18n strings; drop obsolete autoLinkFailedTitle,
  autoLinkPreflightFailed, preflightCheckFailedDefault and
  preflightFailedTitle keys across 10 locales
- Add backendErrors.* translations in 10 languages
- Diagnostic logging: always log agent stderr plus binary
  path/size/args/env keys and Initialize timing; gate stdin/stdout
  JSON-RPC tracing behind CODEG_ACP_DEBUG to avoid persisting user
  content into OS log files

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 03:36:08 +08:00
xintaofei
4f051715bf folder窗口异常处理 2026-03-31 16:31:14 +08:00
xintaofei
25a2bd0922 Agent在实时响应中因为错误而中断时发送系统通知 2026-03-31 15:43:00 +08:00
xintaofei
aa799760fc 修复会话页面缓存的模式和模型没有实际生效 2026-03-29 00:15:55 +08:00
xintaofei
10725df8ab 现在会话输入框会记住用户的配置选项和模型选择,避免每次都要重新勾选 2026-03-27 22:19:07 +08:00
xintaofei
d1eaa8f725 重构会话agent连接、初始化、加载配置流程 2026-03-26 19:55:28 +08:00
xintaofei
218055ab01 完善folder页面的web接口实现 2026-03-25 15:27:43 +08:00
xintaofei
ac09d3db9e 初始化web服务功能 2026-03-25 14:26:26 +08:00
xintaofei
ad49d9e9ec 修复进行中会话有时无法被取消 2026-03-22 23:20:01 +08:00
xintaofei
58ddcb818b 修复会话有时无法关闭 2026-03-22 23:00:34 +08:00
xintaofei
046289748b 之前是会话tab激活的会话不被空闲回收,现在改为会话tab所有的会话都不被空闲回收 2026-03-22 21:45:45 +08:00
xintaofei
06ac2be0b1 修复新会话可能泄漏问题 2026-03-22 21:25:55 +08:00
xintaofei
048b8a8480 修复警告和错误 2026-03-21 19:29:29 +08:00
xintaofei
d0655066b6 发送系统通知时携带folder名 2026-03-21 19:14:38 +08:00
xintaofei
a9e0a742ac 集成系统通知,并在Agent响应完成后发出通知 2026-03-21 18:39:28 +08:00
xintaofei
acbdabe9e4 优化Agent Connect时的agent状态获取 2026-03-17 23:24:07 +08:00
xintaofei
ef3978a4fa 去掉agent连接时的预检步骤,正常情况下都会通过,做了无畏的工作,如果异常则连接时弹出通知和告警 2026-03-17 22:31:27 +08:00
xintaofei
35f5e16c11 提前检测Agent是否支持fork会话,避免无效展示和操作 2026-03-17 16:03:08 +08:00
xintaofei
0c843ec14e 优化上下文事件更新的处理逻辑 2026-03-13 22:07:29 +08:00
xintaofei
bf14a99168 支持更多的权限请求格式 2026-03-13 13:12:16 +08:00
xintaofei
79a22c8a03 初步支持AskUserQuestion交互 2026-03-11 19:43:24 +08:00
xintaofei
91636ada7f 重构会话消息处理和显示逻辑 2026-03-10 19:32:44 +08:00
xintaofei
2b4f00484d 支持部分agent实时更新上下文用量信息 2026-03-08 23:48:47 +08:00
xintaofei
c1220e1a8f 优化事件处理 2026-03-08 17:08:31 +08:00
xintaofei
7a4cbcb73e 支持在会话输入框直接进行文件/图片的拖拽和粘贴 2026-03-08 10:54:06 +08:00
xintaofei
6e5219cc10 继续多语言处理 2026-03-07 15:49:00 +08:00
xintaofei
931f69c421 继续会话去多语言处理 2026-03-07 14:52:09 +08:00
xggz
54d1097b41 Initial commit 2026-03-06 22:56:13 +08:00