Repository navigation
Fix the scheduler budget-stop smoke with progressive delivery enabled - #8277
Conversation
Signed-off-by: LoopX Agent <337587101+loopx-agent@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
动机 / Motivation
维护 benchmark worker 的开发者需要用 smoke 检查阶段预算耗尽时是否还会启动 Host。 渐进式交付默认启用后,测试在准备阶段拿到供 Agent 使用的读取入口,直接取 should_run 时崩溃,预算停止分支连一次都没有执行。 修复让测试的前后探针明确读取原始 scheduler 决策,五种执行模式重新验证停止回执、Host 启动、待处理 Turn 和扣额。 改动限于源码测试的 quota 观察方式,验证使用本地合成 Goal 与实际 CLI/worker。 结论覆盖五种源码模式与原始回执。生产安装和正式 benchmark 运行没有纳入该测试。
改动思路 / Approach
smoke 先读可运行的 synthetic Goal,再执行原 worker。Heartbeat 和 Turn 经过现有 external scheduler,其余三种直接走 worker。读回覆盖停止回执、Host、pending Turn 和 quota。 生产 shell scheduler 的 build_should_run_command 已要求直接决策并带同一个 off 参数。smoke 使用现有 CLI 语义,独立运行真实 worker,预算判定和原断言由原 owner 承担。 本次只修一处测试调用。使用独立的真实运行路径保留时钟、回执、无 pending Turn 和扣额断言,足以恢复这条防线。
具体改动 / Changes
基线为 3e3e3f841fb46c84c59fd31c94c88c15719a4085。阶段 allowance 耗尽应留下唯一 stop receipt,且保留原待执行任务与扣额。 基线规范
- 预算停止回执。 Heartbeat、Turn、plain、native-goal、loopx-goal 五种模式均实际启动 worker 入口,各留下一个预算停止回执,Host 启动次数为零,未建 pending Turn,前后扣额一致。
- 读取模式隔离。 Git 清单仅改测试文件。基线同一 CLI 显式关闭交付时已能返回直接决策,产品 shell scheduler 命令与实际 worker 无差异。
关键代码讲解
test_real_scheduler_stops_after_one_budget_exhausted_wake 的前后探针现在拿到原决策,后续照常用 worker_command 启动真实路径。生产 build_should_run_command 已把 off 用于同一类观察。测试自身也按实际文件读回停止回执和 pending Turn。 测试探针 生产 scheduler worker 入口
对主干的风险 / Risks
基线的五例均在准备阶段取 should_run 时抛出 KeyError。实际 CLI 返回 context_capture_navigation_v1,同一基线和同一 fixture 增加 off 后直接返回 should_run=true、scheduler detail 和 0 个已扣额度。
默认 test extra 跑完整文件为 52 通过、50 跳过。与最新主干 7108b923 的隔离组合中,预算停止五例全部通过。 隔离环境补齐 Harbor 0.20.0 后,head 101 通过、1 失败,base 96 通过、6 失败。 Quick premerge 的 5 项直接检查和 3 项选中检查通过。benchmark 路径保留人工合并检查。 双方同一未改动的 Harbor [850] 交接超时用例都报 DID NOT RAISE TimeoutError。 远端 CI 未取样。
我的整体评价 / Verdict
批准 be5e12f01d50a3069e9c5426611fe18b0beda27f。阻塞发现 0 项。四行测试差异恢复了阶段停止的独立验证,复用当前 CLI 和 benchmark worker 的既有约定。 结论覆盖五种源码模式与原始回执。生产安装和正式 benchmark 运行没有纳入该测试。
English verdict: APPROVE. The smoke reaches all five real budget-stop paths and confirms one stop receipt per mode, zero Host dispatch and unchanged quota.
The real scheduler budget-stop smoke was failing before it reached the worker: the probe read
should_rundirectly from a progressive reader response. The probe now requests the direct quota result, matching the scheduler's machine-facing read. Agent-facing progressive delivery and scheduler behavior are unchanged.The five execution modes reproduce the same pre-dispatch failure on unmodified main and C1. After the fix, each mode returns exactly one budget-stop wake receipt, starts no Host, and leaves quota unchanged. The focused main run passed 50 cases, including the retained interruption fixtures; two cases requiring a disposable Docker environment were skipped.