fix(acp): prevent white-screen crash from stale session restore#1791
Merged
fix(acp): prevent white-screen crash from stale session restore#1791
Conversation
…conversation binding
…handling, and adapter emit guard
Contributor
Code Review:fix(acp): prevent white-screen crash from stale session restore (#1791)变更概述本 PR 修复了三类独立问题:①ACP session 跨会话错误绑定导致会话恢复到错误对话;②session/load restore 时 方案评估结论:✅ 方案合理 三个问题的修复各自独立、精准。Session 所有权校验通过在存储时写入 问题清单✅ 未发现新引入的问题。以下是对各维度的检查结论:
汇总
结论✅ 批准合并 — 无阻塞性问题,代码质量良好,测试覆盖充分。 本报告由本地 CONCLUSION: APPROVED |
Contributor
|
✅ 已自动 review,无阻塞性问题,正在触发自动合并。 |
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.
Summary
user_message_chunkprotocol update to eliminate unknown-type warnings during session restorerender-process-goneChanges
Session restore ownership (
src/process/agent/acp/index.ts,AcpAgentManager.ts,storage.ts)acpSessionConversationIdalongsideacpSessionIdwhen persisting session dataProtocol handling (
src/process/agent/acp/AcpAdapter.ts)user_message_chunkcase in the session update switchCrash circuit-breaker (
src/common/adapter/main.ts,src/index.ts)webContents.send()withisDestroyed()check, auto-remove dead windows from adapter listrender-process-gone, reload the renderer instead of leaving a white screenTests (
tests/unit/)acpSessionOwnership.test.ts— 5 cases covering ownership mismatch, same-conversation resume, legacy data, fresh session, and resume failureacpAdapterUserMessageChunk.test.ts— 3 cases for silent handling and warning behavioradapterEmitGuard.test.ts— 4 cases for destroyed window skippingRelated Issue
Closes #1790
Test Plan
bunx tsc --noEmitpassesbun run test— 12 new tests pass (3 files)