Repository navigation
feat(room): overhaul multi-agent Room architecture, AX tools, and workbench UX - #7127
Merged
Merged
Conversation
…rhaul # Conflicts: # plugins/agent/native/src/owner/session_tools.rs
… races, layout, and motion
…eathing unmount, and prose context-menu/double-click split
…on initial roomState error
…ewer, latest, and focusMessage
…sage, and saveTopic
M4n5ter
added a commit
that referenced
this pull request
Nov 22, 2026
#7127 merged onto rust-preview right before #7152, adding plugins/agent/state/migrations/0052_room_overhaul.sql without the new Migration::data field or migrations.lock.json entry introduced in #7152. - Initialize data: None on migration 52 in plugins/agent/state/src/lib.rs. - Seal 0052_room_overhaul.sql into scripts/rust/migrations.lock.json. Generated-by: Maka (Gemini)
M4n5ter
added a commit
that referenced
this pull request
Nov 22, 2026
#7127 merged onto rust-preview right before #7152, adding plugins/agent/state/migrations/0052_room_overhaul.sql without the new Migration::data field or migrations.lock.json entry introduced in #7152. - Initialize data: None on migration 52 in plugins/agent/state/src/lib.rs. - Seal 0052_room_overhaul.sql into scripts/rust/migrations.lock.json. Generated-by: Maka (Gemini)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
English
Summary
End-to-end multi-agent Room implementation across SQLite storage, Host dispatch and Agent tools, and the Workbench desktop UI.
Storage & Delivery State
0052_room_overhaul.sql,plugins/agent/state/src/room.rs):topic, per-roomrevision,agent_room_members(explicit batch add/remove plus automatic enrollment on post and mention),agent_room_reactions(insertion-ordered),agent_room_pins, messageedited_at/deleted_at(soft delete preservingreply_toforeign keys), andagent_room_search_docs+ FTS5 trigram indexagent_room_searchkeyed by integerrowid(with substring query support for 1–2 character CJK terms).RoomPosition::Aroundpaging and batchparticipantsresolution (deleted sessions resolve withunavailable: true).delivery_states(queued,working,waiting,replied,reacted,silent,failed,stopped,rejected) directly fromagent_queue_items,agent_catalog_runs,agent_interaction_pending,agent_room_reactions, and explicitreply_toreplies.watch_roomto a per-room 53-bit fingerprint covering that Room'srevisionand its members' live, blocked, pending, terminal, title, and archive state.Host Dispatch & Agent Tools
plugins/agent/native/src/owner/rooms.rs,plugins/agent/native/src/owner/session_tools.rs,plugins/agent/facts/src/input/references.rs,plugins/workspace/workspace-files/native/src/lib.rs):<room_context>envelope to mentioned Agents (Room title, workspace, topic, co-mentions, roster with(you), top 5 pinned messages, and the 6 most recent posts with readable author names and attachment URIs) while keeping private chat display text concise.[@Name](maka://session/<id>)mentions from plain[Name](maka://session/<id>)session links so only explicit@mentions wake Agents; enforces self-mention rejection,SessionSendtool-allowlist pre-flight checks, and a 6-hop Agent-to-Agent circuit breaker reset on human input.Steeras the default Room delivery mode (with optionalQueuemode), atomically refreshing target queue and run state inside theRoomPosttransaction and falling back toFollowupif the target run completes concurrently.roomState,roomSearch,roomManageRPCs,SessionRead(searchQuery,around,roomoverview),Read("maka://session/<room>"), cross-session attachment forwarding viamaka://session/<id>/attachments/<attachment_id>, andSessionManageRoom actions (room_topic,room_members,room_react,room_pin,room_edit,room_delete). Human users retain edit and retract control over Room messages.Workbench UI, Reactions & Motion
RoomWorkspace.tsx,RoomPanels.tsx,RoomMessageRow.tsx,RoomComposer.tsx,RoomView.tsx):<Popover>panels for Pins and full-text Search, and a⋯room menu.C.cardbubbles without redundant self-avatar/nametag; Agent posts left-aligned with avatar, name, and full-width Markdown; 5-minute same-author grouping with hover timestamps.[@Title](maka://session/<id>)mentions, waiting-agent approval pill above the composer, actionable-only per-message delivery chips (waiting,failed,rejected), and a<ShimmerText>working footer.RoomReactions.tsx,roomMotion.ts):nsh/base<EmojiPicker>popover with 8-column grid, category jump bar, skin-tone switcher,Storage-persisted recents, and Chinese search annotations.<HoverCard>reactor roster with click-to-inspect Agent split, and an ephemeral UI-thread<Canvas>ring-and-spark burst on toggle-on.!reduceMotion() && platform.idiom !== 'terminal': live incoming message rise, breathing active/waiting indicators, spring pill bounce/tilt, 150ms popup transitions, and 1.65s breathing jump highlight.Screenshots
Dual-voice Room timeline with Telegram-style reactions & native
<EmojiPicker>popoverLive Agent side-pane split alongside Room
Source Room opened beside an Agent conversation
Local Database Migration (Existing Pre-PR
runtime-rust.sqlite)Migration
0052_room_overhaul.sqlcontains schema DDL only, with no runtime compatibility branches or in-migration data backfills. For existing local databases containing Rooms created prior to this PR, run the standalone Python migration script (targets untouchedrevision = 0rooms with an empty roster, plus idempotent FTS5 backfill; pass--fts-onlyto re-index FTS independently) after Maka applies migration 0052 once (stops safely if schema 0052 is not present, creates a timestamped backup by default, and checks foreign keys before committing):python3 migrate_room_overhaul.py [~/.maka/runtime-rust.sqlite] [--dry-run] [--no-backup] [--fts-only]Verification
cargo test --locked -p maka-agent-facts(42/42 passed)cargo test --locked -p maka-agent-state --lib store::removal::tests(4/4 passed)cargo test --locked -p maka-agent-state --lib migration_tests(1/1 passed)cargo test --locked -p maka-agent-state --lib room::tests(3/3 passed)cargo test --locked -p maka-agent-native --lib preset_acceptance::rooms(4/4 passed)node --test products/maka/workbench/tests/room-message.test.mjs(6/6 passed)node scripts/ci.mjs run contracts(passed)cargo test --locked -p maka-cli --no-default-features --features desktop-tests --test native-desktop -- room(3/3 passed)cargo clippy(-D warnings),rustfmt --edition 2024 --check,biome format, andnode scripts/ci.mjs check licensespassed简体中文
概要
端到端实现 Maka 的多 Agent Room 协作能力,覆盖 SQLite 状态存储、Host 调度与 Agent 工具接口、以及桌面工作台 UI。
存储与投递状态
0052_room_overhaul.sql、plugins/agent/state/src/room.rs):topic、按房间递增的revision、agent_room_members(显式批量增删 + 发言/提及自动入群)、按首次出现保序的agent_room_reactions、agent_room_pins、消息edited_at/deleted_at(软删保留reply_to外键),以及以整型rowid映射的agent_room_search_docs+ FTS5 trigram 索引agent_room_search(同时支持 1–2 字 CJK 子串搜索)。RoomPosition::Around居中窗口翻页与批量participants解析(已删会话以unavailable: true呈现)。agent_queue_items、agent_catalog_runs、agent_interaction_pending、agent_room_reactions与显式reply_to回复实时派生每条消息的delivery_states(queued/working/waiting/replied/reacted/silent/failed/stopped/rejected)。watch_room水位为按房间计算的 53-bit 指纹,仅追踪本房revision及本房成员的在线、等待、终态、标题与归档状态。Host 调度与 Agent 工具
plugins/agent/native/src/owner/rooms.rs、plugins/agent/native/src/owner/session_tools.rs、plugins/agent/facts/src/input/references.rs、plugins/workspace/workspace-files/native/src/lib.rs):<room_context>唤醒上下文(房间标题、工作区、Topic、同批 co-mentions、带(you)标识的成员名册、Top 5 置顶消息以及最近 6 条带可读人名与附件 URI 的历史),同时保持私聊展示文案干净。[@Name](maka://session/<id>)提及与普通[Name](maka://session/<id>)会话链接,仅显式@唤醒 Agent;内置自提及拦截、目标SessionSend工具白名单预检与连续 Agent 互@6 跳熔断(人工发言重置)。Steer实时插话模式(支持按需切换Queue),在RoomPost同事务内原子更新目标队列与 Run 状态,若目标 Run 并发结束则回落为Followup。roomState、roomSearch、roomManageRPC,以及SessionRead(searchQuery、around、room概览)、Read("maka://session/<room>")、跨会话附件转发(maka://session/<id>/attachments/<attachment_id>)与SessionManage6 项 Room 管理动作(room_topic、room_members、room_react、room_pin、room_edit、room_delete)。人工用户保留编辑和撤回群内消息的权限。桌面工作台 UI、Reaction 与动效
RoomWorkspace.tsx、RoomPanels.tsx、RoomMessageRow.tsx、RoomComposer.tsx、RoomView.tsx):<Popover>置顶列表与全文搜索、以及⋯菜单。C.card气泡内(不重复展示自身头像与姓名);Agent 消息左对齐展示头像、姓名与全宽 Markdown;同一作者 5 分钟内连续发言折叠头部,hover 左侧显露时间。[@Title](maka://session/<id>)提及、输入框上方单枚等待确认胶囊、每条消息下仅展示需操作的投递状态(waiting/failed/rejected)以及底部<ShimmerText>工作提示。RoomReactions.tsx、roomMotion.ts):nsh/base原生<EmojiPicker>的完整 8 列表情浮层(分类跳转、肤色切换、Storage持久化最近使用、中文搜索词注解)。<HoverCard>表态名单(可直达对应 Agent 分屏)以及新增时的 UI 线程<Canvas>单环 6 星粒轻爆裂。!reduceMotion() && platform.idiom !== 'terminal'统一门控:实时新消息上浮、工作/等待呼吸点、胶囊弹簧回弹与微倾、150ms 浮层进出、以及引用/置顶/搜索跳转的 1.65s 呼吸高亮。截图预览
双声道 Room 时间线、Telegram 风格 Reaction 与原生
<EmojiPicker>浮层Room 右侧实时分屏查看 Agent
在 Agent 私聊中侧边并排查看来源 Room
本地历史数据库迁移(已有
runtime-rust.sqlite)迁移
0052_room_overhaul.sql仅包含纯 Schema DDL,代码中不含运行时兼容分支或历史数据回填。若本地已有此前创建的 Room,在启动 Maka 完成 0052 建表并停止 Host 后,运行独立 Python 脚本回填历史成员名册(仅对未改动过的revision = 0且成员表为空的旧 Room 执行回填,可用--fts-only单独补 FTS5)与 FTS5 索引(默认自动备份并在提交前校验外键):python3 migrate_room_overhaul.py [~/.maka/runtime-rust.sqlite] [--dry-run] [--no-backup] [--fts-only]验证
cargo test --locked -p maka-agent-facts(42/42 通过)cargo test --locked -p maka-agent-state --lib store::removal::tests(4/4 通过)cargo test --locked -p maka-agent-state --lib migration_tests(1/1 通过)cargo test --locked -p maka-agent-state --lib room::tests(3/3 通过)cargo test --locked -p maka-agent-native --lib preset_acceptance::rooms(4/4 通过)node --test products/maka/workbench/tests/room-message.test.mjs(6/6 通过)node scripts/ci.mjs run contracts(通过)cargo test --locked -p maka-cli --no-default-features --features desktop-tests --test native-desktop -- room(3/3 通过)cargo clippy(-D warnings)、rustfmt --edition 2024 --check、biome format、node scripts/ci.mjs check licenses全部通过