Repository navigation
Conversation
Signed-off-by: aihop <[email protected]>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh
动机 / Motivation
使用 Steward 自动巡检的人会遇到这个问题。用户给 Steward 或 managed Session 留下无时区偏移的未来 deadline。调度器已接受该格式,空闲泵随后独立解析并对有/无时区的对象比较或相减。 基线在 File 和 SQLite 的六组未来监控对照中,两条空闲路径都进入 TypeError 退避。 候选两条路径分别记录 0.25、60、60 秒等待,未提前派发。模拟时钟越过截止时间后,两条路径各提交一个 Monitor,原 deadline 字符串和 Turn ID 完整保留。 保持当前准入、租约、后台 Session 以及原 Monitor 的时间和身份。 Monitor 调度约定
改动思路 / Approach
两个空闲路径共用 monitor_todo_next_due_at。对最早合法时间计算单调时钟提示,保留原无效值故障路径。 Core Todo 权威读取提供原行,Monitor scheduler 定义到期资格,Steward pump 负责原前台/后台隔离和宿主派发。
具体改动 / Changes
精确提交 68a519c1d34e78ddd2821a1f0aad8bda16b06159 对照目标基线 509360fb0d3e9e6e578ddf5c12db587886016b23。3 个文件,增加 153 行,删除 7 行。合并已有时间解析调用,分别接入 portfolio 和 managed Session,增加泵级回归和 Lean 抽象模型。 monitor-timing 核对时间行为,original-monitor-scope 核对现有独立边界。
关键代码讲解
monitor_todo_next_due_at。沿已被 due 检查使用的 scheduler parser。 源码_monitor_deadline。不可读时间仍进入原故障路径。 源码_schedule_soonest_monitor_backoff。在原范围中找最早 UTC 时刻并将等待限制为 60 秒。 源码_process_managed_session。同一 parser 计算 idle 时间,到期后带原身份提交。 源码
对主干的风险 / Risks
另一路由的较早时间不污染这个等待。原生后台隔离、注册后仍须显式启用和绑定变更拒绝的局部路径通过。 候选现有契约 16 项,原生集成 8 项通过。git diff --check 通过。Lean 模型的边界按源码核对。 Git 三方试合与 #9541 无冲突。 基线和候选均为精确提交的本地 File/SQLite。多条时间的实验记录宿主提交,原生测试另走现有持久化和本地模拟传输。外部模型、线上宿主与远端 CI 未运行。
我的整体评价 / Verdict
APPROVE。 当前提交可以按现有流程推进。两个空闲入口共用调度器的截止时间解释,也保留了原始提交标识和现有资格判断。后续若更改截止时间格式,应在这两个入口一起验证。
English verdict: APPROVE at 68a519c. Both idle routes now use scheduler deadline parsing. File and SQLite preserve the 60-second cap, avoid early dispatch, and submit the original deadline and Turn ID when due.
Problem
The scheduler accepts future monitor deadlines with or without an explicit UTC offset. Steward's idle paths parsed those deadlines separately. Mixing offset-free and offset-bearing timestamps could send the portfolio pump into failure backoff. An offset-free deadline by itself could do the same to the managed Session pump.
Fix
Use the scheduler deadline parser in both idle paths. Compare and subtract UTC instants. Preserve the route filters, the existing error path for invalid deadlines, the persisted deadline text, and the 60-second idle wait cap.
Verification
PR #9541 handles dispatch order for due monitors. A local merge-tree check confirms the patches combine cleanly.