Skip to content

feat(desktop): complete shared Session Guest controls - #4608

Merged
M4n5ter merged 1 commit into
fix/shared-session-join-finalizationfrom
chore/shared-session-guest-ux
Sep 3, 2026
Merged

feat(desktop): complete shared Session Guest controls#4608
M4n5ter merged 1 commit into
fix/shared-session-join-finalizationfrom
chore/shared-session-guest-ux

Conversation

@M4n5ter

@M4n5ter M4n5ter commented Sep 3, 2026

Copy link
Copy Markdown
Member
English

Summary

Complete the shared-Session Guest controls without giving a Guest direct execution authority:

  • render the Guest request surface as the normal chat Composer;
  • keep its draft visible and editable while the Runtime Host reconnects, replacing only the send action with a disabled spinner and an explanatory tooltip;
  • retain the pending operation ID across Session switches and remounts, so reconciliation remains idempotent and a late result cannot erase a newer draft;
  • make request history collapsible, allow a Guest to withdraw its own pending request, and keep terminal requests dismissible;
  • let a Guest request regeneration through the same Owner approval and durable admission boundary as a new Turn request;
  • show the authoritative source-Turn text to the Owner for regeneration approval and provide a direct jump to that Turn;
  • preserve ordinary non-mutating footer actions such as copy and details, while withholding branch creation;
  • keep Owner-side interactions such as AskUserQuestion on the Owner that approved the work;
  • give direct dialog-footer button groups consistent spacing.

Approved regeneration still executes through the existing Host turn.regenerate handler. The Guest can request an operation, but cannot approve or execute it.

Protocol compatibility

This adds a regeneration form to the Turn-request intent and a Guest-scoped withdrawal command. Runtime Host compatibility epoch 101 rejects older peers that do not share that command vocabulary or Guest grant.

Verification

  • npm run build
  • npm --workspace @maka/desktop run typecheck
  • npm run lint -- --diagnostic-level=error
  • npm run format:check -- --diagnostic-level=error
  • npm run check:renderer-architecture -- --base 4b08b088c2c7a776c748ce10af9d7e20ddfd9494
  • npm run astryx:surface-inventory
  • npx knip --workspace apps/desktop
  • npm run astryx:theme -- --check
  • Desktop compiled suite: 1,975 passed
  • CLI compiled suite: all tests passed on an isolated run
  • Runtime Host compiled suite: all affected collaboration tests passed; three unrelated long-running process-startup tests timed out only while this suite ran concurrently with the Desktop suite, and all three passed on immediate isolated reruns
  • Focused remount regressions cover both late reconciliation preserving a newer draft and an in-flight request being resumed without a second submission
  • Storybook QA for Product/Shared Session Guest / Request Queue and Reconnecting: withdrawal remained removed after refresh; a typed reconnecting draft survived Enter; the disabled send control exposed the reconnect explanation

Stack

Depends on #4601, which fixes the durable success boundary for joining a shared Session.

AI use

Select exactly one:

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

Tool(s) and scope: OpenAI Codex implemented the protocol, Host admission path, Desktop controls, Storybook scenarios, and focused tests. The commit contains a Generated-by: Codex trailer.

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
中文

概要

补齐共享会话 Guest 端的常用操作,但不把任务执行权直接交给 Guest:

  • Guest 的请求输入区改用正常会话的 Composer 样式;
  • Runtime Host 重连时不再把输入区整个拿走,草稿仍可查看和编辑,只把发送按钮换成不可点击的转圈图标;悬停会说明草稿不会丢,恢复连接后即可发送;
  • 即使切换会话再回来,也会继续沿用原请求的 operation ID 做对账,不会重复提交;旧请求晚到时也不能清掉后来编辑的新草稿;
  • 请求记录可以折叠;尚未审批的请求可以由发起者撤回,已有结果的记录仍可关闭;
  • Guest 可以请求“重新生成”,但仍要经过 Owner 审批,并沿用新轮次请求的持久准入边界;
  • Owner 审批“重新生成”时会看到由自己会话记录解析出的原轮次内容,也可以直接跳到该轮次核对;
  • 复制、查看详情等普通消息操作继续可用,但 Guest 不能自行创建分支;
  • 如果执行过程中出现 AskUserQuestion 等需要人处理的交互,仍由批准这次工作的 Owner 正常处理;
  • 统一修正弹窗底部直接相邻按钮没有间距的问题。

审批通过后,“重新生成”仍调用 Host 已有的 turn.regenerate。Guest 只有发起请求的权力,没有审批权,也不能绕过 Host 直接执行。

协议兼容性

轮次请求新增了“重新生成”意图,同时增加了仅供 Guest 撤回自己待审批请求的命令。Runtime Host compatibility epoch 提升到 101,旧端若不理解这些命令和授权范围,会在握手阶段明确拒绝,不会带着不同语义继续运行。

