Repository navigation
Preserve explicit Monitor Todo selection in quota polling - #9099
loopx-agent wants to merge 1 commit into
Conversation
Carry Todo selection provenance into quota admission. Preserve explicit secondary Monitor polling and recovery from previously admitted receipts. 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.2-sol · OpenAI (runtime_reported, max)
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机 / Motivation
对到期 continuous_monitor 进行观察时,调度器已经选定一条 Todo。另一条 Monitor 的 key 曾可替换当前选择。自动选择应保持稳定,明确指定到期次要 Todo 的现有操作也应继续可用。本切片负责本地准入及冻结事务,Chat 的 #8717 保留独立验收。
改动思路 / Approach
Python 保留调用中是否显式提供 Todo ID 的布尔事实。TypeScript 的既有 Monitor admission 比较调度选定项、到期列表与明确指定目标。原冻结事务仍用自己的准入记录恢复。入口解析到现有 canonical Monitor admission 的小范围改动,无新状态来源。握住原始请求的新旧差异,并让已准入操作按保存的 decision 继续。
具体改动 / Changes
精确 head 77da4e2f8e43d531cc3ddb9ef1553120a2993440,diff base 477def5c176ab4df92ac19ea1dd616828b325e87,7 个文件 +134/-33。逐项复核 attempt_due_monitor、quota.monitor_poll.commit。验收约定
关键代码讲解
- 显式性在 CLI 来源仍可区分时写入。源码
- 只约束当前 lane 的 secondary fallback。源码
- 从已冻结 admission 恢复旧 effect 的实测。当 pending receipt 缺失新字段时,相同输入仍获得原 provider plan,已有合法业务结果可以继续落盘和读回。源码
对主干的风险 / Risks
两个后端的候选均拒绝该请求,cursor 和两条 Todo 不变。显式次要 Todo ID 与已选 key 分别成功,且每次只更新对应一项。 错配的 ID 与 key 在 base/head 都拒绝。TS 复验未到期、不同 claim 和 User gate 的拒绝,以及旧 pending receipt 的恢复。
语义与 CI 对齐
44 项真实 CLI 与集成测试、25 项 TypeScript 事务测试、完整候选 Monitor smoke、变更 Python Ruff、RFC 双语差分及 diff 检查均通过。 本地 File、SQLite 的原生 CLI 和冻结事务已验证。#8717 组合证据来自作者,托管 CI 状态未知。 配置的 Ruff 和 mypy 在 base/head 报告逐字相同,合入仍受这两项检查约束。 主干问题 #9082
我的整体评价 / Verdict
代码评审通过。File 与 SQLite 的选择与恢复符合当前合同。此前已在主干出现的 Ruff 和 mypy 检查仍待处理,合入由维护者决定。
English verdict: APPROVE. Approve the exact-head code change. The unchanged repository lint and typecheck failures remain a merge hold.
Goal and delivered outcome
#9093 lets a caller observe a secondary due Monitor by supplying its Todo ID. The CLI also resolves a target key to a Todo internally for receipts. That derived ID could select a different due Monitor even when the caller supplied only its target key.
The quota decision now carries whether the Todo ID was supplied explicitly. A key alone must match the scheduled Monitor. An explicit ID can still identify another due Monitor claimed by the same Agent, subject to existing gates. Pending transactions retain their frozen admission when the receipt matches the original effect.
The patch also removes the unused Markdown renderer forwarding and the wrapper around the shared clock. The lookback smoke now uses an isolated fixture registry.
Author declaration
monitor_poll_admission.tsmonitor_poll_admission.tsmonitor_poll_commit.tsScope and continuation
This fixes quota Monitor admission independently of Chat. The same Monitor smoke passes in a local composition with #8717 at
d1668e0e9ada. That Chat PR still needs review of its current head.Validation
77da4e2f8e43d531cc3ddb9ef1553120a2993440against477def5c176ab4df92ac19ea1dd616828b325e87.finished. Input classessyntheticandpublic_fixture.regression_paritypassedreal_entrypointandreal_backendpassedmonitor-poll-writeback-smoke.pyon the candidate and combined Chat tree. File and SQLite canonical CLI cases covered selection, writeback and receipt recovery.integrationpassedstaticpassedintegrationpassedstaticfailedFrontend and visual evidence
none. This change affects admission on the existing CLI route.none.Type and area
Boundary checklist