Skip to content

feat(desktop): scope Runtime Host IPC by Host identity - #2935

Merged
M4n5ter merged 12 commits into
mainfrom
feat/runtime-host-scoped-desktop-identity
Aug 13, 2026
Merged

M4n5ter merged 12 commits into
mainfrom
feat/runtime-host-scoped-desktop-identity

Conversation

@M4n5ter

@M4n5ter M4n5ter commented Aug 13, 2026 •

Copy link
Copy Markdown
Member
English

Summary

  • Bind every Host-backed Desktop IPC request and event to the Runtime Host identity and target generation
  • Reject stale traffic across reconnects, profile switches, and rollback while preserving the existing single-active renderer API
  • Namespace Browser and Computer Use resources by Host and Session, and keep Client-local window/update IPC outside Host scope

Refs #2522

Verification

  • Desktop typecheck passes
  • Desktop main-process tests pass: 784/784
  • Biome and git diff --check pass
  • Desktop E2E confirms the application starts and Host-backed IPC is available after the Client-local/Host-scoped split

Checklist

  • Tests cover the behavioral contracts
  • Lint, typecheck, and affected test suites pass locally

Does this PR entail a change in behavior?

  • Yes — stale cross-Host Desktop traffic is rejected; the single-active product behavior is unchanged
简体中文

摘要

  • 将所有 Host-backed Desktop IPC 请求和事件绑定到 Runtime Host 身份与目标 generation
  • 在重连、profile 切换和回滚期间拒绝过期流量,同时保持现有单活 renderer API
  • 使用 Host 与 Session 复合标识隔离 Browser 和 Computer Use 资源,并将 Client-local 的窗口与更新 IPC 保留在 Host scope 之外

关联 #2522

验证

  • Desktop typecheck 通过
  • Desktop 主进程测试 784/784 通过
  • Biome 与 git diff --check 通过
  • Desktop E2E 已确认 Client-local/Host-scoped 拆分后应用可以启动并使用 Host-backed IPC

检查项

  • 测试覆盖行为契约
  • lint、typecheck 与受影响测试均在本地通过

此 PR 是否改变行为?

  • 是——现在会拒绝跨 Host 的过期 Desktop 流量;单活产品行为保持不变

AI disclosure: OpenAI Codex assisted with implementation, tests, documentation, and pull request text under M4n5ter's direction. Human review is required before merge.

M4n5ter added 11 commits August 13, 2026 12:51
Bind Desktop Host-backed requests and events to the root identity verified during the handshake, while keeping the existing single-active renderer API unchanged. Namespace Browser and Computer Use resources by Host and Session so target switches cannot collide on raw IDs.

Generated-by: Codex
Bind Computer Use stops and diagnostics to the exact Runtime Host generation across target changes. Keep Host identity inside the private main-to-preload wire contract instead of exposing it through renderer profile APIs.

Generated-by: Codex
Let a pending Runtime Host transition fence earlier Stop requests without making the Stop RPC part of the transition queue. A later profile switch or shutdown can now close a disconnected target and retire the stale action.

Generated-by: Codex
Combine the handshake-verified root identity with the Desktop target epoch so stale requests, events, and native resources cannot cross between profiles that share one Host. Derive the root identity only from the established connection.

Generated-by: Codex
Keep renderer observation intent independent of a candidate generation so failed switches and reconnects bind events to the current target epoch. Derive candidate scope from the target IPC authority and keep Desktop diagnostics available while that scoped Host reconnects.\n\nGenerated-by: Codex
Make a restored target generation visible and active before its candidate replays Session observations, so preload accepts the canonical seed under the new epoch. Deactivate that provisional scope if restoration fails.\n\nGenerated-by: Codex
Keep the owner snapshot aligned with the provisionally active rollback epoch while its candidate is being restored, and clear that authority if restoration fails.\n\nGenerated-by: Codex
Capture one Runtime Host scope across attachment preparation, pagination, retries, and read-modify-write operations so a target switch rejects the original action instead of migrating it. Retire Browser views and automation directly from the main-process target lifecycle.\n\nGenerated-by: Codex
Move Session observation release to the persistent Desktop owner so renderer cleanup remains valid while a target is switching or rolling back. Dispatch cancellation without waiting for Host seeding to finish.

Generated-by: Codex
Forward scoped renderer events without dropping their payload. Release Session observation leases both immediately and after a reconnect-queued observe settles, covering both existing and late registrations.

Generated-by: Codex
Register window, updater, and E2E fixture channels once at the persistent Desktop boundary. Keep only Host-dependent app and project operations inside the active target scope.

Generated-by: Codex
@M4n5ter
M4n5ter force-pushed the feat/runtime-host-scoped-desktop-identity branch from 2fe841f to 1776ea5 Compare August 13, 2026 04:57
Register both Markdown save dialogs at the persistent Desktop boundary. Their payloads are already renderer-formatted and the operation only writes a user-selected local file, so it must remain available independently of the active Runtime Host generation.

Generated-by: Codex
@M4n5ter
M4n5ter marked this pull request as ready for review August 13, 2026 06:12
@M4n5ter

M4n5ter commented Aug 13, 2026

Copy link
Copy Markdown
Member Author
English

I have manually reviewed the final contents of this PR, including the fixes produced through the iterative correctness, security, and design reviews.

The Host identity and target-generation boundaries, Client-local versus Host-scoped IPC ownership, reconnect/switch/rollback behavior, and resource lifecycles are consistent with the intended architecture. The final independent review found no remaining blocking or important findings, and all required CI checks pass.

Approved for merge.

简体中文

我已人工审核此 PR 的最终内容,包括多轮 correctness、security 与 design 审查产生的全部修复。

Host identity 与 target generation 边界、Client-local 与 Host-scoped IPC ownership、重连/切换/回滚行为及资源生命周期均符合预期架构。最终独立审查未发现剩余的 blocking 或 important finding,所有必需 CI 检查均已通过。

同意合并。

@M4n5ter
M4n5ter merged commit fa85dfd into main Aug 13, 2026
16 of 17 checks passed
@M4n5ter
M4n5ter deleted the feat/runtime-host-scoped-desktop-identity branch August 13, 2026 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant