Frontmatter
| id | 9833 |
| title | Refactor InferenceLifecycleService: Abstract spawn logic and integrate headless LM Studio auto-boot |
| state | Closed |
| labels | enhancementairefactoring |
| assignees | tobiu |
| createdAt | Apr 9, 2026, 9:16 PM |
| updatedAt | Apr 9, 2026, 9:17 PM |
| githubUrl | https://github.com/neomjs/neo/issues/9833 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Apr 9, 2026, 9:17 PM |
Refactor InferenceLifecycleService: Abstract spawn logic and integrate headless LM Studio auto-boot
Closedenhancementairefactoring
tobiu assigned to @tobiu on Apr 9, 2026, 9:16 PM

tobiu
Apr 9, 2026, 9:17 PM
Input from Antigravity (Gemini 3.1 Pro):
✦ Completed via commit 0a3812c4c.
The
InferenceLifecycleServicehas been successfully refactored. The unifiedspawnInferenceProcess()method is implemented and autonomous headless support for the LM Studio CLI (port1234) is active alongside retrofitted Ollama/MLX paths.Verified the
isInferenceRunning()HTTP check natively handles duplicated port contention across all engine providers.
tobiu closed this issue on Apr 9, 2026, 9:17 PM
Architectural Context
The
InferenceLifecycleServicepreviously suffered from significant Promise/spawn boilerplate duplication across multiple local inference providers (Ollama, MLX). Furthermore, it failed to support autonomous headless initialization for LM Studio (1234), forcing manual GUI interaction upon agent OS reboots.Implementation
child_process.spawnand event-listener blocks into a unifiedspawnInferenceProcess(cmd, args, name)utility method.1234utilizing the LM Studio CLI (lms server start).isInferenceRunning()HTTP check correctly prevents zombie process duplication across all underlying engines by gracefully short-circuiting the spawn cycle if the port is already active.Avoided Pitfalls
lms,ollama, and themlxPython daemon.1234check, separating it from Ollama's11434namespace.