fix(acp): surface archived sessions as the known load-failure banner - #598
Merged
xintaofei merged 5 commits intoAug 29, 2026
Merged
Conversation
Codex after `codex archive`: reconnecting a conversation fails
session/load with an Internal error whose body names the archived
session and the unarchive command. That error fell outside
classify_session_load_failure, so it took the raw "Failed to load
session, starting new" path — the history was silently orphaned even
though a one-command fix exists.
Classify it as a third known case ("session_archived"). It now rides
the same SessionLoadFailed banner as resource_not_found /
session_unavailable (Reload or start new), and the banner text names
the exact unarchive command — the id is extracted from the error body
on the frontend; a body without a parseable id falls back to the raw
message so nothing actionable is lost. Custom agents keep their
silent local recovery (their history is codeg's own transcript).
i18n: backendErrors.sessionArchived x 10 locales, key parity kept.
PR xintaofei#598 shipped the frontend `session_archived` case and its i18n keys, but not the backend classification they depend on. Nothing in classify_session_load_failure ever returned "session_archived", so the new switch arm was unreachable and `codex archive` still fell through to the raw "Failed to load session, starting new" path — the exact bug the PR set out to fix. Its claimed Rust test did not exist either. Classify "is archived" as the third known case, checked after the structured -32002 verdict (which keeps its documented precedence) and before the crash/ended family, so the more specific and recoverable verdict wins if a body ever carries both signals. Frontend, two corrections to the now-live path: - Take the session id from the event instead of regex-scraping the RPC body. `session_id` IS the session the load failed for, so it is exact by construction, while the body only spells it out by convention — recovering it from there drifts the moment codex rewords the error. - Only name `codex unarchive` when codex is actually the agent. The classification is matched on the wire message, so it is not codex-exclusive by construction, and prescribing a codex command to a Claude user is worse than showing the agent's own text. Tests: the Rust classifier case the PR described, plus three frontend cases covering the command, the reworded-body path, and the non-codex fallback. Verified failing without their fixes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The `code` field is documented in four places; the archived case updated two of them. Bring the Rust event definition and the runtime store's field comment in line too, so none of them still claims -32002 is the only value a consumer can see. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The banner's whole promise is a command the user can run to get their history back, but the surface it lands on is a one-line strip (`text-ellipsis whitespace-nowrap`) sharing its row with two shrink-0 buttons. With the agent name and session id substituted in, the message runs ~178 chars and the 36-char id sits at chars 57-109 — cut mid-UUID at any realistic panel width, and unselectable from the `title` tooltip. The one thing the user had to copy was the one thing they could not. Carry the command on the connection beside the localized message (`loadErrorCommand`), and give the banner a copy action for it. The message text is unchanged; this adds a way to actually obtain what it names. Null for the failures with no way back, so the button is absent rather than offering a recovery that does not exist. The button sits outside `canShowDetailErrorActions` on purpose: that gate is there because Reload refetches the DB detail and New session opens a tab in the folder. Copying needs neither. i18n: messageList.errorActionCopyCommand / errorActionCommandCopied x 10 locales, key parity kept. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Two problems with the copy action as first written. The banner is a single non-wrapping flex row whose every action is shrink-0, so the message is the only child with any give. Adding a third action therefore did not shrink anything — it crushed the message to zero width and pushed "New conversation" out past the banner edge, which the tab wrapper clips. Measured in headless Chrome across en/fr/de at 320/375/384px: 34-172px of overflow, worst in French. Adding a recovery action was breaking the two recovery actions already there, at exactly the narrow widths that motivated the change. Give the row `flex-wrap` and the message a `min-w-40` floor. Measured after: no overflow at any tested width, and at >=700px the layout is byte-identical to before (one row, 39px, same message width) — the second row appears only when the panel really is too narrow. This also fixes a pre-existing clip: French at 320px overflowed by 7px with just the original two buttons. Second, the command is a string we invite the user to paste into a shell, so the id must be the whole of what gets interpolated. Taking it from the event (correct, and exact) dropped the implicit guard the original regex had by accident — a scrape for a UUID could only ever yield a UUID. Shape-check `session_id` against an anchored UUID pattern and fall back to the raw message otherwise, so a value carrying a space and a second word can never become a second command. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Owner
|
codeg work task |
xintaofei
added a commit
that referenced
this pull request
Aug 29, 2026
Read a pull request and merge it without opening a browser. Every assistant reply now sits under a header you can fold away. ## New - **A pull request opens as three tabs, and there's a Merge button.** Conversation, Checks and Files changed; click a file to see its diff; the merge menu lists only what the repository allows — merge commit, squash, or rebase. - **Write a comment, close or reopen an issue, and file a new one — all in the repository panel.** These used to mean going to GitHub or GitLab in a browser. - **Every reply has a header: "Working…" while the agent writes, "Worked for 1m 9s" when it's done.** Click it to fold the whole reply away; sending your next message folds the one above it. A reply that stops on a tool call keeps everything on screen. - **Hover a session and a card floats out to the right** with its full title, agent and model, folder, branch and path. Sessions started inside codeg now show a model too — before, only imported ones did. - **Ctrl/Cmd+1 through 9 jump to a tab, and Ctrl/Cmd+Shift+T reopens the one you just closed.** (#502, @Adam-Dalloul) - **VS Code joins the "Open in" menu**, for folders, directories and files. (#591, @markos-ttl) - **Antigravity can sign in on a machine with no browser.** codeg gives you a link, you sign in to Google on your phone or another computer, then paste the address it lands on back into codeg. - **A conversation whose session was archived says so, and hands you the command to get it back.** One click copies `codex unarchive <id>`; before, it just said "Failed to load session, starting new". (#598, @asteroida123) - **Codex now says why it needs your approval**, instead of a fixed title like "Edit files". Comes with the codex-acp 1.7.0 upgrade. ## Improved - **Updated bundled agents:** Gemini CLI 0.57.0, OpenCode 1.18.25, Hermes 0.20.6, CodeBuddy 2.141.0, Kimi Code 0.39.1, Qoder 1.1.33. - **Kimi Code takes MCP servers again**, which is what unblocked the jump from 0.36.1 to 0.39.1; its login hint now includes the `--region global` a kimi.ai account needs. - **Saving MCP settings leaves fields codeg has no UI for exactly as they were**, instead of dropping them. - **The pull request detail panel lines its description, comments and composer up on one left edge**, keeps the author's avatar next to you down a long comment, and is wider. ## Fixed - **The interface grows when you zoom the window.** At 150% the text got bigger, but column widths, small labels and popovers stayed at their 100% size. - **Chinese, Japanese and Korean text isn't clipped at high zoom** in the sidebar, conversation titles and dropdowns. - **One stretch of thinking stays one card** while sub-agents are streaming beside it, instead of being cut into several. (#494, #586, @dawNotPoi) - **A reply you're watching in a sub-agent transcript stops being stuck on "responding".** Its timing stats and artifacts card show up. - **An image card keeps its filename or page name after a reload**, rather than reverting to "Image generation". (#504, @Adam-Dalloul) - **An OpenCode tool card shows the result, not a blob of raw JSON.** Watching live, a question you'd already answered read as "no selection". - **Sessions Codex delegates to sub-agents no longer show up as separate sessions in your history.** (#593, @TroyMitchell911) - **When a turn produces nothing, nothing comes back** — not the previous turn's answer. Thanks to @Adam-Dalloul, @asteroida123, @dawNotPoi, @markos-ttl and @TroyMitchell911 for contributing to this release. ----------------------------- # 发布版本 0.29.0 读 PR、合并 PR,不用再打开浏览器。 每一轮回复都收进一条可以折叠的标题栏里。 ## 新增 - **PR 打开后分成三个标签页,右边还有「合并」按钮。** 「对话」「检查项」「文件更改」各占一页,点开文件就能看 diff;合并方式只列这个仓库允许的那几种——创建合并提交、压缩后合并、变基后合并。 - **在仓库面板里就能发评论、关闭或重新打开议题,也能新建议题。** 以前这些都得跳去 GitHub、GitLab 的网页上做。 - **每一轮回复顶上都有一条标题栏:智能体在写时显示「正在工作中…」,写完变成「工作了 1 分 9 秒」。** 点它就能把整轮回复折起来,发出下一条消息时上一轮自动折叠。停在工具调用上、还没给出回答的回合不会被折走。 - **鼠标停在会话上,右边会浮出一张卡片**,写着完整标题、智能体和模型、所在文件夹、分支和路径。在 codeg 里新建的会话现在也能看到模型名了,以前只有导入的会话才有。 - **Ctrl/Cmd + 1 到 9 直接跳到第几个标签,Ctrl/Cmd + Shift + T 重新打开刚关掉的那个。**(#502,@Adam-Dalloul) - **右键菜单的「打开于」里多了 VS Code**,文件夹、目录、文件都能用。(#591,@markos-ttl) - **Antigravity 可以在没有浏览器的机器上登录。** codeg 给你一个链接,你用手机或另一台电脑打开、登录 Google 账号,再把跳转后的地址粘回来就完成了。 - **会话在 Codex 那边被归档时,横幅会直接说明,并给出找回历史的命令。** 点一下就复制 `codex unarchive <id>`;以前只会显示「加载会话失败,正在新建会话」。(#598,@asteroida123) - **Codex 会说明它为什么要请求这次授权**,不再只显示「编辑文件」这种固定标题。随 codex-acp 1.7.0 升级一起到来。 ## 改进 - **内置智能体版本更新:** Gemini CLI 0.57.0、OpenCode 1.18.25、Hermes 0.20.6、CodeBuddy 2.141.0、Kimi Code 0.39.1、Qoder 1.1.33。 - **Kimi Code 重新支持 MCP 服务器**,卡在 0.36.1 的版本这才升到 0.39.1;登录提示里也补上了 kimi.ai 账号要加的 `--region global`。 - **保存 MCP 设置时,codeg 界面上没有的那些字段会原样留着**,不会被清掉。 - **PR 详情面板的描述、评论和输入框对齐到同一条左边线**,读长评论时作者头像一直停在旁边,面板整体也更宽了。 ## 修复 - **调窗口缩放时,整个界面跟着一起变大。** 之前调到 150%,字是变大了,但栏宽、小号标签和弹出层还是 100% 的尺寸。 - **缩放调高后中文不再被切掉上下半截**,侧边栏、会话标题、下拉框都恢复正常。 - **旁边有子智能体在输出时,一段思考仍然是一整张卡片**,不会被切成好几段。(#494、#586,@dawNotPoi) - **打开子智能体的转写去看,回复不会一直卡在「响应中」**,耗时统计和产物卡片也能正常显示。 - **图片卡片刷新页面后还是原来的名字**(文件名或页面名),不会变回「Image generation」。(#504,@Adam-Dalloul) - **OpenCode 的工具卡片显示的是结果,不是一段原始 JSON。** 之前实时看的时候,已经回答过的提问会显示成「未选择」。 - **Codex 委托给子智能体的会话,不会再作为独立会话出现在历史列表里。**(#593,@TroyMitchell911) - **某一轮什么都没输出时,返回的就是空**,不会把上一轮的回答顶上来。 感谢 @Adam-Dalloul、@asteroida123、@dawNotPoi、@markos-ttl 与 @TroyMitchell911 为本次发布做出的贡献。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
codex archive之后在 codeg 里重连对应会话:session/load失败,报Internal error: { "details": "session <id> is archived. Run \codex unarchive ` …" }`。这个错误落在
classify_session_load_failure的分类之外,走了原始的 "Failed to load session, starting new" 路径 —— 历史被静默搁置,而实际上存在一条命令就能找回的修复。归档是可恢复状态,不是丢失。改动
classify_session_load_failure新增第三个已知情形"session_archived"(匹配错误体中的 "is archived")。归档会话从此走与resource_not_found/session_unavailable相同的SessionLoadFailed横幅(重载 / 新会话二选一),而不是静默开新会话。codex unarchive <id>;解析不到 id 时回退显示原始消息,不丢失任何可行动信息。测试
classify_load_failure_names_an_archived_session:真实 Codex 错误体 →session_archived;内置智能体走横幅、自定义智能体静默恢复cargo test --features test-utils classify通过;cargo clippy(server lib / desktop all-targets)-D warnings通过tsc --noEmit干净;i18n 键集 parity(10 语言)通过