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 用户在查看会话或恢复已有工作时,需要找到当前 Goal、Agent 和频道可用的最新会话。 按更新时间的原始文本比较,整秒、带偏移或跨本地日期的旧记录会抢占后来更新的会话。 会话列表和两个 resume 路径按可解析的 UTC 微秒确定先后,同刻沿原排序规则,旧无效时间保留确定次序。 本次交付范围为会话读取和已有会话的选择。
改动思路 / Approach
普通列表和恢复沿 Python 会话存储使用原 chronology_key。精确分支沿 TypeScript lifecycle 使用原微秒解析,在原 GoalRef 和候选范围过滤后排序。 本次交付范围为会话读取和已有会话的选择。 实际改变是读取次序和恢复选中的会话。原 scope、显式会话选择、存盘更新时间与执行权限由原路径处理。
具体改动 / Changes
审查精确提交 db1ec761ef46618ec1bc2f2c5163725dd5621f86,当前比较基线 509360fb0d3e9e6e578ddf5c12db587886016b23。五个文件增加 224 行、删除 6 行。两处生产模块复用各自既有时间解析,其余为 Python、TypeScript 验证和 Lean 模型。 current-goal-instance-only 已验证实例感知的 Goal 不能使用过期、缺失或非当前绑定授予执行权限。 现有 Goal 身份约束
关键代码讲解
_session_recency_key。按 UTC 时刻比较可读值,等时刻沿源顺序,旧坏值保持文本后备。 源码ChatSessionStore.latest_session。使用 UTC 排序选取最新合格项,原候选范围保持。 源码decideSelection。先筛精确 GoalRef,解析微秒,等时刻保持 Session ID 的顺序。 源码
对主干的风险 / Risks
真实 loopback HTTP 回包和原开会话入口使用最新合格更新时间。严格读取用精确 GoalRef 对照新旧两个生命周期,更新过的旧实例、其他 Agent 或频道以及已关闭会话均不能抢占当前项,选中后原 Session 元数据逐字节保留。 基线在四项实际 Python 输入及三项 TypeScript 例中失败。现头的严格读取对旧实例与跨本地日期覆盖通过,等时刻分别保留源和 Session ID 的优先顺序。 84 项 Python、46 项 TypeScript、控制面类型检查、Ruff 和 Git diff 检查通过。Lean 4.22.0 验证选择的资格与排序,移除范围约束后资格证明失败。 验证覆盖本地合成会话、实际 Chat HTTP 与原生命周期入口。浏览器、已安装真实外部宿主和远端 CI 未运行。
我的整体评价 / Verdict
APPROVE。 会话列表和两个 resume 路径按可解析的 UTC 微秒确定先后,同刻沿原排序规则,旧无效时间保留确定次序。 真实入口和两版对照均已独立复验。验证覆盖本地合成会话、实际 Chat HTTP 与原生命周期入口。浏览器、已安装真实外部宿主和远端 CI 未运行。
English verdict: APPROVE at db1ec76. The real Session list and both resume selectors choose the newest eligible UTC instant. Paired tests preserve exact Goal-instance and scope filtering, deterministic ties, and the existing Session records.
Goal And Delivered Outcome
Chat sorted some Session update times as text. A whole-second or offset timestamp could rank ahead of a later fractional-second update. The same mismatch affected the ordinary resume selector and the exact Goal-instance selector.
The Session list and both resume paths now compare parsed UTC instants at microsecond precision. The existing Goal, Agent, channel, resumability and Goal-instance filters still determine which sessions are eligible. Equal instants use the existing source-order or Session-ID tie rule for each selector.
Author Declaration
mainat509360fb0using disposable local Session records and the real loopback list route, runtime opening path and TypeScript lifecycle decision.Validation
tests/test_chat_codex_home.py,tests/test_attached_session_goal_instance.pyandtests/test_chat_reasoning_selection.py.tests/control_plane_ts/chat_session_lifecycle.test.tsandtests/control_plane_ts/effect_runtime_handlers.test.ts.npm run typecheck:control-plane.lean -DwarningAsError=true regression/ChatSessionRecency.lean. The model proves that a selected Session is eligible and precedes every eligible alternative. Removing the scope predicate makes the proof fail.python3 -m loopx.entrypoint canary premerge --from-git-diff --git-diff-base origin/main --tier quick.The Lean model starts with parsed UTC values and models the existing eligibility filters. The runtime regressions check timestamp parsing and the actual selection paths. Test Sessions and adapters are local fixtures.
Scope And Continuation
The change corrects recency for the scoped Session list and both scoped resume paths. Stored timestamps and Session identities remain intact. Explicit Session selection continues to use the original exact identity path.
Frontend / Visual Evidence
The visible effect is the order of the Session list and the resumed selection. The loopback API regression verifies the first entries and selected Session. Browser rendering was outside this validation run.
Type Of Change
LoopX Area
Shared-authority RFC fixture impact
N/A.
Boundary Checklist
Signed-off-bytrailer.