mirror of
https://github.com/zhukunpenglinyutong/jetbrains-cc-gui.git
synced 2026-08-30 17:56:21 +08:00
9ab8bb4e86
Replace the per-request process model (5-10s SDK load overhead each time) with a persistent Node.js daemon that pre-loads the Claude SDK once and handles multiple requests via NDJSON over stdin/stdout. Key components: - daemon.js: long-running Node.js entry point with stdout/process.exit interception, request queue serialization, and env var isolation - persistent-query-service.js: SDK query runtime pool with session-based reuse, dynamic model/permission switching, and idle cleanup - DaemonBridge.java: Java-side process management with NDJSON protocol, heartbeat monitoring (15s interval, 45s timeout), and auto-restart (max 3) - ClaudeSDKBridge integration: daemon-first with per-process fallback Three-phase prewarm strategy ensures low latency even for first messages: 1. Plugin startup (WebviewInitializer) 2. New session creation (SessionLifecycleManager) 3. Post first-turn anonymous runtime refill (ClaudeSession)