Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/releases/v1.0.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# ACECode v1.0.0

- HTML / HTM 文件预览新增浏览器按钮,可直接在 ACECode 内置浏览器中打开本地页面;支持中文、空格等路径,保留未保存修改的保存/放弃/取消提示。
- 设置新增可搜索的快捷键页面,支持新建会话、切换历史、展开面板、聚焦输入、调整思考深度等常用操作。
- 消息通道使用本地平台图标,移除图标圆角背景,稳定卡片布局并调整管理与连接按钮顺序。
- 优化长会话上下文与提示词缓存:保持已发送前缀稳定,持久保存上下文快照与更新,改进压缩后的任务清单和会话恢复。
- 子代理未指定模型时继承父会话当前模型;兼容模型服务的缓存字段拒绝与压缩重试。
- 更新入口移至左侧栏底部,保留更新进度与重启提示。
- 虚拟办公室支持独立偏好与欢迎预览,修复欢迎页面和新手引导同时出现时的启动卡死。

升级安装完成后请重启 ACECode。Agent Browser 集成在 Desktop 中,无需独立浏览器宿主或扩展。
4 changes: 3 additions & 1 deletion docs/subagents.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ Multi-Agent V2,openspec `add-mesh-swarm-mode`)。
|---|---|
| `prompt`(必填) | 子会话的首条用户消息。以 `/` 开头时按子会话 cwd 走 `try_expand_skill_command`(与 Web 输入框同一套 skill 命令展开),原文存 `display_text` |
| `wait`(默认 true) | true:阻塞至子会话本轮结束,返回最终答复;false:点火即返,返回 `session_id`(流水线接力 / fan-out) |
| `model` | 可选 saved_models 名称;缺省用 daemon/TUI 默认模型 |
| `model` | 可选 saved_models 名称;缺省或空值继承父会话当前模型,显式值优先;无父模型状态时沿用配置默认值 |
| `timeout_seconds` | 可选等待上限;0/缺省 = 无限(父会话 abort 仍可打断) |

- `is_read_only = true`:spawn 本身自动放行不弹确认;子会话内部的危险操作由子会话自己的
PermissionManager 把关(权限模式继承父会话)。
- 子会话继承父会话的 cwd 与权限模式。父会话不在 registry(TUI 主会话)时,权限模式经
`SubagentToolDeps::fallback_permissions` 继承。
- 模型继承读取 `ToolContext::session_manager` 的当前 saved model,适用于 daemon、TUI 和
headless;父会话切换模型后,后续子会话使用新选择。专家成员绑定不改变模型选择优先级。
- **继承父会话的隔离**(fix-subagent-write-boundary):父会话在 worktree 里时,子会话共享
同一个 worktree —— `SessionOptions::inherited_worktree` 进子会话 meta
(`worktree_session.inherited=true`,resume 照常恢复),AgentLoop cwd 切进 worktree,而
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
schema: spec-driven
created: 2026-10-07
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## Context

App owns navigation and panels; ChatView owns input, cancellation and reasoning changes. Existing Ctrl+K and Ctrl+backquote listeners and xterm forwarding are separate. Browser-default guards prevent Ctrl+- before bubble listeners. ChannelsSettings already maps enabled channels to disconnect, but status, management and pending requests add conditional rows.

## Goals / Non-Goals

Keep each action's existing handler and lifetime owner. Share shortcut definitions between dispatch, help and terminal forwarding. No rebinding editor, backend protocol change, packaging or release.

## Decisions

1. A pure shortcut catalog defines exact modifiers, platform labels and scope; a shared hook handles IME, repeats, consumed events and overlay checks. App owns global actions; ChatView owns conversation actions. Replace the existing global listeners to prevent duplicate dispatch. The zoom guard still prevents native zoom for navigation keys, and marks those events with a shared symbol so the application handler can consume them. This also suppresses zoom when a dialog blocks navigation. Let xterm forward app shortcuts without sending them to the shell.
2. Defaults: Ctrl+Alt+N new session, Ctrl+Alt+I focus input, Ctrl+Alt+B project sidebar, Ctrl+Alt+E right panel, Ctrl+, settings, Ctrl+/ shortcuts, Ctrl+Shift+. stop; Ctrl+- forward and Ctrl+Shift+- back. macOS uses Cmd/Option except the existing Ctrl+backquote console key. Reasoning accepts Ctrl/Cmd+Alt+Period/Comma with or without Shift, covering both physical punctuation keys and literal >/<. No wrapping; order comes from canonical reasoning efforts and only supported levels participate. Effective default depth determines the initial step.
3. Scoped actions do not act behind dialogs, menus, question/permission controls, file editors or a side chat. Reasoning uses the existing async mutation and in-flight guard, including during busy turns. Navigation retains unsaved-file confirmation. New session uses the existing current-workspace action and prevents repeat creation.
4. Settings section follows existing navigation/search/i18n patterns, with the archived section's sticky offsets and opaque surface. The searchable catalog includes existing Enter, Shift+Enter, history, Escape, save, find, search and console shortcuts with scope explanations.
5. Channel cards keep a single stable header and description; management sits before a constant-width connection control. Status is an accessible dot; pending count is attached to management. Full status, recovery and approvals move into ManageDialog. No conditional rows on cards. Narrow layouts use one column.
6. Bundle upstream SVG brand assets locally and document version/source/license; use actual vector shapes with theme-safe rendering, no runtime CDN dependency.

