Skip to content

fix(workbench): start managed Core through the installed CLI - #10043

Merged
cocolord merged 3 commits into
loopx-project:mainfrom
cocolord:codex/workbench-installed-core-entry-20261203
Dec 4, 2026
Merged

cocolord merged 3 commits into
loopx-project:mainfrom
cocolord:codex/workbench-installed-core-entry-20261203

Conversation

@cocolord

@cocolord cocolord commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Goal And Delivered Outcome

On an installed Core + Workspace pair, loopx workbench start --with-core failed before Chat could listen. The managed subprocess used the complete CLI module, which is absent in this assembly. Launch Chat through the shipped entrypoint and verify the module, chat subcommand and exact port when reading managed-process ownership. The previous launch form remains eligible for adoption and shutdown.

Author Declaration

Criterion Disposition Owner and evidence
Start installed Chat from Workbench implemented Workbench lifecycle uses the published CLI entrypoint. Reproduced failure and verified recovery on the same-version wheels.
Preserve the managed Core process across Workbench recovery implemented The lifecycle accepts either shipped module invocation with the expected subcommand and port. The installed candidate reused and stopped a child created by the previous launcher.

Scope And Continuation

This change covers the Workbench managed subprocess and its ownership check. Normal Core + Workspace installation remains the required Chat assembly. Release qualification and live IM acceptance remain in the distribution RFC.

Validation

  • Tested revision: 5473fd669679f707d32215f572388dad913c2b0f
  • Run state: finished
  • Input classes: synthetic
Check kind Result Evidence
regression_parity passed The original installed pair accepted Chat help and refused managed startup with No module named loopx.cli. The fixed Core wheel starts Chat using the same Workspace wheel.
real_entrypoint passed macOS installed CLI started Chat, read dynamic project roots, reused the existing PID, and stopped and restarted the service. After loss of the Workbench lifecycle process, a changed port was refused, and the new launcher adopted and stopped the original Core created by loopx.cli. The fixture used the production private lifecycle and socket handlers.
real_backend passed Seven Core/Workspace distribution tests passed. The shipped Workspace read back the original settled task and Core replayed it after Workspace removal.
integration passed Nine TypeScript Workbench tests and 137 Python CLI, host-selection and delegation cases passed. Three Workbench cases were skipped.
static passed Standard premerge and Ruff passed. The maintainability check produced one advisory.

The complete Workbench frontend and native-login-service cases were skipped. The installed lifecycle probe used a small local daemon fixture and a real Chat HTTP service.

Frontend / Visual Evidence

UI impact: none.

Boundary Checklist

  • Public-safe evidence only.
  • The bilingual RFC diff check passed.
  • The commit includes a DCO sign-off.

Review follow-up

Revision fe4fa8c86e against main@0e784d7cba. The two-file patch is unchanged after reconciling main. Newly built Core and Workspace wheels passed dependency checks. The actual compiled Workbench launched Core through the installed entrypoint, reused its PID, refused a different port while it was running, and stopped it cleanly. A legacy Core process started through the former module, with a matching ownership record, was adopted and stopped by the same Workbench. TypeScript type checking, source tests (7 passed, 3 fixture-gated skips), quick premerge, Ruff, and diff checks passed.

Review follow-up

Revision 5df94df883 against main@2201defc62, after #10068. The two-file patch is unchanged. With matched installed Core and Workspace wheels, the base still failed to start managed Chat and left no managed record. The new Core started through its shipped entrypoint, reused the process, rejected a different port, stopped the owned process, preserved an external Core, and adopted and stopped a legacy owned Core. Fresh package checks, TypeScript type checking, quick premerge, Ruff, and the focused CLI suite passed (7 passed, 3 skipped; the separate installed probe used the actual compiled Workbench).

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>

@huangruiteng huangruiteng left a comment

Copy link
Copy Markdown
Collaborator

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.2-sol · OpenAI · runtime_reported · xhigh

本次没有阻塞性问题。

动机 / Motivation

安装 Core 和 Workspace 后从 Workbench 启动 Chat 的使用者会遇到分包入口差异。有匹配的 Core 和 Workspace wheels,在空闲端口执行 Workbench start --with-core。主干启动失败,候选能启动、读回、复用和停止同一个 Core。本次覆盖 macOS 本地 CLI 的受管 Core 进程生命周期。此前安装虽已提供 Chat 命令,Workbench 自动启动仍引用完整发行版模块。

改动思路 / Approach

本次覆盖 macOS 本地 CLI 的受管 Core 进程生命周期。在原生命周期内切换子进程入口,并保留旧记录兼容。新的模块名来自已装 Core 的入口,Chat 来自同版本 Workspace。复用现有探活、端口约束、PID 读回与停止路径,显式传入 --with-core 仍是自动管理条件。 安装契约

具体改动 / Changes

