Repository navigation
Conversation
|
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. |
commit: |
be9a30e to
2cd0e58
Compare
… sessions After restart() the latest-turn checks (expectReply, expectTool, expectError, expectAbsent) now read the last turn restored from before the restart instead of refusing until the next message. Over ACP that turn is what session/load replays after the last user message; the editor and the terminals it ran before the restart are gone, so a replayed command's output is read from the text of the tool call and no editor-side evidence is required. Add a newSession() user action on all four surfaces: /new on the TUI, the New Session button on Desktop and Web, and session/new over ACP. New scenarios: a finished command keeps its card, status and output after a restart (four surfaces); a failed turn still shows as failed after a restart and continues from there (Desktop, Web); a command approved for the session asks again in a new session (four surfaces).
- ACP drops late notifications from a session the editor has left, and marks a restored conversation explicitly instead of inferring it from the absence of a turn. - expectError over ACP after a restart says that replays carry no failures. - newSession() clears the last prompt, so a restart right after it waits only for the product to be ready; a self-test covers it. - The guide notes that on Desktop and Web an empty conversation cannot show whether New Session did anything.
The ACP driver drops notifications from a session the editor has left, but still compared the kept ones against every notification received, so a turn in the new session never looked finished once the old session sent another update.
2cd0e58 to
3ea142c
Compare
Requirement or Bug
迁移旧 Desktop 旅程时,有两类断言新 E2E 表达不了:重启之后查对话里的工具卡和失败卡;以及新建会话(例如「本会话批准过的命令,新会话里要重新问」)。这个 PR 补上这两样,并迁入三个场景。
基于 MoonshotAI/kimi-code#5397(Windows),这个 PR 的 base 是它的分支
test/e2e-windows。Bug Reproduction Steps
N/A
Root Cause
N/A
Code Changes
核心思路:重启之后,「最近一回合」就是恢复出来的最后一回合,不再禁止读它;新建会话是一个用户动作,四个面都有。
expectReply、expectTool、expectError、expectAbsentexpectTranscriptsession/load回放里最后一条用户消息之后;重启前的编辑器和它开的终端都不在了,命令输出从工具调用内容的文字里读,不要求编辑器那一侧的证据;回放里没有「回合失败」,这类场景排除 ACPnewSession()/new,证据是新会话提示里的会话 ID 变了;Desktop、Web 点New Session,证据是对话变空;ACP 发session/new,要求拿到另一个会话 ID,之后只看新会话的消息新场景:
shell/command-card-survives-restart:成功和失败的命令卡,重启后状态和输出都不变errors/continue-a-failed-turn-after-restart:失败的回合重启后仍显示失败,点 Continue 接着做approval/new-session-asks-again:本会话批准过的命令,新会话里要重新批准关键决策:
except排除 TUIexcept藏起来;Desktop、Web 的这部分由 Continue 那个场景覆盖locationsrawInput.path补阅读指南:
tests/e2e/support/scenario.ts:去掉的限制、newSession后清掉上一条提示词。tests/e2e/surfaces/acp.ts的turnUpdates、replayedTurn、newSession。tests/e2e/surfaces/tui.ts的newSession,surfaces/renderer.ts的newSession。self-test/restart.spec.ts、self-test/new-session.spec.ts和三个场景。Behavior Changes and Affected Users
产品代码没有改动,受影响的是写和跑新 E2E 的人。
expectReply等四个动作restart自测里固定旧行为的反例,已改成「不把更早的回合当成最近一回合」newSession验证结论:四个面的全套在本机 macOS 上通过;两个新动作都做过破坏性检查。
验证细节
本机 macOS arm64,构建产物:
newSession的自测和新场景在四个面上连跑 3 遍都过。破坏性检查:
newSession正例变红:新会话的请求里有旧提问被产品问题挡住、这次没放进来的场景:「重启后失败的回合仍显示为失败」。Desktop、Web 通过;TUI 上恢复出来的对话只有用户的提问,看不出那一回合失败了。修好时随修复合入。另外 ACP 回放里的文件工具没有
locations(实时的有),编辑器在恢复出来的会话里不知道是哪个文件,所以没写查文件工具卡的重启场景。评审:只读 agent 没报 P1;改了几条 P2:ACP 丢掉离开的会话晚到的通知、用明确的标志表示「恢复出来的回合」、
newSession后马上重启不再等旧提示词(加了自测)。改的时候引入过一个问题(丢掉的通知没计入已处理,回合结束不了),全套里发现,已修。Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.