验证

  • npm run build
  • npm --workspace @maka/desktop run typecheck
  • npm run lint -- --diagnostic-level=error
  • npm run format:check -- --diagnostic-level=error
  • npm run check:renderer-architecture -- --base 4b08b088c2c7a776c748ce10af9d7e20ddfd9494
  • npm run astryx:surface-inventory
  • npx knip --workspace apps/desktop
  • npm run astryx:theme -- --check
  • Desktop 编译后测试:1,975 项通过
  • CLI 编译后测试:隔离运行时全部通过
  • Runtime Host 编译后测试:本次涉及的 collaboration 测试全部通过;与 Desktop 全量测试并行运行时,三个无关的长时进程启动测试超时,随即逐条单独重跑均通过
  • 两条聚焦回归分别覆盖:旧对账结果不能覆盖 remount 后的新草稿;进行中的请求在 remount 后继续对账且不会再次提交
  • 在 Storybook 的 Product/Shared Session Guest / Request QueueReconnecting 场景完成交互检查:撤回后刷新不会重新出现;重连时输入草稿在按下 Enter 后仍保留;不可用的发送按钮能显示完整重连说明

Stack

依赖 #4601;前一个 PR 修正了加入共享会话时的持久成功边界。

AI 使用

  • 没有生成式工具作出实质贡献
  • 生成式工具作出了实质贡献

工具及范围:OpenAI Codex 实现协议、Host 准入路径、Desktop 交互、Storybook 场景和聚焦测试。提交中包含 Generated-by: Codex trailer。

检查清单

  • 测试覆盖该改动,且在修复前会失败
  • 本地 lint、format、typecheck 和受影响测试均通过

本 PR 是否改变行为?

  • 是——已在概要中说明

@github-actions github-actions Bot added the effort/XL Over 1000 readable lines label Sep 3, 2026
@M4n5ter
M4n5ter force-pushed the chore/shared-session-guest-ux branch 3 times, most recently from 9abd0f5 to 9cfd24d Compare September 3, 2026 05:25
@M4n5ter
M4n5ter marked this pull request as ready for review September 3, 2026 05:44

@jackwener jackwener left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved at exact head 9cfd24de7bc4889623ffba5255c923ff940f9de5 at the explicit direction of M4n5ter. No technical review was performed as part of this action; M4n5ter requested the approval and accepts responsibility for subsequent handling.


Review notice: This approval was submitted by an automated review agent operated by jackwener and is published at the direction of M4n5ter, who requested this action and is the human accountable for it.

@M4n5ter
M4n5ter force-pushed the chore/shared-session-guest-ux branch from 9cfd24d to 9b400e4 Compare September 3, 2026 06:00
@M4n5ter
M4n5ter merged commit 6cfb832 into main Sep 3, 2026
2 checks passed
@M4n5ter
M4n5ter deleted the chore/shared-session-guest-ux branch September 3, 2026 06:31
Joob1n added a commit to Joob1n/maka-agent that referenced this pull request Sep 3, 2026
Two new system_note kinds and the reshaped lastRequestAnchor land in
@maka/core's closed allowlists. A merge-base client handshakes on strict
epoch equality and would then fail to decode the first transcript carrying
them; the epoch moves so the pair refuses each other at the handshake (main is at 101 after apache#4608, so this lands as 102).

Refs apache#4559

Generated-by: Claude Code
Claude-Session: https://claude.ai/code/session_014ajaRxC4jydavY9nYUFj5J
Joob1n added a commit to Joob1n/maka-agent that referenced this pull request Sep 3, 2026
Two new system_note kinds and the reshaped lastRequestAnchor land in
@maka/core's closed allowlists. A merge-base client handshakes on strict
epoch equality and would then fail to decode the first transcript carrying
them; the epoch moves so the pair refuses each other at the handshake (main is at 101 after apache#4608, so this lands as 102).

Refs apache#4559

Generated-by: Claude Code
Claude-Session: https://claude.ai/code/session_014ajaRxC4jydavY9nYUFj5J
Joob1n added a commit to Joob1n/maka-agent that referenced this pull request Sep 3, 2026
Two new system_note kinds and the reshaped lastRequestAnchor land in
@maka/core's closed allowlists. A merge-base client handshakes on strict
epoch equality and would then fail to decode the first transcript carrying
them; the epoch moves so the pair refuses each other at the handshake (main is at 101 after apache#4608, so this lands as 102).

Refs apache#4559

Generated-by: Claude Code
Claude-Session: https://claude.ai/code/session_014ajaRxC4jydavY9nYUFj5J
Joob1n added a commit to Joob1n/maka-agent that referenced this pull request Sep 3, 2026
Two new system_note kinds and the reshaped lastRequestAnchor land in
@maka/core's closed allowlists. A merge-base client handshakes on strict
epoch equality and would then fail to decode the first transcript carrying
them; the epoch moves so the pair refuses each other at the handshake (main is at 101 after apache#4608, so this lands as 102).

Refs apache#4559

Generated-by: Claude Code
Claude-Session: https://claude.ai/code/session_014ajaRxC4jydavY9nYUFj5J
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/XL Over 1000 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants