LearnNewsExamplesServices
Frontmatter
id9832
titlefix(ai): Resolve autonomous runSandman startup sequence race condition
stateClosed
labels
bugai
assigneestobiu
createdAtApr 9, 2026, 8:27 PM
updatedAtApr 9, 2026, 8:28 PM
githubUrlhttps://github.com/neomjs/neo/issues/9832
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtApr 9, 2026, 8:28 PM

fix(ai): Resolve autonomous runSandman startup sequence race condition

Closedbugai
tobiu
tobiu commented on Apr 9, 2026, 8:27 PM

The Problem

When running the ai:run-sandman pipeline (node ./buildScripts/ai/runSandman.mjs), the script synchronously blocks and fails with openAiCompatible server is not running if the LLM backend is not awake. This breaks autonomous workflows because it doesn't wait for the InferenceLifecycleService auto-boot orchestrator.

The Architectural Reality

In runSandman.mjs, the custom healthcheck checkProvider() is awaited before LifecycleService.ready() is invoked. Since the Inference daemon is bootstrapped inside SystemLifecycleService, 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.mjs to await LifecycleService.ready() prior to polling the provider's health via checkProvider(). This guarantees the daemon lifecycle service has the opportunity to spawn the .venv or equivalent backend process.

tobiu added the bug label on Apr 9, 2026, 8:27 PM
tobiu added the ai label on Apr 9, 2026, 8:27 PM
tobiu referenced in commit 384768a - "fix(ai): Resolve autonomous runSandman startup sequence race condition (#9832)" on Apr 9, 2026, 8:28 PM
tobiu assigned to @tobiu on Apr 9, 2026, 8:28 PM
tobiu
tobiu Apr 9, 2026, 8:28 PM

Input from Antigravity (Gemini):

✦ The runSandman.mjs startup pipeline has been successfully refactored. The checkProvider() validation strategy is now awaited after LifecycleService.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 .json endpoints. Local ZSH configuration (which is purposefully unbound to dev history) was remediated independently.

tobiu closed this issue on Apr 9, 2026, 8:28 PM