Repository navigation
fix(quota): bound blocked-frontier Vision baseline initialization - #8574
xiaobaifly7 wants to merge 1 commit into
Conversation
Signed-off-by: xiaobaifly7 <196511160+xiaobaifly7@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
评审提交 2938c338851793a4e487bf4381ce7b8b10a4cb0d。结论 REQUEST_CHANGES。
P2 等待回执在重试时绕过一次性初始化限制
等待回执绑定了重规划身份。用同一个等待 Turn ID 重读后,回执升级,返回 should_run=true、must_attempt=true 和结算计划。 从原始正向准入回执派生豁免。安静等待应保留诊断义务,避免写入能在重试时绕过限制的结算身份。
P2 准入回执写失败仍消耗唯一初始化机会
只在真实 CLI 的 rollout 追加点注入 OSError。首次 guard 返回 heartbeat_receipt_write_failed,磁盘上已有准入 sidecar。修复 IO 后,新的 Turn 返回 agent_scope_wait。仍持有失败 Turn ID 的调用方可以原样重试并成功准入。 在现有回执提交边界确认一次性初始化,或把预留与真实回执对账,在明确失败后恢复资格。
动机 / Motivation
处理阻塞 Todo 的 Agent 需要一次有明确结算身份的 Vision 基线初始化,并能在后续唤醒进入安静等待。 自治重规划只剩缺失的 Vision 基线时,主干会为没有可执行 Todo 的 Agent 再次返回 run_now。 候选首次等待是安静的。两个新的 Turn 各自在相同身份下重试后都重新取得执行权,正常重试可以绕过单次初始化上限。 检查覆盖真实 CLI、回执和调度投影,执行范围到启动判定为止。
改动思路 / Approach
复用现有 agent_scope_wait,保留原始初始化身份,让等待和回执协调读取同一个有效准入事实。 新增本地准入记录需要与已有 heartbeat receipt 的真实状态一致,现有回执协调负责解释重试资格。 设计问题 #8572
具体改动 / Changes
10 文件,+299/-3。生产 +110/-2,测试和 fixture +189/-1。 新默认策略仍需 maintainer 决定。NEW-ADMISSION 的首次决策通过。ORIGINAL-RECEIPT 的同身份接续在下述情形失败。OWNER-STOP 仍走既有前置检查。主干基线 beff0f3e55d1f70eceebbd8e78c11f1cff34643b。docs/quota-allocation.md
build_quota_should_run。把结算绑定的存在直接转成 receipt_bound,进入 TypeScript 的豁免分支。 loopx/control_plane/quota/should_run.pyboundVisionBaselineAdmission。持锁写入一次性记录,并对后续新 Turn 投影安静等待。 loopx/control_plane/quota/vision_baseline_admission.tsquota_rollout_settlement_binding。结算计划为空时仍从诊断义务推导绑定,等待记录因此带上重规划身份。 loopx/control_plane/quota/settlement_cli.py
对主干的风险 / Risks
额度 1/0,原 Turn 已获得正向回执。另开两个 Turn,各自第一次查询均安静等待,使用各自同一 ID 再读 guard 后均升级成正向重规划。 只在真实 CLI 的 rollout 追加点注入 OSError。首次 guard 返回 heartbeat_receipt_write_failed,磁盘上已有准入 sidecar。修复 IO 后,新的 Turn 返回 agent_scope_wait。仍持有失败 Turn ID 的调用方可以原样重试并成功准入。
首次真实准入返回 autonomous_replan_required,首次新 Turn 安静等待。独立任务和到期监控的 File、SQLite 对照通过。 Python 109 项、TypeScript 91 项、控制面 typecheck、Ruff、quick premerge 6 项直接检查及 3 项选定检查均通过。
合成数据通过真实 CLI 和 TypeScript Effect runtime,分别用 File 与 SQLite Todo authority 验证。安装后的宿主和远端 CI 尚未复验。
我的整体评价 / Verdict
从原始正向准入回执派生豁免。安静等待应保留诊断义务,避免写入能在重试时绕过限制的结算身份。 用同一夹具验证原身份、新 Turn 和重复读取的结果。另加回执追加故障并验证修复后的重新准入。
English verdict: REQUEST_CHANGES for 2938c338851793a4e487bf4381ce7b8b10a4cb0d. A quiet wait receipt becomes executable on same-Turn replay. A failed guard append also consumes the sole initialization admission.
| prepared.vision_initialization_context = { | ||
| "runtime_root": str(runtime_root), "goal_id": safe_goal_id, | ||
| "agent_id": prepared.agent_frontier_id, "turn_instance_id": turn_instance_id, | ||
| "receipt_bound": bool(receipt_bound_todo_id or receipt_bound_replan_obligation_id), |
There was a problem hiding this comment.
[P2] 等待回执在重试时绕过一次性初始化限制
等待回执绑定了重规划身份。用同一个等待 Turn ID 重读后,回执升级,返回 should_run=true、must_attempt=true 和结算计划。 从原始正向准入回执派生豁免。安静等待应保留诊断义务,避免写入能在重试时绕过限制的结算身份。
| if (!previous) { | ||
| const admission: VisionBaselineAdmission = {schema_version: BASELINE_ADMISSION_SCHEMA, ...scope, | ||
| turn_instance_id: turn, replan_obligation_id: requireNonEmptyString(obligation.obligation_id, "obligation_id")}; | ||
| await durableWriteJson(path, admission); |
There was a problem hiding this comment.
[P2] 准入回执写失败仍消耗唯一初始化机会
只在真实 CLI 的 rollout 追加点注入 OSError。首次 guard 返回 heartbeat_receipt_write_failed,磁盘上已有准入 sidecar。修复 IO 后,新的 Turn 返回 agent_scope_wait。仍持有失败 Turn ID 的调用方可以原样重试并成功准入。 在现有回执提交边界确认一次性初始化,或把预留与真实回执对账,在明确失败后恢复资格。
|
This pull request has merge conflicts with Choose the remote for the base repository, not an out-of-date fork. git fetch upstream
git rebase upstream/main
# Resolve each conflict, git add the resolved files, then git rebase --continue.
git push --force-with-lease origin HEADFor a same-repository clone whose Keep the DCO |
Goal And Delivered Outcome
agent_scope_waitcontract while preserving the missing baseline obligation. The same synthetic input on pinned main returnedautonomous_replan_requiredagain on a fresh Turn.main. This is standalone, not stacked on fix(quota): wait when the only scoped work is blocked #8511.Author Declaration
Implemented against
agent_scope_frontier_v1/agent_scope_waitbehavior is reused.quota/vision_baseline_admission.ts::boundVisionBaselineAdmissionagent_scope_frontier, existing interaction/scheduler projectiontest_missing_vision_baseline_wait.py::assert_waitchecks no attempt/delivery, quiet wait and scheduler backoffScope And Continuation
POLICY CHOICES
agent_scope_wait/ scheduler backoff while retaining the pending Vision obligation and the original admission identity in the frontier. No quota debit or successful-baseline receipt is fabricated.These are proposed conservative defaults, not a claim of a prior maintainer ruling. Maintainers may change the allowance, consumption point, scope or rearm rule.
Validation
build_quota_should_runwith disposable runtime and real File/SQLite authority; fresh Python process reads the durable admission and waitsautonomous_replan_required; same synthetic scenario on this branch waits after initializationPYTHONUTF8=1passes without a source/config changeLOOPX_USAGE_PING=0; Windows commands also usePYTHONUTF8=1):Frontend / Visual Evidence
Type of Change
LoopX Area
Technical Direction
Shared-authority RFC fixture impact
Boundary Checklist