Repository navigation
Conversation
…ned via ProcessLauncher
Contributor
Author
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.
Problem
On Linux, starting a Cursor turn fails immediately with:
Since #39526 moved the Cursor SDK worker out of process,
CursorAgentSdkProcessRunner.spawnWorkerlaunches__cursor-sdk-workerthroughChildProcessSpawner, which on Linux delegates to theProcessLauncherhelper process (process-launcher.mjs). As a result, the spawned worker'sppidisProcessLauncher.currentPidrather than the server'sprocess.pid.ProviderProcesses.register(apps/server/src/process/providerProcesses.ts) still requiredprovider.ppid === process.pid, so registration threwCannot identify spawned provideron every attempt. (Claude was unaffected becausespawnClaudeProcessGroupcallschild_process.spawndirectly from the server process.)This is a small, focused fix (
+14 / -1non-test lines) for an obvious Linux regression mirroring #42151'sProcessLauncher.currentPidhandling inPortScanner.Fix
apps/server/src/process/providerProcesses.ts, readProcessLauncher.ProcessLauncher(already in context vialayerPlatformServicesinserver.ts, with a safeEffect.undefineddefault) and look upcurrentPiddynamically insideregister(pid).ppidis eitherprocess.pidor the activeProcessLauncherhelper PID, while verifyingidentity(launcherPid)?.ppid === process.pidso a dead, reused, or foreign PID cannot authorize registration.apps/server/src/process/providerProcesses.test.ts, add focused Linux regression tests covering direct children,ProcessLauncher.layerServer-spawned children, unrelated PIDs, and a non-ownedProcessLauncherPID.Verification
gemini-4-neon) thread — all 5 startup retries failed inCursorAgentSdkProcessRunner.spawnWorkerwithError: Cannot identify spawned provideratProviderProcesses.register.vp test run apps/server/src/process/providerProcesses.test.tsfailed onregisters providers spawned directly or through ProcessLauncherwithError: Cannot identify spawned provideratsrc/process/providerProcesses.ts:131.vp test run apps/server/src/process/providerProcesses.test.ts apps/server/src/process/agentScope.test.ts apps/server/src/provider/ProviderOrchestrationAdapterInfrastructure.test.ts— 3/3 files, 22/22 tests passed.vp run check:changed origin/main—format(2 files),lint(0 warnings, 0 errors),knip 1/2&2/2,graphql (apps/server),typecheck (3 packages), andtest(2/2 files, 5/5 tests) all passed.systemd-run --user --scopeviaexecpreserves the spawned process's PID andppid.Built with Gemini 4 Neon (Antigravity harness in T3 Code).