Repository navigation
Conversation
Signed-off-by: aihop <4408344+hhyykk@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent; gpt-6.1-sol; OpenAI; runtime_reported; reasoning_effort=max.
动机
通过 CLI 读取、确认或上报 Inbox 请求的 Agent 和维护者。原来每次 Inbox 命令都会加载整套兼容 CLI,带修订的上报还会重复识别运行代码;即使只提交一条结论,也要支付这些额外启动成本。当前提交让正常 Inbox 命令复用已有精简分发入口;本次实测整条 CLI 明显加快,确认、拒绝、重放和持久化结果保持一致。此改动不增加请求权限,不缓存请求内容,也不把“记录结论”升级为“已向对方发送”。
完整迁移的常驻内存、冷原生启动、安装态 App、跨平台与真实 Agent 长程任务收益仍须按原迁移方案分别验收。
完整评审 d941ee98c599e6edf5a006d14e6cbe8e07010b86,基线 68e99ad93ef1954a0bf90ad7158ffb85cf365f2d,覆盖全部 6 个文件。作者提供的测量作为上下文,下面的结果均由本次评审重新执行。
改动思路
A second dispatcher or process-global cache would add invalidation/authority risk. The existing shared synchronous dispatch is the correct owner and already supplies the scope, so the change eliminates duplication and leaves source IO live.One existing synchronous CLI family is adopted; native protocol/recording/actual asynchronous delivery, other CLI families and parent migration acceptance are outside this slice.
| 路径 | 基线 | 当前提交 |
|---|---|---|
| 正常 Inbox 命令 | 加载完整兼容 CLI,独立 Inbox 分支 | 既有按命令 parser → 共享 dispatcher |
| 完整兼容 CLI | 自己的 Inbox 分支 | 同一个共享 dispatcher |
| 状态、权限与结论 | 原 handler、实时来源和记录语义 | 保留原 owner;记录仍不等于发送 |
表格说明本次源码的调用关系,不代替执行证据。用户继续使用原命令或原管理入口,无需新增设置、重填已知信息或增加确认轮次;也没有以优化为理由删除原有权限检查。
具体改动
关键代码讲解
_SELECTED_COMMANDS与 parser 只增加已有manager-inbox注册入口,没有复制动作、选项或默认值。非法输入仍回到完整 parser 生成原诊断。_dispatch_common_command复用同一个handle_manager_inbox及 registry/runtime 解析。外层 native-controller guard 仍先执行;实际既有策略对 Inbox 的允许与拒绝范围均未改变。dispatch_common_command已提供单次代码身份作用域,因此删除cli.py的重复分支即可覆盖完整兼容入口,无需新缓存。源码断言及真实命令确认新路径不加载loopx.cli。
规范依据是 docs/architecture/rfcs/typescript-control-plane-migration-v0.md,固定版本 68e99ad93ef1954a0bf90ad7158ffb85cf365f2d,在读取实现差异前已经核对。§2.4 约束复用既有 owner;§2.5 保留原输入、诊断与验证顺序;§5 要求实际调用者与成本证据;§6 的 File/SQLite、正常安装包和本次完整 CLI 验证已有当前结果,冷原生启动、RSS、App、跨平台与真实任务收益仍为分开的资格项;§7 仍由既有请求作用域维护代码身份、退出与下次读取。中英文 RFC 同时修改,内容未降低这些条件。
对主干的风险
最危险的回退是新分发入口丢失接收者、修订或 controller 检查,或者把持久化结论误报为已发送。File、SQLite 和精确 Goal 修订来源三种边界的 22 组完整 payload、native method 与持久化 entry/decision/conclusion 对照一致,包含未评估上报、确认、重复确认、冲突、修订过期、上报及重放。拒绝时存储不变,成功仍为 delivered:false。独立旧实现和强制回退 mutant 均触发“不应加载完整 CLI”断言,当前 head 通过;外层 guard 被实际调用,策略未被悄悄加强或跳过。
本次 265 项 Python、24 项 native 测试通过。wheel 与 sdist 重新构建后正常安装到两个独立环境,从空 cwd 调用真实 console,File/SQLite 共 36 个正向、拒绝、重放、独立读取案例通过,声明状态字节不变。性能为 macOS/Python3.12/Node24.21、已预热 native、每种来源与 0/32 条历史各 15 个全新 Python CLI 进程;六组 p95 从 421–460ms 降到 158–218ms,SQLite 为 459.60→162.40ms、451.21→174.24ms。全部样本与模块来源保留,计入完整 Python 进程和真实 provider IO,未将 RPC 次数代作耗时。
语义与 CI 对齐
标准风险 premerge 的 6 项 direct 检查通过,19 项选中检查中 18 项通过、输出差分一项失败。对此没有更改预算:固定最新 main 5bf58c1ca3d21919b15c662bc705c3e069bfb496,原始基线与当前 head 都得到逐项相同的 15 个失败,含规划/action schema 与 3 个 status Markdown 增长 38 字符、上限 32 的失败。相关 quota/status owner 与该检查的因果路径未被此 PR 改动。单独以真正 PR 基线比较 head 的完整 CLI 输出预算通过。这是已独立归因的既有集成红灯,原 premerge 仍记失败,合并前仍要在集成后的精确 head 解决或通过该检查,不能用本次 approval 绕过。
未查询或等待 CI。首次分发构建被本地过期的忽略态 Chat 资源拦住;从当前源码重建资源后,两种正常安装都通过,未修改版本库源码或共享默认 CLI。没有复跑 Windows、真实 PostgreSQL、冷 native 启动、RSS/长时压力、安装态 App 或模型任务;这些仍是原迁移方案的独立资格。
我的整体评价
APPROVE — justified_increment。 既有 dispatcher 的实际接入减少完整 CLI 成本,全部拒绝与记录语义保留;原 main 相对检查红灯继续作为集成门。 这认可当前有实测收益、可独立回退的调用者接入增量,不关闭父级迁移或真实长程任务收益验收,也不授予合并权限。
English verdict: APPROVE for exact head d941ee98c599e6edf5a006d14e6cbe8e07010b86. The selected Inbox dispatcher lowers complete CLI cost while retaining full state, diagnostics, replay and recording-versus-delivery semantics across real local boundaries and normal installed distributions. The identical 15-row base/head main-relative validation failure remains an integration hold; no hard budget or merge gate is waived.
Goal And Delivered Outcome
Normal
manager-inboxcommands load the full compatibility CLI, although the selected-command dispatcher already provides the same parser and native runtime request scope. This adopts that existing path and deletes the duplicate compatibility dispatch branch. Inbox command inputs, outputs, guards and durable effects stay the same; unrelated CLI imports disappear.68e99ad93ef1954a0bf90ad7158ffb85cf365f2d.unexpected module import: loopx.cliand passes with identical response/receipt bytes on the new entrypoint.main; complete within this CLI scope.Author Declaration
Implemented against
Specification:
docs/architecture/rfcs/typescript-control-plane-migration-v0.md, revision68e99ad93ef1954a0bf90ad7158ffb85cf365f2d.loopx/cli_runtime.py, normal installed CLIloopx/cli.py; compatibility CLI uses the shared dispatcherSelf-check: production, test and docs guard review; related tests, real disposable File/SQLite records, installed artifacts and fresh main integration. No real model or external delivery qualification claimed.
Scope And Continuation
cli_runtime.pyor changes Inbox dispatch hunks. refactor(todos): compose full readback in one TypeScript transaction #6874/perf(control-plane): reuse acceptance reads within one Todo snapshot #6984 concern Todo reads; refactor(collaboration): converge return delivery and restart recovery in TypeScript #6855 concerns return delivery/recovery. Shared RFC/README edits and unrelatedcli.pyhunks are acknowledged; there is no duplicate implementation.Validation
d941ee98c599e6edf5a006d14e6cbe8e07010b86on68e99ad93ef1954a0bf90ad7158ffb85cf365f2d.delivered:falseComplete-command performance
Linux; Python 3.11; Node 24.21.0 / SQLite 3.53.4; disposable synthetic Goal. Each sample starts a fresh Python CLI process, uses a warm managed native runtime and records a new result update. Includes parsing, imports, registry lookup, source reads, RPC and durable result recording. The harness asserts loaded Python and TS roots; each child emits a source-origin proof. No timestamp normalization beyond a fixed semantic-fixture clock and disposable-root substitution.
Fresh final comparison: main
68e99ad93ef1954a0bf90ad7158ffb85cf365f2dversus this HEAD, 15 samples per arm per history; all seven SQLite semantic/persisted-state observations match.Supporting pinned-base repeated/reversed SQLite series (30 samples/arm/history) measured p95 1,096.8 → 386.7 ms and 1,135.5 → 363.6 ms. File/controlled profiles (15/arm) also improved. That earlier baseline was
98709770d80e9c332f3c07d2b545226a6dd17521; the five measured runtime files have unchanged hashes after rebase. Earlier cwd-contaminated and CPU-contended study runs were excluded, not pooled into these figures.These results qualify this CLI overhead change only. They do not measure task success, model quality, token savings, cold native-runtime startup or the entire LoopX application. Full repository tests, Windows, PostgreSQL, browser flows and real model/provider delivery were not run for this scoped change; hosted CI is separate.
Portable qualification harness and reproduction
Save the script below as
qualify.pyoutside both checkouts. Install repository Python dependencies and runnpm ciin both checkouts. Use a qualified Node runtime (the run above used 24.21.0 / SQLite 3.53.4), the same Python interpreter, and idle the machine. Outputs must be separate empty directories. Run sequentially:Compare
receipt.jsonrows for exact equality;performancecontains every sample and method count, andsubprocess_import_receiptsproves actual module origins. Synthetic fixtures only; the script disables usage pings and stops its managed native runtime.Harness SHA256:
703773c33713122c8bbcbfccd7e2201e49573f18f102998d464f55beb8833742.Frontend / Visual Evidence
UI impact: none. No dashboard, browser behavior or presentation surface changes; the paired RFC text documents caller ownership only.
Change Area
Technical Direction
Existing TypeScript control-plane migration, Stage 3 caller adoption. Semantic ownership is unchanged.
Shared-authority RFC fixture impact
Boundary Checklist
python3 scripts/check_rfc_bilingual.py --base origin/main --head HEADpasses.