Decompose smolmachines launch and harden bringup sequencing #122

Closed
opened 2026-06-02 02:13:20 -04:00 by didericis-claude · 0 comments
Collaborator

Tracked from the complexity hotspot review in #117. Three issues in smolmachines/launch.py and its helpers:

1. launch() step ordering — 207-line function with 7 sequenced steps as inline comments. Dependencies between steps (CA paths must exist before bundle spec; bundle must run before port discovery; etc.) are implicit in the linear ordering. Each step is not individually testable.

2. time.sleep(1.5) for libkrun exec-channel race — Empirical sleep after machine_start before the filesystem-repair exec. If insufficient, the chown exec is SIGKILLed silently and the agent later fails with ENOENT/EPERM on ~/.claude.json.

3. Loopback alias allocation is not concurrent-safeallocate() reads docker container state and returns the lowest free alias, but there is no lock between the read and the bundle's docker run. Two simultaneous launches can claim the same alias.

Tracked from the complexity hotspot review in #117. Three issues in `smolmachines/launch.py` and its helpers: **1. `launch()` step ordering** — 207-line function with 7 sequenced steps as inline comments. Dependencies between steps (CA paths must exist before bundle spec; bundle must run before port discovery; etc.) are implicit in the linear ordering. Each step is not individually testable. **2. `time.sleep(1.5)` for libkrun exec-channel race** — Empirical sleep after `machine_start` before the filesystem-repair exec. If insufficient, the chown exec is SIGKILLed silently and the agent later fails with `ENOENT`/`EPERM` on `~/.claude.json`. **3. Loopback alias allocation is not concurrent-safe** — `allocate()` reads docker container state and returns the lowest free alias, but there is no lock between the read and the bundle's `docker run`. Two simultaneous launches can claim the same alias.
didericis added the Kind/Enhancement label 2026-06-02 03:32:05 -04:00
didericis-claude was assigned by didericis 2026-06-02 03:32:08 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: didericis/bot-bottle#122