## Risks / Trade-offs

- Browser shortcuts and punctuation layout differences → exact modifier matching, physical-key fallbacks, IME/AltGraph guards, browser regression coverage.
- Hidden/multiple ChatViews → bind conversation shortcuts only to the visible active main composer; do not leak to side chats.
- Reduced status text → accessible status titles and discoverable management details preserve recovery and approval operations.
- Existing channel change said generic monochrome chat icons → this user's explicit brand-icon request supersedes that choice.

## Migration Plan

Ship with the regular Web build; Desktop requires a later embedded bundle rebuild. No stored-data migration. Reverting this change restores the old UI and listeners.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## Why

常用操作缺少统一可查找的快捷键入口;消息通道卡片随配置、连接和待批准请求增高,操作位置不稳定且平台不易识别。

## What Changes

- 设置新增“快捷键”页签,按功能及按键搜索,搜索栏沿用已归档会话的吸顶布局。
- 实现已确认的七项默认快捷键,以及 Ctrl+- 前进、Ctrl+Shift+- 后退、Ctrl+Alt+> / < 增减当前会话思维深度。
- 保留现有快捷键,明确输入法、弹窗、编辑器及终端的事件优先级。
- 消息通道卡片保持稳定高度,管理位于连接按钮左侧;启用后可取消连接。状态和请求详情集中到管理对话框。
- 使用本地打包的现成平台 SVG 图标,记录来源。

## Capabilities

### New Capabilities
- `keyboard-shortcuts`: 设置内快捷键目录和受上下文约束的常用操作快捷键。
- `compact-message-channels`: 稳定尺寸的消息通道卡片、管理入口和品牌图标。

### Modified Capabilities

无。

## Impact

影响 Web/Desktop 共用的 App、ChatView、设置、通道卡片、快捷键工具、图标资源和本地化。复用现有导航、停止、模型控制和通道 API,不改变服务端协议。
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## Purpose

Provide recognizable message-channel cards whose actions remain in stable positions throughout setup, connection and approval changes while preserving access to operational details and recovery.

## ADDED Requirements

### Requirement: Stable channel cards
Cards SHALL show management immediately left of the connection action. An enabled channel SHALL offer 取消连接, including while connecting or retrying. Configuration, connection status and pending approvals SHALL NOT add rows or increase card height.

#### Scenario: State transitions
- **WHEN** a channel becomes configured, connects, fails or receives pending approval requests
- **THEN** its card keeps the same height and button positions at the same viewport, and status remains accessible

### Requirement: Management retains detail and recovery
Management SHALL expose status, connection recovery, bot configuration, pending approval decisions and access management. Existing close-button dialogs SHALL keep their backdrop dismissal policy.

#### Scenario: Approve from management
- **WHEN** a channel has a pending request
- **THEN** its management entry indicates pending work and the user can open it to approve or reject the request

### Requirement: Local platform identity
QQ, WeChat, Feishu, DingTalk, Telegram, Discord and LINE SHALL display recognizable locally bundled vendor icons in their cards and dialogs, across light and dark themes.

#### Scenario: Offline assets
- **WHEN** the settings page loads without access to a public asset CDN
- **THEN** all seven platform icons still render from the application bundle
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## Purpose

Make frequent ACECode Web and Desktop actions discoverable and executable through a searchable keyboard shortcut directory while protecting text composition and contextual controls.

## ADDED Requirements

### Requirement: Searchable shortcut settings
Settings SHALL expose a 快捷键 section containing both existing and new shortcuts, searchable by action, description and key combination. The search bar SHALL remain visible at the top of the settings content scroll area.

#### Scenario: Search while scrolling
- **WHEN** the user opens 快捷键, scrolls its list and searches for Ctrl or a function name
- **THEN** the opaque search bar stays at the top and the list filters to matching shortcuts

