mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-25 05:07:05 +00:00
fix(cursor): merge SKU catalog under ACP lock and refcount agent guard (#835)
Fixes incomplete cliModelSkus while agent acp holds the CLI lock (#831) and replace single-pid ACP lock with cross-process refcount (#832). Web picker merges machine/session catalogs and waits for SKU readiness before showing variant labels. Fixes #831 Fixes #832 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -17,7 +17,8 @@ import { setCursorAcpModelsSnapshot } from './utils/cursorAcpModelsBridge';
|
||||
import { buildCursorModelsSnapshotFromAcp } from './utils/cursorAcpModelsSnapshot';
|
||||
import { CursorExtensionAdapter } from './utils/cursorExtensionAdapter';
|
||||
import { applyCursorAcpMode, applyCursorAcpModel, wireIdForCursorSessionState } from './utils/cursorModeConfig';
|
||||
import { seedCursorModelsCache } from '@/modules/common/cursorModels';
|
||||
import { buildCursorModelsSeedPayload, seedCursorModelsCache } from '@/modules/common/cursorModels';
|
||||
import { readSharedCursorModelsCache } from '@/modules/common/cursorModelsSharedCache';
|
||||
import type { AcpSdkBackend } from '@/agent/backends/acp';
|
||||
|
||||
class CursorAcpRemoteLauncher extends RemoteLauncherBase {
|
||||
@@ -442,8 +443,9 @@ function syncCursorModelsFromAcp(backend: AcpSdkBackend, acpSessionId: string):
|
||||
return;
|
||||
}
|
||||
|
||||
const payload = buildCursorModelsSeedPayload(snapshot, readSharedCursorModelsCache());
|
||||
setCursorAcpModelsSnapshot(snapshot);
|
||||
seedCursorModelsCache({ success: true, ...snapshot });
|
||||
seedCursorModelsCache(payload);
|
||||
}
|
||||
|
||||
function toAcpMcpServers(config: Record<string, { command: string; args: string[] }>): McpServerStdio[] {
|
||||
|
||||
Reference in New Issue
Block a user