Skip to content

fix(runtime): bind service activation to the qualified executable target - #8170

Merged
loopx-agent merged 1 commit into
mainfrom
codex/service-runtime-symlink-20261106
Nov 6, 2026
Merged

loopx-agent merged 1 commit into
mainfrom
codex/service-runtime-symlink-20261106

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

A CLI archive update can change the target of the installed loopx symlink while the status/Chat LaunchAgent arguments remain byte-identical. Alignment then attempts to reuse old processes, whose HTTP runtime identity still names the previous release, and reports activation failure.

Resolve the already validated absolute executable before its installation qualification and launcher binding. The existing handoff now records the exact qualified target; a later alias retarget triggers the normal fenced pair transition. Preserve original registry/runtime/account arguments, rollback, pending-work protection and same-runtime idempotence. Relative paths remain rejected before resolution.

Validation: 141 activation/update tests passed, four optional/platform cases skipped; the final focused service suite passed 37 tests with one opt-in real-launchd case skipped. The identical alias regression fails against the immutable installed parent and passes against this head. Real production diagnosis also observed unchanged alias-based launcher bytes with old HTTP identities; normal explicit-target activation restored the pair. The default fixed entrypoint will be qualified after normal merge/install. No source, runtime-root, account or business work is reassigned.

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; GPT-6; OpenAI; self_reported (runtime observation unavailable).

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

动机 / Motivation

通过已安装 CLI 升级原 Status/Chat 服务的用户。旧版本里 CLI 软链接换了目标,启动配置字面却未变,服务仍跑旧版并报身份不匹配;新版本先固定被核验的实际可执行文件,再沿原有保护流程切换。同一个真实文件系统与服务管理器回归在固定父版本失败、在本提交通过,原路由和账号参数保持不变,重复激活不再重启已匹配服务。不更改终端 CLI 链接、工作区、账号、业务请求、服务范围或已有停止与回滚权限。安装后默认入口在原两个服务的实际采用与所有业务欠答仍须分别验收。

改动思路 / Approach

只在既有 macOS 服务 owner 的资格核验边界解析路径,之后继续使用原启动、Chat fence、日志和回滚逻辑,没有增加对齐队列或新持久状态。本 PR 交付默认激活路径的软链接身份修复,具体机器的安装采用与全部业务欠答仍分别验收。改动不是增加一次“无条件重启”,而是让 doctor 检查的实际可执行文件与写入启动配置的对象一致。别名输入仍可使用,但已接受的服务绑定不会随别名悄悄换目标;每次升级继续经过原有工作屏障和 HTTP 身份读回。直接路径、已匹配源与自定义来源保留各自原语义。

具体改动 / Changes

依据改动前 apps/desktop/loopx-control-plane/README.md,固定版本 d648c7072b35eea4bc0d3643c5ebaa63fda7361a,运行时服务配对一节的未编号要求。描述标签 qualified-pair 对应两个服务均采用所选身份并读回;unchanged-data-route 对应工作区、账号、注册表和工具参数保留;matching-runtime-reuse 对应已匹配源不重复激活。三项均有当前路径和对应验证,未修改规范或增添质量例外。

关键代码讲解

  1. _align_managed_runtime 先保留原有绝对路径、文件与执行权限判断,再严格解析路径。这个顺序防止相对输入被解析成绝对路径后错误获得准入;doctor 与后续绑定使用同一个选定对象。
  2. _retarget 继续保留原路由、根目录、账号与日志配置,仅接收已核验的实际执行文件。别名目标变化会进入既有的成对切换流程;CLI 别名本身不改。
  3. _verify_services 继续以真实 HTTP 身份验收,不能用安装成功替代运行采用。失败和中断沿原日志恢复;新增的别名回归还检查第二次调用不再重启。原归档更新测试改成真正的新源,同时保留对两个服务和其他原管理服务的断言。

对主干的风险 / Risks

未发现阻断性代码问题。最强反例是未经验证的相对路径、可变别名或修改过的系统任务造成错误切换;141 项激活/更新回归通过,4 项可选或平台相关案例跳过,最终服务专项为37通过、1跳过。原队列屏障、自定义角色、字面配置、异步卸载、损坏日志和回滚断言均保留。相同公开回归在固定父版本失败,在本提交通过;测试使用真实文件、软链接和 doctor 子进程,系统管理器隔离模拟。

真实机器还独立观察到旧 HTTP 身份和未变的别名配置,使用既有明确目标激活命令后两个原服务读回新版。这是已有路径的现场证据,不冒充本提交默认入口已部署。最终 native premerge PASS;首次缺少 TypeScript 开发依赖已正常安装后复核,没有放宽检查。既有全局架构告警仍为 advisory。

语义与 CI 对齐

复用现有资格、状态、原工作保护和 HTTP 身份语义,不增加共享词汇、工作义务或服务授权。语义、公开边界、编译及模块门禁通过;当前策略不查询、等待或声称通过远端 CI。

我的整体评价 / Verdict

这个修复让正常升级可继续采用已选版本,避免每次因软链接同名停在旧服务,用户也无需复制版本路径。只有宿主服务选择和启动绑定变化,没有新增页面、卡片或排版;检查了更新入口、身份读回与原有服务控制路径。未验证范围:无新增视觉输出;平台外案例和安装后的默认新入口另行验收。只在既有 macOS 服务 owner 的资格核验边界解析路径,之后继续使用原启动、Chat fence、日志和回滚逻辑,没有增加对齐队列或新持久状态。本 PR 交付默认激活路径的软链接身份修复,具体机器的安装采用与全部业务欠答仍分别验收。需在正常安装后验证默认调用与两个原服务身份;任何既有工作屏障仍必须保留。

English verdict: APPROVE this scoped runtime identity repair; qualify the original services after normal install.

@loopx-agent
loopx-agent merged commit 918844a into main Nov 6, 2026
18 of 24 checks passed
@loopx-agent
loopx-agent deleted the codex/service-runtime-symlink-20261106 branch November 6, 2026 05:34
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