- Updated `resolve_llm_runtime` to prioritize live configuration over legacy notes, ensuring accurate runtime resolution. - Enhanced `tunnel_forwards` to prefer current configuration for LLM runtime, improving tunnel setup logic. - Improved idle-killer logic to handle stale markers and provide clearer warnings in the status output. - Updated CLI documentation in `cli.md` to reflect changes in command behavior and runtime handling. - Enhanced tests to validate new runtime resolution logic and ensure proper handling of configuration states.
5.4 KiB
5.4 KiB
Project Review — 2026-08-21 (2)
Prior Reviews Summary
Based on the last 3 review files analysed in Phase 0 (only
2026-08-21-review-1.mdexists).
Still Open (carried forward)
None.
Resolved Since Last Review
- [source: 2026-08-21-review-1, tasks 1–13] All prior tasks closed (wait_ssh, bootstrapped clear, access_rules attempt, GIT scrub, SG prune, CIDR example, SSH reuse in sync, light bootstrap flag, phase bootstrapping, Civitai non-blocking, session tests, journalctl logs, architecture docs).
Phase 1: Code Quality
SOLID
session.cmd_up/_bind_accessstill orchestrate cloud + SSH + bootstrap + provision + LLM + snapshot + notify (god-flow). Acceptable for a small CLI, but growing with LLM.- New modules (
llm_runtime,setup_wizard,access_card) are reasonably scoped.
Performance
arm_idle_killerstill opens many short SSH sessions (put_text/run_sshper step) — sync_files was fixed in review-1; idle-arm was not.- Every
upstill runs fulldoctor(Keystone + Glance + …) even when user already ran doctor.
Correctness & Bugs
- Ollama pull skip can treat a different tag of the same model as “already present” (
listed()stores bare name; match usesstartswith). - Pull marker
.gpu-rent-ollama-pullingcan stick after SSH timeout → idle-killer forever busy. provision_llmexceptions swallowed → tunnel/access card can show LLM URLs while install failed;notes.llm_runtimemay stay stale.- Light bootstrap requires
state.bootstrappedand VM marker;stopclears localbootstrapped→ almost always full apt after stop→up (conflicts with review-1 perf goal). clone_extSystemExit(2)on origin mismatch skips token file unlink inmain().- App cred
access_rulesinclude/v2.1/servers/*(any server) plus unrestricted fallback; not revoked onstop.
Code Quality
- Dead branch in
push_tree(_is_weight_name+ emptypass). OllamaModelEntry.defaultwritten/parsed but unused in pull.- Invalid
LLM_RUNTIMEin env silently coerced tonone.
Phase 2: Logical Consistency
Domain & Application Layer
- Docs/architecture updated for LLM; product still SwarmUI-first with opt-in LLM — consistent with decisions.
Data Flow
- Tunnel /
open --llm/ access card preferstate.notes["llm_runtime"]over live config — desync if provision failed or vars changed without re-provision.
State Management
LLM_RUNTIME=nonedoes not stop/disable remote LLM systemd units → GPU may stay occupied.- Soft-fail
wait_backend_idle/ soft-failarm_idle_killerstill yieldready_cloud/ “ready” UX while killer may be blind.
Consistency
- Error handling: mix of hard
CloudError(bootstrap) vs soft log (LLM, killer, ready). Uneven.
Phase 3: UI/UX (CLI)
Usability
- Bare
gpu-rentinvokes full interactiveup(expensive surprise). - Full doctor table on every
upis noisy. - Interactive Ollama preset typo raises raw
ValueError. - Access card at tunnel end is a clear UX win.
Visual & Consistency
- Rich access panel is coherent; toast text still SwarmUI-only (minor).
Interaction & Feedback
--no-tunnelstill shows access card with tunnel hint — good.- Soft LLM failure gives little signal beyond a log line.
Accessibility
- N/A (CLI).
Tasks
- 1. [Security] Narrow idle-killer access_rules to this
server_idonly (drop/servers/*); fail closed or warn loudly instead of unrestricted fallback; revoke app cred onstop/destroy—src/gpu_rent/idle_killer.pyline 57 - 2. [Security] Ensure
GIT_TOKENfile is always removed (try/finallyaroundmain, convertSystemExitpaths to raised errors) —src/gpu_rent/remote/clone_ext.pyline 116 - 3. [Bug] Fix Ollama pull skip: match exact tag only (do not skip
foo:7bbecausefoo:3bexists) —src/gpu_rent/remote/ollama_pull.pyline 14 - 4. [Bug] Age out or clear stale
.gpu-rent-ollama-pullingin idle-killer (e.g. ignore marker older than N minutes) —src/gpu_rent/remote/idle_killer.pyline 93 - 5. [Logic] Do not swallow
provision_llmfailures; updatenotes.llm_runtimeonly after success; prefer cfg over stale notes when they disagree —src/gpu_rent/provision.pyline 340 - 6. [Logic] When
LLM_RUNTIME=none(or switching runtime), stop/disable previousgpu-rent-ollama/gpu-rent-llamacppunits —src/gpu_rent/provision.pyline 262 - 7. [Performance] Light bootstrap when VM marker exists even if local
bootstrapped=Falseafter stop (or restore bootstrapped from marker after SSH) —src/gpu_rent/session.pyline 101 - 8. [UX] Bare
gpu-rentshould show help or a short menu, not auto-up; keep launcherGPU_RENT_DEFAULT_ARGSfor double-click —src/gpu_rent/cli.pyline 53 - 9. [UX] Quiet doctor on
up(summary / only failures) unless--verbose—src/gpu_rent/cli.pyline 403 - 10. [Logic] Surface idle-killer arm failure as warning in status/access card, not silent soft-log only —
src/gpu_rent/provision.pyline 344 - 11. [CodeQuality] Remove dead
_is_weight_namepass inpush_tree; useOllamaModelEntry.defaultor drop the field —src/gpu_rent/sync_files.pyline 44 - 12. [Security] Pin/checksum Ollama install script and llama.cpp release asset (or document supply-chain risk) —
src/gpu_rent/remote/install_ollama.shline 20