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. |
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh
动机 / Motivation
使用原 Chat 排队发送后续输入的人会受此影响。已有 Session 的排队输入同时含整秒、微秒和时区偏移时,旧字串比较会让晚一微秒的消息越过早到消息,快照与后续认领均受影响。 同一文件夹和 HTTP 调用下,基线把 10:00:00.000001Z 放在 10:00:00Z 及等时刻偏移之前,并先认领该微秒消息。 精确头先列最早整秒及等时刻偏移,再列晚一微秒的消息。原 created_at 字串保留,过期项在认领时结算,HTTP 与实际认领时序一致。 同一 Session 保持按 UTC 时刻的 FIFO。时间相同保留原文本和 Turn ID 次序。 范围为既有队列的排序,保留交付和准入规则。 原 Session FIFO 约定
改动思路 / Approach
在现有 queue provider 的读方法复用 chronology_key,使两个既有消费者取得相同顺序,一并复用原时间边界、平局规则及旧值回退。 范围为既有队列的排序,保留交付和准入规则。 Core 仍按原会话、状态和保留条件选出 Turn。认领继续经过原锁和资格校验。
具体改动 / Changes
精确提交 727431eaa11bb1105f57d611cf76ea21d544312b 对照基线 509360fb0d3e9e6e578ddf5c12db587886016b23,三个文件增加 146 行、删除 3 行。现有存储读取复用 UTC 比较,HTTP 和实际认领使用同一有序结果。Lean 模型验证给定成员和资格后的排序。session-fifo 核对同一 Session 的有效排队输入按 UTC 时刻先进先出,original-claim-fence 核对原到期过滤、认领和状态回读均保留。当前改动放在 loopx/chat/ingress.py 的现有排序调用。旧值沿共享比较器的确定性回退。 实际入口回归
关键代码讲解
ChatIngressStore.queued_turns。替换成员筛选后的时间排序键。 源码chronology_key。复用既有 UTC、原时间和旧值回退。 源码ChatStore.claim_next_queued_turn。实际状态转换沿原逻辑,从更正顺序得到正确项。 源码
对主干的风险 / Risks
同一文件夹和 HTTP 调用下,基线把 10:00:00.000001Z 放在 10:00:00Z 及等时刻偏移之前,并先认领该微秒消息。 精确头先列最早整秒及等时刻偏移,再列晚一微秒的消息。原 created_at 字串保留,过期项在认领时结算,HTTP 与实际认领时序一致。 过期队列项不会变成活动 Turn。现头的既有保留、撤权拒绝、重放、认领和活动输入不变用例均通过,回归夹具没有启动 Provider。 基线移植同一个回归,1 项按顺序断言失败。现头 42 项 Python 通过,Lean 4.22.0、Ruff 和 git diff --check 均通过。
与 #9536 三方合并模拟通过。#9480 移动同一读方法,按当前提交模拟在 ingress.py 冲突,集成时须保留此排序键并重跑当前回归。 验证使用本地文件回执、真实 loopback HTTP、Core 选择和实际 store 状态转换。未运行浏览器、实时宿主或外部投递。 远端 CI 按现有策略留在异步流程。 同时修改回执排序的 PR 并行迁移
我的整体评价 / Verdict
APPROVE。 真实 HTTP 和 store 复验支持当前候选的 FIFO 修复。读回保留原时间值,过期 Turn 走原超时路径。并行迁移仍需把该比较器留在原队列的共同读取路径。
English verdict: APPROVE at 727431e. The real queue snapshot and claim now use UTC order while preserving raw timestamps, deterministic ties and existing admission checks. Keep the shared comparison when integrating PR #9480.
Problem
A queued Turn at
10:00:00.000001Zcan appear before one at10:00:00Zbecause the queue compares timestamp text. Both HTTP readback and automatic claim consume that order, so the newer Turn can run first.Fix
Sort the rows already selected by Core using the existing UTC chronology key. Preserve timestamp text and Turn ID as tie breakers. Keep the existing expiry, reservation, and admission rules.
Verification
PR #9536 repairs ingress receipt ordering and combines cleanly with this commit. PR #9480 moves the queued Turn reader while retaining timestamp-text order.