Skip to content

feat(desktop): add a floating UI assistant / 新增悬浮界面助手 - #4979

Draft
M4n5ter wants to merge 6 commits into
apache:mainfrom
M4n5ter:feat/desktop-assistant
Draft

feat(desktop): add a floating UI assistant / 新增悬浮界面助手#4979
M4n5ter wants to merge 6 commits into
apache:mainfrom
M4n5ter:feat/desktop-assistant

Conversation

@M4n5ter

@M4n5ter M4n5ter commented Sep 7, 2026

Copy link
Copy Markdown
Member
English

Summary

Add a floating Maka assistant with its own model selection and conversation. Cmd/Ctrl+Shift+K toggles the panel; hiding it keeps the task running and completion does not reopen it.

  • Operate visible application controls across tasks, extensions, automations and settings: click, hover, type, keys and scroll, plus direct routes for common settings. Requested actions run without an extra assistant approval layer, including existing application confirmation dialogs.
  • Use a small, rounded arrow in Maka's accent color, with a light outline, soft shadow and direction that follows its curved movement. One cursor stays at its last position between steps and disappears when the task ends or is interrupted. Reduced motion is respected.
  • Keep the assistant fixed above its cursor. Native assistant input passes through its own panel and launcher to application controls underneath, without moving the panel.
  • Batch up to eight consecutive actions when their targets are already known, and prefer one batch for known settings. Every target is revalidated before input; a failed action stops the remaining batch and reports completed steps for recovery.
  • Recover from stale or covered controls using a fresh observation, with at most three consecutive action failures. Track dispatched input to avoid blindly repeating sends or deletes; bounded observation waits support asynchronous task creation and replies. User stop cancels waiting and recovery.
  • Bind every generic action to a current accessibility observation and actual DOM node. Recheck identity, availability and the hit point before native input; reveal hover-only controls before clicking. Generic dispatch is followed by observation, while language, theme and display-name changes verify saved values and support guarded undo.
  • Keep control inside the bound Maka window. Terminal, embedded browser, external browser links and secret inputs are excluded. Bundled OpenCLI supplies accessibility observations with optional cropped preference images; no extra installation is needed.
  • Persist the assistant's model choice per Host and clean up owned history after seven idle days when its Host is connected. Floating messages last for the app process; local assistant Sessions use the default workspace.
  • Fix a first-send race exposed by the demo: locally created tasks from feat(session): add durable local delivery and isolated terminal streams #4956 could start transcript, Plan, shell-run and context reads before Host creation. Gate these reads on the Host-backed catalog row while retaining the local task view and message delivery.

Verification

  • Root build, typecheck, lint, format, Desktop/UI knip, renderer architecture checks against main, and 106 related tests pass.
  • Batch tests cover stopping at a changed control, reporting partial completion, and resuming without replaying completed steps. The short recording verifies both requested preferences run in one batch.
  • Real Electron checks cover extension search, task draft entry and sending, task deletion through its hover menu and application dialog, settings changes and undo, user interruption, and background completion while hidden.
  • A three-step extension/search/automation run had zero cursor gaps between actions and remained hidden after completion.
  • First-send regression check received READY_OK without new read/subscription errors; the complete demo also produced no new errors. Hiding and reopening during native text entry, including separate modifier key presses, did not interrupt the task.
  • Protocol epoch increases to 125; update Desktop and Host together. Remote Hosts and Windows/Linux input remain untested. This provides application control primitives; every individual screen and workflow has not been tested.

Demo

Feature walkthrough (1 min 39 sec)

Fresh conversation, real time: create and send a task, receive its reply, rename and pin it, search installed skills, visit automations, and change the theme and display name. The assistant works while hidden and reports completion when reopened.

assistant-medium-demo.mp4

Short demo (22.5 seconds)

Fresh assistant conversation, real time: one request changes the theme and display name in a single batch. Hide during typing, then reopen after completion.

assistant-short-demo.mp4

Full demo (3 min 47 sec)

3 min 47 sec, real time. One model-driven request creates a task and sends a message, waits for its reply, renames and pins the task, searches and views the installed agent-browser skill, opens automations, changes the theme and display name, then returns to the pinned task and reports the result. The assistant stays hidden while working; the normal task list remains visible.

assistant-complex-demo.mp4

AI use

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Codex implemented and validated the change; GPT-5.6 Luna and DeepSeek ran assistant scenarios.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No
中文

变更说明

