Repository navigation
Conversation
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh
动机 / Motivation
通过 pipx 或 uv 的私有 Python 环境调用已导出的 Core CLI 时,其他已安装脚本可能未进入 PATH。 基线只能从 PATH 查 Node。候选沿用 PATH 第一优先级,在没有命中时查当前解释器的 scripts 目录。
候选在相同的隔离 wheel 用例中创建 SQLite Goal 并用 status 读回。另三种路径的准入结果与基线一致。
本轮独评覆盖 macOS 的隔离 Core wheel 与 SQLite。D1 的发布形态及真实 Windows 执行留在原验收范围。
改动思路 / Approach
五文件,新增 66 行、删除 16 行。生产变更只有共享探测和既有 scheduler 入口。 共享 Node locator 给 Effect 启动探测、deep readiness 与已绑定的 scheduler follow-up 提供选择。现有版本检查和执行准入仍由原 owner 处理。
具体改动 / Changes
- PRIVATE。隔离安装能用私有 scripts 的真实 Node 创建和读回 Goal。 独立验证通过。 node_probe.py
- PRECEDENCE。外部优先、缺失和版本拒绝保留。 独立验证通过。 entrypoint.py
关键代码讲解
- PATH 优先,缺失才查当前脚本目录。 resolve_node_executable
- 原生调度沿用同一定位器和转发约束。 _native_scheduler_followup_argv
- 核对 PATH 命中和备用目录可执行性。 test_node_resolution_prefers_path
- 用只在 scripts 可见的 Node 检验 receipt-bound argv。 test_console_entrypoint_selects_only_receipt_bound_native_scheduler_followup
- 缺 Node 仍在产生后续效果前给出类型化诊断。 decision capture missing Node diagnostic
对主干的风险 / Risks
四种安装输入在基线和候选各跑一次。候选的 201 项定向测试与 quick premerge 九项检查通过。正例使用真实 Node,PATH 旧版控制使用只返回版本的本地脚本。
安装入口出现的新成功只有私有 scripts 这一项;正常外部 PATH、外部旧版本和完全缺失行为保持一致。
未改变 Node 的发布形态。候选 wheel 中入口与探测模块字节均与精确提交一致。
我的整体评价 / Verdict
通过。 同一隔离 wheel 对照中,私有 Node 能被定位并通过真实 SQLite 创建和读回。
外部 PATH 的优先级和版本拒绝经配对复验。原生 Windows 安装沿用既有资格,未在本轮重跑。
English verdict: APPROVE at d37c9b4. The exported Core CLI now finds Node installed in its own Python environment. Paired standalone wheels verified SQLite readback, PATH precedence and failure before writes.
…0073-queue-current Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
…concile-10073-node-scripts-current-main-20261204 Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
…concile-10073-node-tool-environment-after-10069-20261204 Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
cocolord
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · GPT-6 · OpenAI · self_reported
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机 / Motivation
从独立 Python 工具环境启动 Core 的用户会遇到这个问题,例如工具只把 LoopX 命令导出到 PATH。同一个工具环境里已经有 Node 时,旧版 Core 在 PATH 找不到 Node 就拒绝初始化 SQLite 注册表。新版能用当前 Python 的脚本目录找到它,完成初始化并读取状态。用主干和当前提交对应的 Core 安装包复验,旧版拒绝时未创建注册表,新版能创建 SQLite 注册表并读回状态。这条改动复用已安装的 Node,打包分发 Node 和原生 Windows 验收仍属于各自的范围。
改动思路 / Approach
把查找 Node 的顺序集中到现有运行时探测模块,让普通启动和原生调度入口共享同一规则。这一改动只选择本机已经安装的可执行文件,版本探测和调度授权仍由原来的代码处理。 PATH 中的 Node 优先使用,包括版本过旧的情况,仍交给原探测逻辑报错。只有 PATH 查找失败时,才检查当前解释器的 scripts 目录。复用 Python 的安装布局让命令适用于导出的工具环境,也避免在其他解释器或系统目录里猜测可执行文件位置。
具体改动 / Changes
依据 f8f19b1 的 docs/architecture/rfcs/monorepo-distribution-split-v0.md 检查。V1 在所测试的 Core 路径上使用当前环境已安装的依赖。D1 涉及 Node 本身的分发,这条只访问已经安装的版本,整个发布组合仍由分包工作验证。
关键代码讲解
resolve_node_executable先查 PATH,再按当前解释器的 scripts 路径检查可执行文件。Windows 候选名是 node.exe;候选为目录时拒绝。probe_node使用同一定位函数,沿用最低版本和带超时的版本探测。缺失诊断能解释两个位置,故障引导针对实际选中的启动器。_native_scheduler_followup_argv在验证已有调度入口、宿主事实和 Turn ID 后才选择 Node。宿主的保护条件及随后的参数序列保持一致。五个文件增加 66 行、删除 16 行,覆盖了定位、诊断和生成命令三个使用点。
对主干的风险 / Risks
最需要保证的是 PATH 优先级和写入前检查。把一个旧 Node 放在 PATH 上时,它仍先被选中并拒绝,两个位置都没有 Node 时也仍在建立注册表前退出。成对的实装 Core 测试验证了缺少 PATH Node 时的新旧行为,当前 wheel 还验证了 SQLite 状态读回。原生调度用的是已安装入口的参数选择测试,检查缺少绑定参数时不选择原生入口,无生产调度写入。521 项源代码回归及 quick premerge 通过。Windows 的脚本命名由测试覆盖,真实安装的成对复验在 macOS 完成。
我的整体评价 / Verdict
这项改动让已有私有 Node 的导出工具可以直接继续初始化和读取状态,减少反复激活环境的操作。PATH 已能解析 Node 时,用户仍沿用同样的命令、版本门槛和检查。检查范围是 Core 的命令行、诊断和调度入口,没有渲染界面改动。 变化只涉及本机依赖发现,现有错误码和调度授权范围继续复用,实装对照和负例足以支持批准。
English verdict: APPROVE 126c7ea. Paired installed Core checks show private Node enables SQLite initialization and status readback without PATH activation. PATH precedence, missing-Node rejection and receipt-bound native argument selection are preserved. All 521 source tests passed.
Goal And Delivered Outcome
A Core command exported by pipx or
uv tool installcan use a private Python interpreter whose scripts directory is absent from PATH. On the baseline, the exported command returnsnode_unavailableeven with an executable Node installed beside the private interpreter.Core now checks that interpreter's scripts directory when its existing Node lookup on PATH finds nothing. Effect startup, deep readiness and the receipt-bound scheduler follow-up share the locator. A Node found on PATH retains precedence, including the existing version refusal for an unsupported executable.
Author Declaration
resolve_node_executableand installed Core comparisonsSelf-check covered the actual installed entrypoints, the scheduler's shared resolver, and the missing and unsupported Node diagnostics.
Scope And Continuation
The repair is limited to executable discovery and its diagnostics. The package inputs in the experiment used a local runtime dependency fixture and a platform wheel fixture that placed the same pinned executable in the interpreter's scripts directory. D1 and M3 still require the release layout and same-release acceptance.
Validation
d37c9b4e15ce4e37e162159271475acd5aa39322real_entrypointpassedloopxentrypoints with pinned Node 22.22.3.real_backendpassedloopx connectand read it back throughloopx status. Missing, unsupported, and uninstalled Node returnednode_unavailablebefore registry creation.regression_paritypassedunitpassedstaticpassedreal_entrypointpassedreal_entrypointpassedFrontend / Visual Evidence
Type of Change
LoopX Area
Boundary Checklist
Native Windows installed comparison
Windows x64 and Python 3.11.9 on the exact baseline and candidate recorded above. The native run passed all 14 paired cases. With Node absent from the caller PATH, the candidate's pipx launcher, uv tool launcher, ordinary venv launcher and platform-wheel launcher completed SQLite connect and readback. The other ten controls had matching outcomes, including PATH precedence, an older external Node, companion removal and uv tool run. The trial produced an 8.15 MB bare Core wheel, a 33.20 MB Node companion wheel and a 41.35 MB bundled Core wheel. Windows run
Review follow-up
Revision
e536bdcd54againstmain@5d7ac0e622. Synced the existing Node discovery fix with current main. All 52 focused Node discovery, startup, entrypoint and Turn capture tests passed, including the Python scripts-directory fallback and missing-Node paths. Scoped Ruff passed. This update leaves the proposal behavior unchanged.Review follow-up
Revision
1da4112a1aagainstmain@0e784d7cba. The proposal diff is byte-for-byte unchanged against current main. A freshly built Core wheel from this revision used Node v26.0.0 in the Python scripts directory with Node absent from the caller PATH, created a synthetic SQLite Goal, and read it back through the installed CLI. Separate cold runtime scopes verified refusal before registry creation when Node was missing or when an unsupported launcher was first on PATH. The focused source suite passed 39 cases, along with Ruff and quick premerge.Review follow-up
Revision
126c7ea479againstmain@f8f19b11ed. The same five-file patch is reconciled with main including #10069. A freshly installed standalone Core used Node from its Python tool environment with Node absent from PATH. SQLite setup and status readback passed. With no Node, it refused before registry creation; an older Node on PATH kept precedence and was correctly rejected. The 35 focused source cases, dependency check, Ruff, and quick premerge passed.