Skip to content

fix(desktop): adopt newer bundled Core with the managed Python interpreter - #6301

Open
loopx-agent wants to merge 1 commit into
mainfrom
codex/desktop-bundled-core-version-20261012
Open

loopx-agent wants to merge 1 commit into
mainfrom
codex/desktop-bundled-core-version-20261012

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Goal and delivered outcome

Main App build tags such as 0.0.0-main.… were compared with the CLI's Core version, so an automatically updated App could keep an older runtime. First private installation also used Finder's system Python 3.9 even when the selected managed CLI already recorded a working Python 3.12.

The bundle now records the Core version from its archived pyproject.toml. Native startup uses that version with the existing source-ancestry rule, prepares the newer App-owned runtime, reuses the selected managed CLI's recorded interpreter when needed, and verifies the resulting source and declared Core version. The original CLI launcher remains with its installation owner.

Author declaration and specification

Written by: model_agent — OpenAI GPT-6 (Codex).

Implemented against apps/desktop/loopx-control-plane/README.md, Updates And Recovery, at 38cb407edc39752d3ad6b4d414ca5c5255aba177; owning roadmap boundaries S4/S12. This is a reproduced startup defect, not a new capability.

Criterion Disposition Evidence
Select the newest qualified runtime using package version and source ancestry implemented archived Core metadata and native comparison regression
Prepare the bundled snapshot without replacing another CLI's owner implemented actual private installer, preserved launcher, two HTTP identity readbacks
Keep explicit pins and offline/unknown-source behavior retained existing native guards, version/ancestry negative cases; isolated pin and offline recovery journeys
Use bounded installation and qualify the resulting identity implemented selected managed interpreter reuse; mismatched declared Core version rejected

The producer remains Python packaging I/O; native launch and process I/O remain in their Rust owner. The additive field extends desktop_runtime_bundle_v1; missing historical metadata retains its prior fallback, and invalid present versions fail explicitly. The small refactor reuses the existing inferred semver parser and keeps interpreter lookup local.

Validation

Tested revision: 8fc69c346171204da70e73ba6998b96b27f06a5e. Run state: finished. Inputs: synthetic, public_fixture, authorized_private_read_only.

Kind Result Public-safe evidence / limitation
unit passed cargo test --lib: 105 passed, 2 explicitly ignored; comparison covers older/newer/equal/offline and invalid/legacy metadata
integration / real_backend passed Explicit ignored private-installer test: real installed Core, Finder-like PATH, paths with spaces, external launcher unchanged; declared-version mismatch rejected
unit / static passed 11 Python archive/installation tests; changed-file Ruff; Cargo fmt and Clippy with warnings denied; full semantic vocabulary smoke
real_entrypoint / real_backend passed macOS packaged native fixture and real Core HTTP services: older managed CLI discovery → newer bundled Core preparation → matching Chat/status identities; same-window Repair and reopen
regression_parity passed Actual Main App retained older Core before the change; intermediate candidate exposed Python 3.9 installation failure and preserved a usable CLI; final native candidate adopted the newer Core using the recorded interpreter
real_entrypoint passed Corrupt saved choice rediscovered automatically; invalid explicit pin stayed blocked and recovered in the same window after its installation was repaired; offline update check left the workspace usable
manual not_run Windows native qualification, signed update failure after replacement, and sustained concurrent-launch ownership are outside this slice; remote CI is not used as evidence

The packaged fixture changes only discovery inputs and explicit routing to an empty test authority, plus private diagnostic logging. It invokes the actual installer and backend; it is an ad-hoc test bundle, not an official release. Private screenshots, paths and raw logs are not published. This PR changes startup behavior and packaging metadata; visual layout and the first viewport are unchanged. Frontend recovery and CLI/backend readback were tested; Lark behavior is unchanged.

Scope and continuation

Complete within the version/managed-interpreter repair slice. The existing broader Desktop recovery work retains signed update-failure and sustained single-owner qualification. This does not certify full desktop release readiness or multi-agent business acceptance. The currently installed signed App does not contain this proposed patch; maintainer review and a new signed App build remain necessary.

No private state, credentials or generated bundles are included. DCO sign-off is present. No merge authorization is inferred.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reviewer: model_agent; runtime_reported; gpt-6.1-sol; OpenAI; reasoning_effort=xhigh.

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

动机

