Skip to content

Fix runtime-backed IPC crashes during project open transitions#421

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-correctness-bugs-c47f
Draft

Fix runtime-backed IPC crashes during project open transitions#421
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-correctness-bugs-c47f

Conversation

@cursor
Copy link
Copy Markdown
Contributor

@cursor cursor Bot commented May 30, 2026

Bug and impact

In production local-runtime-daemon mode (the default when NODE_ENV !== "test"), in-process diffService and agentChatService are intentionally null — real implementations live in the ade-runtime daemon.

project.openRepo clears the preload project binding for the duration of the switch. Read-only UI polls (Lanes diff, Work chat list) that miss the daemon route fall through to IPC handlers that still called ctx.diffService.getChanges() / ctx.agentChatService.listSessions() on null, producing renderer crashes like Cannot read properties of null (reading 'getChanges').

Root cause

#0f21fa1d fixed steady-state preload routing to the daemon, but IPC fallbacks remained unguarded. During transitions, preload intentionally returns { handled: false } for read-only chat (and has no binding for diff), so IPC was invoked with null in-process services.

Fix

When in-process diff/chat services are null, route diff.getChanges, diff.getFile, diff.getFilePatch, agentChat.list, and agentChat.getSummary IPC handlers through localRuntimeConnectionPool using the window session's local project root (same pattern as lanes.openFolder in #0f21fa1d).

Validation

Other findings (not fixed here — existing PRs)

Open in Web View Automation 

In production (local-runtime-daemon mode), in-process diffService and
agentChatService are null. Preload routes through the daemon when a project
binding exists, but project.openRepo clears the binding while the switch is
in flight. Read-only fallthrough to IPC then dereferenced null services.

Route diff and agent-chat read IPC handlers through the local runtime pool
when in-process services are null, using the window session project root
(which main still exposes during the transition).

Co-authored-by: Arul Sharma <arul28@users.noreply.github.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
ade Ignored Ignored May 30, 2026 2:11am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant