- Replaced direct calls to `venv/bin/pip` with `python -m pip` to avoid execution errors on network mounts and improve compatibility. - Introduced a new function `find_comfy_python` to locate the appropriate Python executable for ComfyUI installations. - Updated the `pip_install_sage` function to utilize the new Python handling, enhancing installation reliability. - Added tests to verify the new behavior of Python environment detection and installation processes, ensuring robustness.
5.4 KiB
Project Review — 2026-08-21 (4)
Фокус: скрытые логические инверсии / wait-forever / billing (как idle≠running).
Prior Reviews Summary
Based on
2026-08-21-review-3,review-2,review-1.
Still Open (carried forward)
None.
Resolved Since Last Review
None newly verified in this pass (prior reviews already all [x]).
Phase 1: Code Quality
SOLID
No issues found.
Performance
No issues found beyond existing network-disk du / walk costs (acceptable).
Correctness & Bugs
-
Bug (critical) — idle-killer treats SwarmUI
backend_status=emptyas not busy —src/gpu_rent/remote/idle_killer.pyswarm_busy(). During first Comfy install (15–40+ min) status can stayempty/unknownwith empty queue; after grace the idle clock can delete the VM mid-install. Same class as treating wrong Swarm status as “done”. -
Bug (critical) — Ollama pull marker expires at 45m while pull timeout is 7200s —
src/gpu_rent/remote/idle_killer.pyllm_busy()+src/gpu_rent/remote/ollama_pull.py. Marker timestamp is written once and never refreshed; after 45m killer clears it and may stop GPU during a long pull. -
Bug (critical) —
seed_autocompletecan overwrite entireSettings.fds—src/gpu_rent/provision.pyseed_autocomplete(). If meta exists withoutsettings_applied=true,put_textreplaces Settings with only AutoComplete stub — wipesIsInstalled/ other settings. -
Bug (high) —
wait_backend_idletreats SwarmUIidleas forever BUSY with no wake —src/gpu_rent/ready.py. After auto-suspend, backends reportidle(cannot generate) and never becomerunningwithout a wake;upcan burn the full timeout. -
Bug (high) —
install_swarm_comfyskip path still labels Swarmidleas “already Idle” —src/gpu_rent/remote/install_swarm_comfy.pymain(). Misleading; should skip because backends exist, then align with wake/runningwait. -
Bug (high) — local tunnel verify forces OK on TCP-only —
src/gpu_rent/ready.pyverify_stack_local(). IfGET /and API fail, stillok=TruewithTCP :port open— marks tunnel ready when SwarmUI is dead. -
Bug (high) — torch without CUDA polls 600s —
src/gpu_rent/remote/stack_env_probe.py+verify_gpu_env. Instant-fail covers driver/libcuda/empty dlbackend, but not “torch imported, cuda=False” (CPU wheel won’t heal). -
Bug (high) — perf tune execs
venv/bin/pip→OSError: Exec format error—src/gpu_rent/remote/tune_swarm_perf.pypip_install_sage(). Observed on live up; OSError not caught → script exit 1; sageattention missing. Fixing in this session viapython -m pip. -
Bug (medium) — access card / open use
resolve_llm_runtime(notes override) but tunnel uses cfg only —access_card.pyvstunnel.py. Can advertise Ollama URLs with no forward. -
Bug (medium) —
statustunnel check only probes SwarmUI local port —cli.py. llm-only looks like “туннель нет”. -
Bug (medium) — tunnel Nova poll soft-fail returns fake
ACTIVE—tunnel.py_poll_nova(). Masks DELETED/ERROR.
Code Quality
No separate issues beyond the above.
Phase 2: Logical Consistency
Domain & Application Layer
No issues found.
Data Flow
See #9 (cfg vs notes for LLM runtime).
State Management
See #1–#2 (busy markers / status semantics).
Consistency
SwarmUI status vocabulary (running / idle / empty / loading) was inconsistent across wait vs killer; running=ready is fixed, remaining gaps in #1/#4/#5.
Phase 3: UI/UX
Usability
Access card correctly deferred until tunnel (recent change). Mid-up wait messages improved.
Visual & Consistency
No issues found.
Interaction & Feedback
Perf tune failure was noisy traceback then continued — should be WARN without stack (addressed with OSError catch + -m pip).
Accessibility
N/A (CLI).
Tasks
- 1. [Bug] Treat SwarmUI
empty(and likelydisabledduring provision) as busy in idle-killer —src/gpu_rent/remote/idle_killer.pyswarm_busy - 2. [Bug] Refresh
.gpu-rent-ollama-pullingduring pull and/or raise stale max-age ≥ pull timeout (7200s) —src/gpu_rent/remote/idle_killer.py+ollama_pull.py - 3. [Bug] Never overwrite full
Settings.fdsin autocomplete seed — merge AutoComplete only —src/gpu_rent/provision.pyseed_autocomplete - 4. [Bug] On wait, wake suspended backends or accept healthy path when status=
idleafter install; don’t burn 2400s —src/gpu_rent/ready.pywait_backend_idle - 5. [Bug] Fix
install_swarm_comfyskip wording/logic foridlevs backends-present —src/gpu_rent/remote/install_swarm_comfy.py - 6. [Bug]
verify_stack_local: do not mark SwarmUI ok on TCP-only when HTTP/API fail —src/gpu_rent/ready.py - 7. [Bug] Fail-fast when Comfy torch imports but
cuda=False—stack_env_probe.py/verify_gpu_env - 8. [Bug] Perf tune: use
python -m pip(notvenv/bin/pip) and catch OSError —src/gpu_rent/remote/tune_swarm_perf.py - 9. [Logic] Single source of truth for LLM runtime in access card vs tunnel —
access_card.py/tunnel.py - 10. [UX]
statusshould probe ports fromtunnel_forwards(cfg)—cli.py - 11. [Bug] Tunnel Nova soft-fail must not fake ACTIVE forever —
tunnel.py_poll_nova