Skip to content

fix(desktop): keep Cursor SDK workers stable across recycle - #1195

Merged
arul28 merged 1 commit into
mainfrom
ade/cursor-hook-stability
Sep 1, 2026
Merged

fix(desktop): keep Cursor SDK workers stable across recycle#1195
arul28 merged 1 commit into
mainfrom
ade/cursor-hook-stability

Conversation

@arul28

@arul28 arul28 commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Problem

Cursor chats could fail immediately on macOS after the per-worker hook-socket recycle fix, and later recycled chats could still fail during recovery.

Cause

The per-instance Unix-socket layout pushed macOS sun_path past its 104-byte limit, so worker startup failed with EINVAL. The replacement wait also covered only the dispose grace, not the SIGTERM-to-SIGKILL escalation, so a wedged worker could outlive the wait and fail the recovery turn.

Change and boundary

Compact the POSIX socket derivation into one per-instance hash segment, fall back to a short private /tmp root for unusually deep temp directories, and keep Windows named pipes on their existing separate-hash path. Tie replacement waiting to the complete teardown ladder and reclaim per-instance socket directories independently from durable Cursor state. No Cursor authentication, model, or other-provider behavior changes.

Verification

  • cd apps/desktop && npx vitest run src/main/services/chat/cursorSdkPool.test.ts — 31 passed on the PR head.
  • npm --prefix apps/desktop run typecheck — passed.
  • npm --prefix apps/desktop run lint — passed with 0 errors; existing warnings remain.
  • node scripts/validate-docs.mjs — 252 files passed.
  • /test baseline: 975 focused chat/pool tests passed; the unrelated host-sensitive shard failures were reproduced on the unmodified base.

Authored with GPT-5 via ADE Work chat.

ADE   Open in ADE  ·  ade/cursor-hook-stability branch  ·  PR #1195


Note

Cursor Bugbot is generating a summary for commit 7278ca9. Configure here.

@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
ade Ignored Ignored Sep 1, 2026 3:24pm UTC

@arul28 arul28 changed the title Cursor Hook Stability -> main fix(desktop): keep Cursor SDK workers stable across recycle Sep 1, 2026
@arul28
arul28 merged commit b53cc22 into main Sep 1, 2026
39 checks passed
@arul28
arul28 deleted the ade/cursor-hook-stability branch September 1, 2026 15:45
arul28 added a commit that referenced this pull request Sep 2, 2026
…name

Problem: cloud launches dropped the chosen reasoning/fast-mode params, Send to Cloud ignored CLI drafts, and ADE kept renaming cloud chats while Cursor already named them.

Cause: ADE sent only model.id, several title writers treated cloud chats like local sessions, and Cursor one-shots called Agent.create in the host.

Change and boundary: fail-closed verified model.params on both create paths, restore the cloud agents panel, route Cursor one-shots through the SDK worker pool, and make Cursor the name authority. Does not bring cloud agents local, and does not fix the 1.2.69 hook.sock path (#1195) or Codex one-shots blocked by a dead local unityMCP.

Verification: desktop typecheck and lint clean; 21 affected test files 1879 passed / 1 skipped; CLI typecheck clean; swiftc -parse on touched iOS files.
Co-authored-by: Cursor <cursoragent@cursor.com>
arul28 added a commit that referenced this pull request Sep 2, 2026
…name

Problem: cloud launches dropped the chosen reasoning/fast-mode params, Send to Cloud ignored CLI drafts, and ADE kept renaming cloud chats while Cursor already named them.

Cause: ADE sent only model.id, several title writers treated cloud chats like local sessions, and Cursor one-shots called Agent.create in the host.

Change and boundary: fail-closed verified model.params on both create paths, restore the cloud agents panel, route Cursor one-shots through the SDK worker pool, and make Cursor the name authority. Does not bring cloud agents local, and does not fix the 1.2.69 hook.sock path (#1195) or Codex one-shots blocked by a dead local unityMCP.

Verification: desktop typecheck and lint clean; 21 affected test files 1879 passed / 1 skipped; CLI typecheck clean; swiftc -parse on touched iOS files.
Co-authored-by: Cursor <cursoragent@cursor.com>
arul28 added a commit that referenced this pull request Sep 2, 2026
…name (#1203)

* fix(desktop): send Cursor Cloud model params and keep Cursor's agent name

Problem: cloud launches dropped the chosen reasoning/fast-mode params, Send to Cloud ignored CLI drafts, and ADE kept renaming cloud chats while Cursor already named them.

Cause: ADE sent only model.id, several title writers treated cloud chats like local sessions, and Cursor one-shots called Agent.create in the host.

Change and boundary: fail-closed verified model.params on both create paths, restore the cloud agents panel, route Cursor one-shots through the SDK worker pool, and make Cursor the name authority. Does not bring cloud agents local, and does not fix the 1.2.69 hook.sock path (#1195) or Codex one-shots blocked by a dead local unityMCP.

Verification: desktop typecheck and lint clean; 21 affected test files 1879 passed / 1 skipped; CLI typecheck clean; swiftc -parse on touched iOS files.
Co-authored-by: Cursor <cursoragent@cursor.com>

* ship: apply initial quality revalidation

Share one composer model allowlist between picker props and onModelChange, and drive the session identity menu from a single canRename flag after rebasing onto #1201.

Co-authored-by: Cursor <cursoragent@cursor.com>

* ship: apply post-rebase quality revalidation

Fail closed when cloud controls arrive without a model, match requested reasoning and speed values rather than parameter presence, re-read Cursor's name after the first visible turn, and keep iOS rename guards on the initial session.

Co-authored-by: Cursor <cursoragent@cursor.com>

* ship: iteration 1 — address CodeRabbit catalog, draft, and iOS rename findings

Resolve cloud model selection against the probe rows rather than another key's cache, treat blank reasoning as no control, keep composer draft hydration stable across machine switches, and hide iOS Rename from chat summaries that already carry Cursor ownership.

Co-authored-by: Cursor <cursoragent@cursor.com>

* ship: iteration 2 — give desktop eslint enough heap in CI

lint-desktop aborted twice at the default ~4GB Node heap. Raise the lint script to 8GB so the same command can finish on GitHub runners.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
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