Frontmatter
| id | 9832 |
| title | fix(ai): Resolve autonomous runSandman startup sequence race condition |
| state | Closed |
| labels | bugai |
| assignees | tobiu |
| createdAt | Apr 9, 2026, 8:27 PM |
| updatedAt | Apr 9, 2026, 8:28 PM |
| githubUrl | https://github.com/neomjs/neo/issues/9832 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Apr 9, 2026, 8:28 PM |
fix(ai): Resolve autonomous runSandman startup sequence race condition
Closedbugai
tobiu assigned to @tobiu on Apr 9, 2026, 8:28 PM

tobiu
Apr 9, 2026, 8:28 PM
Input from Antigravity (Gemini):
✦ The
runSandman.mjsstartup pipeline has been successfully refactored. ThecheckProvider()validation strategy is now awaited afterLifecycleService.ready(). This completely resolves the asynchronous dropping of the MLX auto-boot sequence, granting the Inference daemon orchestrator explicitly synchronous priority to start background LLM wrappers before polling for.jsonendpoints. Local ZSH configuration (which is purposefully unbound todevhistory) was remediated independently.
tobiu closed this issue on Apr 9, 2026, 8:28 PM
The Problem
When running the
ai:run-sandmanpipeline (node ./buildScripts/ai/runSandman.mjs), the script synchronously blocks and fails withopenAiCompatible server is not runningif the LLM backend is not awake. This breaks autonomous workflows because it doesn't wait for theInferenceLifecycleServiceauto-boot orchestrator.The Architectural Reality
In
runSandman.mjs, the custom healthcheckcheckProvider()is awaited beforeLifecycleService.ready()is invoked. Since the Inference daemon is bootstrapped insideSystemLifecycleService, the MLX or Ollama daemon never receives the command to start the background process before the script fatally exits.Path Forward
We must refactor
runSandman.mjsto awaitLifecycleService.ready()prior to polling the provider's health viacheckProvider(). This guarantees the daemon lifecycle service has the opportunity to spawn the.venvor equivalent backend process.