Repository navigation
Conversation
Signed-off-by: aihop <4408344+hhyykk@users.noreply.github.com>
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. |
Signed-off-by: aihop <4408344+hhyykk@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 · xhigh
APPROVE
通过本次精确提交评审。
动机 / Motivation
原生 Follow-up 与 Monitor 通过已持久化的完成回执决定是否恢复。 旧解析会拒绝小写 z,并能提前通过部分越界日期。上一候选统一了解析,但两条入口仍会在远期历史回执的浮点时间舍入下提早重试。 在同一持久化回执中分别以 Z、z 和偏移表示相同时间,在原冷却前、等于边界和越过边界恢复。 相同时间得到一致的冷却结论。实际时钟在最后一纳秒保持等待,到达门槛才允许恢复。坏日期、非有限时钟和已有交付回执仍不触发重试。 范围是读取旧完成回执的时间归一,原重试资格和冷却值由既有路径负责。
改动思路 / Approach
两个调用点复用共享 UTC 解析和整数微秒比较。系统时钟使用整数纳秒,显式有限浮点时钟按实际有理值向下取整。 统一 retained completion 的冷却计算,保留原 Monitor 与 Follow-up 守卫、时长和持久回执。 原生恢复冷却、旧回执和已成功写回的重试守卫。 延迟重试与任何明确写回保持原约束。
具体改动 / Changes
精确提交 cd8d879。目标基线 509360f,复审对照 509360f。6 个文件,增加 224 行、删除 24 行。评审条件 steward-recovery、retained-time-compatibility。 原始契约
关键代码讲解
- timestamp_age_at_least。将 UTC 时间和当前时钟按整数微秒比较。 源码
- StewardTurnHost.monitor_restart_request。Monitor 恢复根据原回执和冷却时间决定是否生成重试。 源码
- _past_precommit_cooldown。未提交 Follow-up 仅在已有回执和冷却资格成立时生成重试。 源码
- parse_timestamp。统一读取 ISO 日期、时区偏移和 UTC 后缀,并拒绝不可表示的 UTC 时间。 源码
对主干的风险 / Risks
独立写入并重开原生会话回执,复验两个入口的 Z、z、时区偏移、冷却边界正负一微秒。精确头定向 29 项通过,含远期一纳秒和非有限显式时钟。 本头 29 项通过。两项定向复跑在本头与目标基线同样失败,分别是替身干扰 Node 版本探针,以及旧 host_invoked 用例的相同重试 token。
语义与 CI 对齐
目标基线有三个日期兼容性反例。上一候选 c4f3c92 的远期精度回归失败,当前头通过。坏日期、UTC 下溢和已交付 Follow-up 都不会生成新重试。 真实回执与两个 Python 调用入口已验证,时钟由用例控制。未操作在用服务或独立运行 Lean。与并行 #9417 的 steward_turn.py 有实际 Git 内容冲突,若该 PR 先落地,须在移动后的恢复入口复验。
我的整体评价 / Verdict
APPROVE。 两个真实恢复入口对同一时刻的历史表示给出一致结果,同时保持旧回执和坏时间的安全拒绝。 让恢复入口沿用共享时间解析,在目标基线更新后重新执行同一回执矩阵。 对比目标基线和候选,用隔离持久回执在冷却边界及坏日期上验证真正的两个重试调用路径。
English verdict: APPROVE at cd8d879. Both native retry paths honor the cooldown for equivalent retained timestamps and suppress invalid dates.
Problem
The Steward retry paths treated equivalent retained UTC timestamps differently. A completion stamp ending in lowercase
zcould keep a retry unavailable after its cooldown. Converting a valid completion instant near year 9999 to floating-point epoch seconds could also round the instant down and release a retry a microsecond early.Fix
Both Python retry paths use the shared UTC timestamp parser and compare integer microseconds. The host clock is sampled in nanoseconds. An explicitly supplied finite clock sample is converted from its exact ratio. Receipt eligibility and the two existing cooldown durations are preserved. Unreadable completion timestamps and nonfinite samples withhold retry.
Verification
Z,z, equivalent numeric offsets, an omitted offset, and malformed text. It checks both callers immediately before, at, and after their cutoffs.PR #9417 also moves the shared retry parser as part of the Steward Turn refactor. The typed Core admission check has its own millisecond comparison and is tracked separately.