普通 macOS 用户从 Finder 打开已升级的 Main App,需要自动用可验证的较新运行时。 旧路径把壳版本 0.0.0 当作 Core 版本,保留较旧 CLI;中间候选又选中系统 Python 3.9,最终候选复用已选 CLI 的解释器并采用较新 Core。 原生窗口打开工作区,Chat 与 status 回读同一较新 Core,其他安装方式的 CLI 启动器保持原样。 本 PR 不关闭完整 Desktop 发布、跨会话业务验收或持续单实例运行验收。 剩余正式签名 App 发布采用、替换失败恢复及持续单实例运行资格由既有 Desktop 恢复工作继续。

改动思路

版本事实从同一归档派生,决策留在原生启动 owner,安装仍用既有私有安装器;这比改发布标签、写全局 CLI 或新增发现框架更小且可回滚。 本次边界是 Core 版本协调、首次私有安装的解释器复用与安装身份核验。 最强反例是“版本比较测试通过,但原生 App 真正准备组件时仍失败”:隔离副本确实复现了系统 Python 3.9 的失败,后续修复用现有安装器的解释器记录完成真实安装。归档字段是构建时派生的版本事实,既有 native comparator 决定新旧,私有 installer 负责副作用,HTTP 身份与原生窗口负责回读,未另设控制面 owner。

具体改动

按变更前的 apps/desktop/loopx-control-plane/README.md,revision 38cb407edc39752d3ad6b4d414ca5c5255aba177 核验:qualified_local_runtime、preserve_installation_owner、explicit_pin_and_offline、bounded_qualified_installation 均有源码与实际验证映射。评审覆盖整个 8fc69c346171204da70e73ba6998b96b27f06a5e 六文件 diff,相关调用者和元数据生产工作流也已读取。

关键代码讲解

  • archive_package_version(scripts/desktop_runtime_bundle.py:122)从实际归档的 pyproject 读取 Core 版本;工作目录更高的版本和 App 标签不能覆盖它。
  • bundled_runtime_candidate(runtime_selection.rs:117)校验新字段,并保留旧描述缺省时的兼容路径;已有 package/ancestry 比较继续拥有排序语义。
  • install_snapshot(bundled_runtime.rs:152)保留 App 私有解释器优先级,没有记录时才复用已选 managed CLI 的记录;安装完成同时核对 source 和声明的 Core 版本,其他 CLI 启动器不变。
  • resume_runtime(maintenance.rs:673)把真实已选 executable 传入现有准备入口。源码导出、签名、私有写入范围、显式 pin、可选失败回退和重试 owner 延续原路径。

对主干的风险

实际原生候选与 Core HTTP 验证了较新 source 被准备和采用,最终同窗口 Repair 及重开继续回读同一安装身份。Finder-only PATH 的真实安装和有效但错误的 package_version 负例均通过;105 个 native case、11 个 Python case、fmt/Clippy/Ruff、完整 semantic smoke、19 项 risk canary 与四项 direct check 通过。首次缺少构建资源、错误 Tauri 工作目录、中间 Python 失败和未有质量回执的 hold 均保留,未计作成功;最终 head 的相关覆盖替代了这些失败观察。无 opt-in/default-off 承诺;native Windows、真实签名替换后的失败和持续重复启动尚未资格。合并/发布与当前本机采用各自保持边界。

语义与 CI 对齐

新增的 package_version 复用 Core 的版本含义,扩展既有 bundle v1 的派生字段,不创造 Agent 生命周期或权限。新字段损坏会明确拒绝,缺失的旧描述保留原 fallback;新 signed App 必须由现有包装流程发布。审阅当前 policy 20:CI 不查询、不轮询,评审依据是精确版本的本地原生和真实后端验证;仓库所需远端合并门没有被豁免。

我的整体评价

long_horizon=improved,user_experience=improved:较新 Core 的准备、保存、同窗口恢复与重开有实际回读,减少了手选版本或重复修复;这不等于完整业务采用或无界单实例证明。机制与已复现问题相称,沿原 owner 做了小型 parser/解释器复用,兼容范围明确。此为 justified_increment;现有 Desktop 恢复和正式发布继续验收剩余项。作者身份下发表 COMMENTED 自评,不冒充独立维护者批准,也不授予合并权限。

English verdict: APPROVE for this exact head. The packaged native and real installer/backend paths verify the Core-version and managed-interpreter repair; release adoption and sustained single-owner qualification remain separate.

This branch has not been deployed

No deployments
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