fix(replan): exclude monitors from agent long-chain thresholds - #5004
Conversation
Signed-off-by: Jim-jimu <49069997+bmh201708@users.noreply.github.com>
…reshold Signed-off-by: Jim-jimu <49069997+bmh201708@users.noreply.github.com>
…reshold Signed-off-by: Jim-jimu <49069997+bmh201708@users.noreply.github.com>
huangruiteng
left a comment
There was a problem hiding this comment.
动机
#5001 描述的混合负载(9 项已认领推进任务、19 项持续监控)会被旧的“20 项已认领 open Todo”分支误判为长链,强制打断本可继续的 Agent lane。相同真实 CLI 回归在基线 d64c4d3 失败,在本 head 通过;15 项推进任务仍触发,因而这次改动完成了该 issue 的 Agent-lane 目标。
改动思路
沿用现有 TypeScript frontier 决策 owner:Python 只投影持久 Todo 的 task_class、claim 与 frontier 计数,evaluateLongTodoChain 决定阈值,goal-frontier/配额消费 obligation。不新增状态或第二套规则。Agent lane 只看自己已认领的推进任务;无 Agent 的 Goal 总览仍保留原 selectable-open 口径。历史 20-open checkpoint 只在读取/后继恢复路径保留。
具体改动
关键代码讲解
frontier_revision.ts:234 evaluateLongTodoChain:把 20-open 分支限定在agent === null,Agent lane 的新触发只剩 15 项 claimed advancement;同时收窄新 observation 的count_kind。frontier_revision.ts:149 successorCheckpoints:保留历史 open-count 前置义务恢复,仍要求唯一新后继、完整匹配源和由 Python 消费方核对的 origin obligation ID。- TypeScript 测试覆盖 9+19、14+6、15+19、监控增长后的 ACK 稳定性及历史 checkpoint;真实 CLI 测试覆盖首读和 replay。协议、状态机、迁移 RFC 中英两版同步披露旧/新默认值。
对主干的风险
未发现阻塞项。最重要的误回归是监控增长再次让 15 项以下的 Agent lane 进入强制 replan;定向 TS 24/24、真实 CLI/Python 51/51、typecheck 和标准 premerge 均通过。premerge 的 19 项检查无阻塞失败,另有一项未改动 Lark 文件的既有 maintainability advisory,应继续记录但不归因于本 PR。未跑全仓、Windows、PostgreSQL 或 live-model;本变更不修改 provider 写入/存储。
语义与 CI 对齐
这次是已披露的默认行为变更,复用现有 long_todo_chain vocabulary、TypeScript 决策 owner 和持久 ACK 格式;无新权限或可选功能的 default-off 语义。Goal 策略 wait_for_ci=false,本评审未将远端 CI 作为证据或等待条件。
我的整体评价
APPROVE(exact head 934e704)。修复比在 Python 再做一次监控减法更局部,生产改动可逆,历史读侧兼容有针对性测试。剩余风险是无 Agent 总览有意保留 20-selectable-open 阈值,以及未做持久化 pre-upgrade 活跃义务的现场 replay;它们不阻塞 #5001 的 Agent-lane 修复。相邻边界的前瞻性简化已体现在收窄新 observation union,未看到需要并入的更大重构。
English verdict: APPROVE - exact head 934e704; no blocking finding; 24 TS and 51 Python tests, typecheck, and risk-based premerge passed (one inherited advisory).
Signed-off-by: Jim-jimu <49069997+bmh201708@users.noreply.github.com>
Goal And Delivered Outcome
long_todo_chainobligation because the old alternative threshold counts all 28 open Todos as backlog.mainatd64c4d3772400c958d51b773f1e1e165cbaca801.Scope And Continuation
Validation
934e704065c3c66f0d773334ee12766b971710c5finishedsynthetic,public_fixtureregression_paritypassed90f21a5299188d54f984a5313e774c9ac48d6595, the same updated tests fail in two TS cases and the 9+19 / 14+6 managed-CLI cases because a long-chain obligation is emitted. All pass on the tested revision.unitpassednode --no-warnings --experimental-strip-types --test tests/control_plane_ts/frontier_revision.test.ts tests/control_plane_ts/replan_semantics.test.ts: 24 passed. Covers mixed workloads, ownership isolation, monitor-growth ACK stability, complete-source fences, and historical checkpoint recovery.integrationpassedtest_python_runtime.test.ts,monitor_successor.test.tsandquota_monitor_poll_commit.test.ts: 29 passed. Confirms the updated Python selector and adjacent monitor tests work with the contribution.real_entrypointpassedtests/control_plane/test_long_chain_projected_closeout.py: real CLI admission and replay of all three mixed workloads, plus the existing durable writeback/spend/rearm journey. All state is disposable.staticpassednpm run typecheck:control-plane, Ruff on the changed Python test, andgit diff --check.integrationpassedpython examples/control_plane/cli-output-budget-regression-smoke.py.integrationpassedloopx canary premerge --from-git-diff --git-diff-base origin/main: gate passed; 19 selected checks and 4 direct checks executed, with zero blocking failures and one advisory failure disclosed below. Public-boundary scan passed. Hereorigin/mainis the upstream repository.staticfailedloopx/extensions/lark/goal_topic_runtime.py. Reproduced on unmodified baseline90f21a529; no budget was changed.staticfailedno-any-returnatloopx/control_plane/coordination/local_authority_shadow_projection.py:100. The identical error reproduces on unmodified baseline90f21a529with mypy 1.20.2.Frontend / Visual Evidence
none. CLI and managed-Turn projections consume the shared threshold decision; no setting, editor or frontend component changes.nonefor visual evidence.Type of Change
LoopX Area
Technical Direction
Shared-authority RFC fixture impact
Boundary Checklist
.loopx/,.codex/goals/, and liveACTIVE_GOAL_STATE.md).none.Signed-off-bytrailer (git commit -s).