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
REQUEST_CHANGES
[P2] 正常 Steward 跟进缺少排序所需的创建时间。 排序位置
动机 / Motivation
管家有多个同优先级、已就绪的跟进待办时,前台调度决定先启动哪个。选择器对记录的 created_at 按原文本比较。权威 Todo 记录缺少这个字段时,同优先级直接落到 Todo ID。 单测直注 created_at 时,基线将晚一微秒的记录提前,候选按 UTC 正确排序。真实调度也保留 P0 优先和每次 pump 单个提交。 File 与 SQLite 的普通创建和权威读取都不给跟进待办交付 created_at。两种后端上,基线和候选的真实 pump 在 P0 退出后都先提交晚一微秒的 Todo,按 ID 打破了空时间键。 范围为已启用 Steward 的前台跟进选择,使用本地真实权威存储和会话,提交宿主在配对测试中只记录请求。
改动思路 / Approach
在现有选择器复用 UTC chronology_key,保留原优先级、就绪过滤和 Todo ID 平局。补充了注入时间戳的回归和 Lean 抽象模型。 时间比较 helper 已有且适用。需要同步检查真实生产侧是否给读取端投影该字段。 现有调度入口和 Todo 类型所有者之间缺少同一份创建时间。
具体改动 / Changes
精确提交 69319bf1c39a9aad12a607c922c873a03f85544e。目标基线 509360fb0d3e9e6e578ddf5c12db587886016b23。3 个文件,增加 109 行、删除 1 行。 权威状态机 评审条件 native-todo-source、priority-and-single-dispatch。
关键代码讲解
StewardMonitor.runnable_advancement_todos。按所有者、状态、类型及恢复资格过滤,然后用优先级、created_at 和 Todo ID 排序。 源码_process_steward_binding。前台空闲时按 selector 返回顺序发起第一个有效后续轮次。 源码createCandidate。原生 Todo 创建只写 updated_at,统一进入权威版本化记录。 源码chronology_key。解析 UTC 时间。缺失或旧非法值走稳定 fallback,保留已有文本次序。 源码
对主干的风险 / Risks
候选 Steward 套件 213 项通过,包含 PR 的选择器正反例。两个原生创建测试成功读回,四组 base/head 与 File/SQLite 的 pump 对照复现放错顺序。 让 P0 通过真实 CAS 离开队列后,核对下一次的提交请求、身份和单次分派。原生创建与读回不注入额外时间字段。 Lean 模型从时间字段已解析后起步,本机做了源码复核。
语义与 CI 对齐
两版共用的一项转向重试断言失败,返回相同的 precommit-retry token。实现和用例都不在此 diff。
我的整体评价 / Verdict
REQUEST_CHANGES。 给正常读路径提供权威且稳定的创建时间或创建序号,再按优先级和这一顺序选择。处理缺值的旧记录。若选用 updated_at,应明确语义改为最近更新时间,并验证编辑会怎样改变队列。 从 File 与 SQLite 的权威列表进入正常 pump,验证较早创建的同优先级 Todo 先提交、早晚判断不受 ID 和后续编辑影响,且一轮只提交一次。
English verdict: REQUEST_CHANGES at 69319bf. The real File and SQLite Todo projections omit created_at, so the foreground pump still dispatches equal-priority follow-ups by Todo ID. Use an authoritative creation-order field and verify both stores through the pump.
|
Hi @hhyykk, the DCO If the log confirms a missing |
Problem
When two runnable Steward follow-ups have the same priority, timestamp-text order can put a newer Todo first. A whole-second timestamp ending in
Zsorts after the fractional timestamp one microsecond later. The foreground pump consumes the selector's order.Fix
Use the shared UTC chronology key for the creation-time comparison. Keep priority first and preserve the original timestamp text and Todo ID as tie breakers. Eligibility filters are unchanged.
Verification
test_resolve_advancement_turn_id_handles_selection_deferral_and_precommit_retries. A clean snapshot of the base commit reproduced the same assertion and retry token. The retry code and its test are unchanged here.