新增拥有独立模型选择和对话的悬浮 Maka 助手。⌘⇧K / Ctrl+Shift+K 切换展开与收起;收起后任务继续运行,完成时不会自动弹开。

  • 支持任务、扩展、定时任务及设置等应用内可见控件:点击、悬停、输入、按键和滚动,常用设置保留直接导航路径。按用户指令直接执行,包括处理应用原有确认弹窗,不增加助手审批层。
  • 使用 Maka 强调色的小圆角箭头,浅色描边、柔和阴影,朝向跟随弧线运动。步骤之间停在上一个位置,结束或中断时才消失;支持减少动态效果设置。
  • 助手浮层固定在箭头上方;原生操作穿过助手面板及入口,命中下方应用控件,浮层不自动挪位。
  • 已知目标的连续操作可一次提交,最多八步;常用设置优先合并为一个批次。每步输入前重新验证目标,失败立即停止后续步骤,并返回已完成部分供恢复。
  • 控件失效或被遮挡时,重新观察后恢复,最多容许三次连续操作失败。记录是否已发出输入,避免盲目重复发送或删除;支持有上限的等待观察,处理任务创建和回复。用户停止会取消等待及恢复。
  • 通用操作绑定最新无障碍观察中的真实 DOM 节点,原生输入前复核身份、可用性和落点;先悬停显露隐藏按钮,再点击。操作后观察结果;语言、主题和称呼额外验证保存状态,并提供受保护的撤销。
  • 操作限定在绑定的 Maka 窗口,排除终端、内置浏览器、外部浏览器链接和密钥输入框。使用内置 OpenCLI 读取无障碍信息,可选设置控件局部截图,无需额外安装。
  • 按 Host 记住模型;闲置七天的助手历史在 Host 连接时自动清理。浮层消息保留至应用退出,本地助手会话使用默认工作区。
  • 修复演示暴露的首次发送竞态:feat(session): add durable local delivery and isolated terminal streams #4956 的本地新任务在 Host 创建完成前,可能提前读取对话、Plan、Shell 及上下文信息。现在统一等待 Host 会话目录就绪,同时保留本地任务显示与消息投递。

验证

  • 根目录构建、类型检查、lint、格式、Desktop/UI knip、相对 main 的渲染架构检查及 106 项相关测试通过。
  • 批量测试覆盖目标变化时中止、返回部分完成结果,以及恢复时不重放已完成步骤;短版实录确认两项设置在同一批次执行。
  • 真实 Electron 实测覆盖扩展搜索、任务草稿输入和发送、悬停菜单及原有弹窗删除测试任务、设置修改及撤销、用户接管、收起后的后台完成。
  • 扩展→搜索→定时任务的三步操作中,箭头没有消失或重新起步,完成后保持收起。
  • 首次发送回归验证收到 READY_OK,没有新增读取或订阅错误;完整演示也没有新增错误。原生输入期间收起和展开,包括单独按下修饰键,都未中断任务。
  • 协议 epoch 升至 125,Desktop 与 Host 需一起更新;远程 Host 和 Windows/Linux 输入尚未实测。此次提供应用级操作能力,尚未逐一验证所有页面和流程。

操作视频

中长版(1 分 39 秒)

从空白助手对话开始,原速展示新建并发送任务、收到回复、重命名置顶、搜索已安装技能、查看定时任务,以及修改主题与称呼。执行期间收起助手,完成后重新展开查看结果。

assistant-medium-demo.mp4

短版(22.5 秒)

从空白助手对话开始,原速录制:一句指令在同一批次切换主题、修改称呼,输入中收起,完成后重新展开。

assistant-short-demo.mp4

完整版(3 分 47 秒)

3 分 47 秒,原速录制。一条真实模型指令完成:新建并发送任务、等待回复、重命名并置顶、搜索和查看已安装的 agent-browser 技能、打开定时任务、修改主题与称呼,最后返回置顶任务汇报。执行期间收起助手,正常显示任务列表。

assistant-complex-demo.mp4

AI 使用说明

生成式工具参与:是。Codex 实现并验证本变更;GPT-5.6 Luna 和 DeepSeek 执行助手操作场景。

检查清单

测试覆盖变更,本地 lint、格式、类型检查和相关测试通过。本 PR 改变产品行为,详见变更说明。

@github-actions github-actions Bot added the effort/XXL Over 2500 readable lines label Sep 7, 2026
@M4n5ter
M4n5ter changed the base branch from main to stack/4956-session-experience-foundation September 7, 2026 10:49
@M4n5ter
M4n5ter force-pushed the feat/desktop-assistant branch from 38e10ea to 16cd57b Compare September 7, 2026 12:25
@M4n5ter M4n5ter changed the title feat(desktop): add a floating assistant with visible UI control feat(desktop): add a floating UI assistant / 新增悬浮界面助手 Sep 7, 2026
@M4n5ter
M4n5ter changed the base branch from stack/4956-session-experience-foundation to main September 7, 2026 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/XXL Over 2500 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant