Files
zkpaiminmin 9ab8bb4e86 feat: add daemon mode to eliminate per-request Node.js process spawning
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)
2026-02-26 22:32:58 +08:00
..