Repository navigation
feat(desktop,installer): switch LoopX.app default surface to Workbench and auto-install macOS App - #10254
Merged
loopx-agent merged 1 commit intoDec 6, 2026
Conversation
…h and auto-install macOS App Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent
commented
Dec 6, 2026
loopx-agent
left a comment
Collaborator
Author
There was a problem hiding this comment.
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机
此前 apps/workbench 已完成单 Core 迁移与大部分治理能力收口,但 LoopX.app(apps/desktop/loopx-control-plane)仍硬编码打开旧版 http://127.0.0.1:8767/chat/(apps/presentation/dashboard),且 scripts/install-local.sh 安装完 CLI 后不会自动安装或更新 macOS 桌面端 LoopX.app,导致用户在「应用程序」中看不到 Workbench 桌面入口。按照「先切默认 App 到 Workbench、安装 LoopX 时自动装 App,再逐步分析融合剩余能力并将旧 dashboard 迁入 deprecated/ 渐进删文件」的明确方向,需要立刻完成桌面壳切主、安装器自动化与双语路线图同步。
改动思路
本 PR 按四层边界完成最小、可回退、端到端可验证的切主闭环:
- 在
apps/desktop/loopx-control-plane/src-tauri/引入显式类型化的WorkspaceSurface::{Workbench, LegacyDashboard}(默认Workbench,通过LOOPX_DESKTOP_SURFACE=legacy|dashboard保留可逆应急回退);Workbench模式仅依赖单一 Core:8767(不再要求已退役的:8766serve-status),启动后调用loopx --format json workbench start获取经回环校验的认证访问 URL,通过WorkspaceHandoff::services_ready_at(...)在内存中直达已认证 Workbench(绝不落盘或打印凭证)。 - 在
maintenance.rs::resume_runtime允许由install-local.sh构建的轻量本地LoopX.app(不含 95MBruntime-source.tar.gz)安全复用本机已验证的~/.local/bin/loopxCLI,同时完整保留签名发行版内置运行时的所有校验与恢复逻辑。 - 在
loopx/cli_commands/workbench.py优雅处理双全局注册表冲突(未显式传--runtime-root/--registry时降级为defaultRegistry: None,交由workbench.ts读取STATE/.env中的LOOCHAT_LOOPX_REGISTRY),避免LoopX.app或用户直接执行loopx workbench start抛出未捕获的ValueError。 - 新增
scripts/desktop_app_install.py并接入scripts/install-local.sh(LOOPX_INSTALL_DESKTOP_APP=auto|1|0、LOOPX_DESKTOP_APP_DIR),基于源码 SHA-256 指纹缓存与持久化CARGO_TARGET_DIR自动构建/复用并原子替换/Applications/LoopX.app,同时对临时HOME/ CI / 冒烟隔离环境自动跳过,不破坏现有安装器冒烟。
具体改动
- Tauri 桌面壳切主至 Workbench:修改
service_endpoints.rs、services.rs、workspace_handoff.rs、lib.rs、maintenance.rs、tauri.conf.json,新增WorkspaceSurface、required_services()、start_workbench()、parse_workbench_launch_url()、services_ready_at(),并更新services_tests.rs与services_real_runtime_tests.rs补齐默认/回退/非法配置/回环起源校验单测(212 passed; 0 failed)。 - Workbench CLI 双注册表容错:修改
loopx/cli_commands/workbench.py并在tests/test_workbench_cli.py新增双注册表冲突容错单测。 - macOS
LoopX.app自动安装与指纹复用:新增scripts/desktop_app_install.py(SHA-256 指纹回执.loopx-desktop-app-build.json、sips + iconutil生成LoopX.icns、ad-hoccodesign与备份原子替换)与tests/test_desktop_app_install.py,并接入scripts/install-local.sh(实测产出17.3 MBrelease 二进制与528 KB图标,增量重建 12.47s,无源码变化秒级复用;claude-install-optin-smoke.py与codex-cli-packaged-install-smoke.py全绿通过)。 - 双语路线图同步:成对更新
docs/architecture/rfcs/loopx-overall-roadmap-v0.md+.zh-CN.md与docs/product/roadmaps/digital-worker-workbench-feishu-paths.md+.zh-CN.md,记录桌面切主前置与后续旧dashboard移入deprecated/渐进删减路径(check_rfc_bilingual.py通过)。
对主干的风险
- 旧版 Dashboard 可随时无损回退:保留
LOOPX_DESKTOP_SURFACE=legacy显式开关与全部既有/chat/代码路径,未删除任何apps/presentation/dashboard文件,遇未迁完能力可零成本回退。 - 安装器与冒烟边界安全隔离:
scripts/install-local.sh在auto模式下仅对真实 macOS 家目录(排除/tmp/、/var/folders/、$CI、$PYTEST_CURRENT_TEST及非默认bin_dir)自动装 App,resolve_app_dir在临时HOME下绝不写入/Applications,且已通过claude-install-optin-smoke.py与codex-cli-packaged-install-smoke.py实测验证。 - 签名发行版与安全边界保持不变:仅当
runtime_bundle_missing且本机 CLI 已通过身份校验时才复用本地 CLI,签名发行版仍强制走原内置快照校验;access_url校验严格限定http://127.0.0.1:<port>且绝不写入workspace-location.json;全部 17 个改动文件通过loopx check(errors=0)。
我的整体评价
这是一笔方向清晰、边界克制且工程完成度很高的桌面端切主交付:既把 LoopX.app 的默认体验立刻统一到 apps/workbench 并通过 install-local.sh 实现了带指纹复用的 macOS 自动安装,又通过 LOOPX_DESKTOP_SURFACE=legacy、回环 URL 校验与临时目录安全护栏守住了回退与安全底线。Rust 212 项单测、真实 release .app 构建、Python 单测、双语 RFC 门禁及打包安装冒烟全部通过,建议合入主干。
English verdict: APPROVE on ff71aa7.
loopx-agent
deleted the
codex/desktop-workbench-default-and-auto-install-20261206
branch
December 6, 2026 10:04
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.
Summary
Switches
LoopX.app(apps/desktop/loopx-control-plane) to LoopX Workbench (apps/workbench) by default right now (instead of waiting untilF1–F6retirement completes) and adds automatic fingerprinted macOSLoopX.appinstallation toscripts/install-local.shunder the "switch first, absorb incrementally, move legacydashboardtodeprecated/and delete progressively" strategy (aligned with Issue #9852P0-1/C4):LoopX.appdefaults toapps/workbench(apps/desktop/loopx-control-plane/src-tauri/)WorkspaceSurface::{Workbench, LegacyDashboard}inservice_endpoints.rs, defaulting toWorkbench(http://127.0.0.1:8796/, requiring only single-Core:8767ServiceKind::Chat, no retired:8766serve-status) while keeping an explicit reversible escape hatch (LOOPX_DESKTOP_SURFACE=legacyordashboard→http://127.0.0.1:8767/chat/).<loopx> --format json workbench startinservices.rs, validates the loopback origin ofaccess_url, and hands the authenticated launch URL toWorkspaceHandoff::services_ready_at(...)(in memory only; never persisted toworkspace-location.jsonor logs) so the Tauri WebView opens directly into authenticated Workbench (index.htmlingests#token=...intolocalStorageand scrubs the URL).maintenance.rs::resume_runtimeso thin local macOSLoopX.appbundles built byinstall-local.sh(without a 95MB embeddedruntime-source.tar.gz) cleanly reuse the verified locally installedloopxCLI, while preserving all signed-release bundled-runtime guarantees.tauri.conf.jsonCSP to includehttp://127.0.0.1:8796 ws://127.0.0.1:8796.loopx workbench start(loopx/cli_commands/workbench.py)ValueErrorwhen a machine has both default global registries (~/.loopxand legacy~/.codex/loopx) andworkbench startis invoked without--runtime-root/--registry, lettingworkbench.tsreuse any configuredLOOCHAT_LOOPX_REGISTRYinSTATE/.env(while keeping explicit--registry @host-globalstrict).LoopX.appinstallation inscripts/install-local.sh(scripts/desktop_app_install.py)scripts/desktop_app_install.pywith SHA-256 source-fingerprint caching (Contents/Resources/.loopx-desktop-app-build.json), persistentCARGO_TARGET_DIRincremental builds, macOSLoopX.icnsgeneration from the orbital infinity icons, ad-hoc signing, and atomic backup-and-swap into/Applications/LoopX.app(or~/Applications/LoopX.appif/Applicationsis not writable).LOOPX_INSTALL_DESKTOP_APP=auto|1|0andLOOPX_DESKTOP_APP_DIRintoscripts/install-local.sh:autoinstalls/updatesLoopX.appautomatically on real macOS local installs (bin_dir == $HOME/.local/binandcargopresent) while safely skipping isolated temp-dir smokes and non-macOS hosts unlessLOOPX_INSTALL_DESKTOP_APP=1is requested.docs/architecture/rfcs/loopx-overall-roadmap-v0*.md,docs/product/roadmaps/digital-worker-workbench-feishu-paths*.md)LoopX.app -> apps/workbenchcutover +install-local.shauto-install and the "switch first, absorb capabilities incrementally, deprecate and progressively deleteapps/presentation/dashboard" execution policy across both English and Chinese documents.Verification
TAURI_CONFIG='{"bundle":{"resources":[]}}' cargo test --lib -- --test-threads=4):212 passed; 0 failed(including new tests forWorkspaceSurfacedefault/legacy/invalid parsing, 3-port isolated allocation,parse_workbench_launch_urlloopback validation, andWorkspaceHandoff::services_ready_atsame-origin enforcement).python3 scripts/desktop_app_install.py apps/desktop/loopx-control-plane --app-dir <tmp> --json): built17.3 MBrelease binary +528 KBLoopX.icns+Info.plist+.loopx-desktop-app-build.json(default_surface: "workbench") +_CodeSignature; incremental rebuild took12.47s, and unchanged-source reuse is verified in unit tests.uv run --extra test python -m pytest -q tests/test_desktop_app_install.py tests/test_workbench_cli.py -k "not packaged_cli"):11 passed, 9 skipped.ruff checkclean;scripts/check_rfc_bilingual.py --base origin/main --head HEADpassed.loopx check --scan-path ...on all 17 changed files):ok: True,errors=0.loopx canary premerge --from-git-diff --git-diff-base origin/main):ok: true,merge_gate_passed: true, 10/10 catalog canaries passed.ServiceEndpoints::required_services()decouples Workbench single-Core:8767startup from legacy:8766without duplicating service supervisor logic;scripts/desktop_app_install.pymirrorsscripts/workbench_bundle.py's fingerprinted receipt pattern).