### Requirement: Common application actions
The application SHALL support Ctrl+Alt+N for a new current-workspace session, Ctrl+Alt+I to focus its input without changing draft text, Ctrl+Alt+B/E for left/right panels, Ctrl+, for settings, Ctrl+/ for shortcut settings, and Ctrl+Shift+. for stopping current work. Existing search, console, find and contextual editing shortcuts SHALL retain their behavior. macOS SHALL display and accept corresponding Cmd/Option bindings except the existing Ctrl+backquote console binding.

#### Scenario: Navigation history
- **WHEN** the user presses Ctrl+- or Ctrl+Shift+-
- **THEN** ACECode goes forward or back respectively through its navigation history, retains unsaved-file protections and does not zoom

#### Scenario: Protected input contexts
- **WHEN** IME composition, a modal, a menu or a focused secondary editor owns input
- **THEN** unrelated application actions do not run behind it, and one keypress never executes an action twice

#### Scenario: New conversation and stop
- **WHEN** the user requests a new session or stops a running session by keyboard
- **THEN** the corresponding existing action runs once in the active workspace/session and preserves drafts and cancellation behavior

### Requirement: Incremental reasoning depth
Ctrl+Alt+> SHALL increase and Ctrl+Alt+< SHALL decrease the active conversation's supported reasoning depth. The physical Period/Comma keys with or without Shift SHALL be accepted. The effective default SHALL be respected, unsupported levels skipped, bounds clamped and in-flight changes guarded.

#### Scenario: Running conversation
- **WHEN** a running conversation changes depth using the keyboard
- **THEN** its displayed selection updates via the existing reasoning control, future requests use the new depth, and the current request continues

#### Scenario: Boundary or unsupported model
- **WHEN** the user tries to move beyond an extreme or a model has no reasoning selector
- **THEN** no wraparound or unsupported update is sent
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## 1. Keyboard actions

- [x] 1.1 Add shared shortcut catalog, matching/context guards and reasoning stepping; verify pure tests cover modifiers, IME, platform labels, bounds and default depth.
- [x] 1.2 Wire App and active conversation handlers, terminal forwarding and shortcut hints; verify real keypresses trigger existing actions once and preserve navigation guards.
- [x] 1.3 Add searchable shortcut settings with sticky search and localized copy; verify search, settings discovery and scroll behavior.

## 2. Message channels

- [x] 2.1 Bundle all seven upstream platform icons and source records; verify assets render in cards/dialogs and production build.
- [x] 2.2 Stabilize card layout, move management before connection and retain approvals/recovery in management; verify state transitions preserve card height and existing operations.

## 3. Integration validation

- [x] 3.1 Run focused and full Web tests, i18n generation, build, strict OpenSpec validation and diff checks; record results.
- [x] 3.2 Run browser checks across desktop/narrow, light/dark and keyboard/overlay/IME contexts; record evidence and separate Web proof from installed Desktop verification.

## Validation evidence (2026-10-07)

- Focused Node tests: appShortcuts, channelsSettings, settingsNavigation and browserDefaults passed.
- `pnpm i18n:catalog`, final `pnpm test`, final `pnpm build`, strict OpenSpec validation and `git diff --check` passed. Build compatibility scan checked 4518 regex literals with no lookbehind.
- `node scripts/test-busy-reasoning.mjs` passed existing busy-update, failure rollback, late response and default restoration scenarios.
- `node scripts/test-shortcuts-and-channels.mjs` passed nine browser groups using actual App/Settings/ChatView and isolated daemon/WebSocket fixtures: search/sticky/focus, create/history/drafts, panels, reasoning/IME/menus, busy/stop, xterm forwarding, channel state/approval/connect controls, narrow English search and four viewport/theme combinations.
- Final screenshots and browser results: `C:/Users/shao/AppData/Local/Temp/ace-shortcuts-channels-27LTYw/`. Full logs: `%TEMP%/ace-shortcuts-web-tests-final.log` and `%TEMP%/ace-shortcuts-web-build-final.log`.
- Browser executables reused through `ACE_PLAYWRIGHT_MODULE` and `ACE_CHROMIUM_EXECUTABLE`; no daemon, real credentials or vendor messages were used.
- First visual pass found narrow card titles collapsing and low-contrast monochrome Feishu artwork; fixed both and confirmed in the final pass. Impeccable detector returned no findings.
- Concurrent update-button relocation changes in App/TopBar/Sidebar and unrelated style/modal-test edits were preserved. This change has not been committed, published or packaged into the installed Desktop; native Windows/macOS accelerator integration remains outside the Web proof.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
schema: spec-driven
created: 2026-08-11
68 changes: 68 additions & 0 deletions openspec/changes/make-updates-cancellable-with-progress/design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
## 背景

当前 Web/Desktop 共用的升级入口通过 `/api/update/start` 创建后台任务,前端通用请求层默认在 30 秒后中止请求,升级核心又把 `upgrade.timeout_ms` 同时用于清单和安装包下载。更新任务仅能轮询,后端没有取消信号,前端关闭对话框也只会隐藏任务。顶部入口始终使用完整主色背景,无法表达进行中的百分比。

升级跨越网络下载、校验、解压和安装替换。下载前中止是安全的;一旦进入安装替换,强行中断可能留下不完整安装,因此取消能力必须有明确边界。

## 目标 / 非目标

**目标:**

- 升级过程不再因为固定 30 秒总时限被误判为失败。
- 用户可以取消尚未进入安装替换的图形界面升级任务。
- 取消状态可轮询、可恢复展示,且不会触发重启。
- 顶部按钮保持现有尺寸和轮廓,以填充比例和正确的双色文字表达进度。

**非目标:**

- 不允许在已经开始替换安装文件后强制终止。
- 不改变命令行升级的交互方式,也不新增外部依赖。
- 不改变更新清单格式、包校验和回滚机制。

## 技术决策

### 1. 升级网络请求使用无限总时限

升级清单与安装包请求不再传入固定总时限;连接断开、HTTP 错误、写盘错误仍按原逻辑失败。前端启动升级的请求显式使用无超时模式,避免通用 30 秒默认值中止它。

保留现有配置字段的兼容读取,避免旧配置失效;该字段不再限制自升级下载,仍可供当前共用的反馈上传逻辑使用。

### 2. 使用协作式取消,不杀死升级线程

升级核心接收一个线程安全的取消检查回调。下载写入回调在收到取消请求后返回失败以中止传输;校验、解压及安装前的阶段边界也检查取消状态。取消使用专用退出码与结果标志,避免把用户操作显示成普通故障。

不采用强制终止线程,因为它可能打断文件写入、资源清理或安装事务。

### 3. 安装开始后关闭取消窗口

任务状态增加 `cancel_requested` 与派生的 `can_cancel`。`POST /api/update/jobs/:id/cancel` 只对当前活动任务生效:安全阶段返回 202 并设置取消标志;进入 `installing` 后返回 409。升级核心在发布 `installing` 之前执行最后一次取消检查,从而保证前后端边界一致。

取消成功后任务进入终态 `cancelled`,清理未使用的下载与暂存目录,`restart_required` 保持为 `false`。重复取消已经取消的同一任务按幂等成功处理。

### 4. 顶部进度按钮使用同位双色裁切层

按钮外壳继续使用现有高度、最小宽度、水平内边距与圆角。进行中状态渲染三个完全重合的层:未填充底层显示主色文字;主色背景按百分比从左向右裁切;白色文字副本使用同一裁切范围。这样每个字形落在主色背景上的部分为白色,落在透明背景上的部分为主色,并且按钮在任意百分比下都保持可读。

进度值沿用现有全生命周期映射并限制在 0 到 100;按钮提供包含百分比的无障碍标签。

### 5. 2026-10-07 更新入口迁移到侧边栏底部

用户截图指定的底栏位置覆盖前述顶部位置约定。App 将现有更新状态和打开弹框回调传给 Sidebar,按钮位于底部设置菜单与问题反馈按钮之间,紧邻反馈按钮左侧并靠右排列。TopBar 移除更新属性与渲染;原有 24px 高度改用按钮自身的 `h-6`,避免依赖顶部栏局部 CSS 变量和顶部偏移。

保留新版可用时才显示、启动时禁用、更新中进度填充、已更新标签和点击打开更新弹框的行为。侧栏折叠时隐藏该入口,重新展开后展示当前状态;设置菜单检查更新、后端任务、下载、取消与重启流程不变。

## 风险 / 权衡

- [服务端长时间无响应且用户尚未取得任务编号] → 启动 API 仍先做可用性确认;前端不再误报超时,实际下载开始后可随时取消。后续如需取消清单探测,可再把预检完全移入任务线程。
- [取消与安装开始同时发生竞态] → 后端在同一任务锁下判断阶段并写入取消标志,升级线程在进入安装前执行最后检查;进入安装后统一拒绝取消。
- [底层 HTTP 库把主动中止报告为网络错误] → 下载结果单独记录 `cancelled`,升级核心优先映射为用户取消。
- [短暂阶段进度跳变] → 继续使用现有单调进度映射,顶部和对话框读取同一结果。

## 迁移方案

本次无需数据迁移。旧配置中的 `upgrade.timeout_ms` 继续可读取,不影响启动;新前端会使用新增取消接口与状态字段。回滚时旧前端会忽略新增 JSON 字段,旧后端则不会收到新前端版本。

## 待确认事项

无。

Loading
Loading