按 packages/loopx-workspace/README.md 的版本 53106f5b0c54c46cde7cf451929f16c559f86e52 核对 installed-chat-launch、managed-core-ownership 与 external-core-preserved。旧 launcher 复现缺失模块,候选由安装后的两个 wheels 启动真实 HTTP 服务并读回健康。重复启动保留同一 PID,请求不同端口遭拒绝。实际运行的旧入口进程可通过原记录读回和停止。缺省启动时外部服务保持可达,停止 Workbench 也未中断它。 启动 读回

对主干的风险 / Risks

快速预合并 5 个直接和 3 个选中检查通过,维护性检查有 1 项 advisory。对当前目标 main 试合无冲突。 9 项 TypeScript 与 4 项 Python 定向验证通过。macOS 实测使用生产 lifecycle socket handler 与真实 Chat。Workbench Web 全量重建因本地缺少 rehype-katex 未完成。Linux /proc 和原生登录启动未实测。 动作发生在页面加载以前,未引入首屏、设置或渲染差异。目标分支已有的 Steward socket 路径检查在试合结果中正常保留。 生命周期测试

我的整体评价 / Verdict

批准。原安装失败可重现,修复沿既有启动、状态和停止路径交付。真实新旧受管进程各自归属于相应记录,无记录的外部 Core 保持自己的生命周期。

英文简短结论

English verdict: APPROVE 5473fd6. The installed Core and Workspace pair starts Chat through its shipped entrypoint. Exact process ownership preserves reuse and stop for both launch forms, and the default external service stays independent.

…concile-10043-workbench-core-current-main-20261204

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
…concile-10043-workbench-installed-after-10068-20261204

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>

@cocolord cocolord left a comment

Copy link
Copy Markdown
Member 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

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

动机 / Motivation

安装 Core 和 Workspace 后,用户可以从 Workbench 主动启动本地 Chat。用同版本 Workspace 安装包做成对复验,主干 Workbench 启动分包环境中缺失的 CLI 模块,失败时没有写受管记录。当前提交改用发行包已有的入口,能启动真实 Chat 并在后续复用。当前提交成功启动、复用同一 PID、拒绝切换端口并停止所管的 Core。有效的旧记录仍可接管和停止,外部独立启动的 Core 在 Workbench 停止后继续可用。范围限于本地受管 Core 生命周期,分包发布、原生登录服务和 IM 仍走各自的验收流程。

改动思路 / Approach

复用已有 Workbench 受管记录,改用 Core 包提供的命令入口,并保留旧入口的进程归属。用户显式选择管理 Core 才会创建子进程。健康检查、端口约束和停止仍由原生命周期负责。重复启动使用原受管记录及健康检查。已有外部 Core 时,只报告健康状态,不接管它的生命周期。原先由完整 CLI 启动的进程也能沿用旧记录恢复。

具体改动 / Changes

依据 53106f5 的 packages/loopx-workspace/README.md 核对 installed-chat-launch、managed-core-ownership 和 external-core-preserved。成对验证使用同版本 Workspace 和实际编译的 Workbench,主干与当前提交分别使用各自的 Core 包。

关键代码讲解

  • ensureManagedCore 使用已安装的 CLI 入口调用 Chat,沿用本地健康检查和受管记录。重复启动不替换已有健康进程。
  • isOwnedCoreProcess 核对受管记录对应进程的启动形式和端口,支持现入口和旧入口。无法确认归属时按非受管处理。
  • stopManagedCore 沿用原有受管停止权限。两个文件增加 26 行、删除 15 行,源测试加入了实际子进程入口的断言,记录格式保持一致。

对主干的风险 / Risks

需要实际验证更新后能处理旧记录、且停止 Workbench 不会误停外部 Core。探针对照确认主干失败时没有生成记录,新版本会复用同一个 PID,拒绝不同端口,正常停止所管进程。测试独立启动的 Core 在外接时始终报告非受管,停止 Workbench 后仍能访问。有匹配旧记录时,同一旧入口进程可以接管并停止。TypeScript、quick premerge 和 7 个源码用例通过,有 3 项源码用例跳过。独立实装探针使用实际编译的 Workbench,Linux 进程读取、原生登录服务和生产 IM 未覆盖。

我的整体评价 / Verdict

这项改动修复了正常安装后的真实启动失败,用户继续使用已有命令,旧记录与外部进程的归属也保留下来。实际变更在本地 Workbench 的子进程生命周期,界面呈现和交互布局保持原样。 当前验证支持这项局部变更,未引入新的进程记录格式或权限。

English verdict: APPROVE 5df94df. Paired installed Core and Workspace checks reproduced the baseline startup failure and verified actual Chat startup, same-PID reuse, conflicting-port refusal, owned shutdown, legacy adoption, and external Core isolation on macOS.

@cocolord
cocolord merged commit 9a70cb1 into loopx-project:main Dec 4, 2026
27 checks passed
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.

2 participants