fix: resume Local AI setup with a new model - #1232
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs changes before merge. Reviewed August 26, 2026, 1:03 PM ET / 17:03 UTC. ClawSweeper reviewWhat this changesThis PR lets resumed Local AI setup reuse its verified llama-server runtime when a different catalog model is selected, replace the persisted installation and gateway route, and restore the prior state on rollback. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readinessKeep open. The prior gateway-route rollback concern is covered, but the replacement branch now bypasses the existing GPU-identity guard whenever the model also changes, expanding this from a model replacement into an unvalidated GPU migration. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — execution before step 1 Assertions:
How this fits togetherLocal AI setup persists a verified llama-server receipt, then configures the gateway’s local provider and primary model. Restart reconciliation compares the stored receipt with current hardware and model selection before reusing or replacing the installation. flowchart LR
A[Saved Local AI receipt] --> B[Setup reconciliation]
C[Selected model and GPU] --> B
B --> D{Receipt matches?}
D -->|Same model| E[Reuse verified installation]
D -->|New model| F[Download replacement model]
F --> G[Persist receipt]
G --> H[Configure gateway route]
H --> I[Rollback prior receipt and route]
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Preserve the existing GPU identity requirement around model replacement, then prove the unchanged-GPU replacement and a rejected changed-GPU attempt on the exact Windows head. Do we have a high-confidence way to reproduce the issue? Yes. A saved GPU-0 receipt with a newly selected model and GPU-1 reaches the model-mismatch return before the only SelectedGpuId check, so the failure is directly reproducible from the source path. Is this the best way to solve the issue? No. The current approach should preserve the existing GPU guard before permitting the intended model-only replacement; that is narrower than silently accepting both changes. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1e18866d9b42. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Addressed the ClawSweeper P1 in d9fd022.
Native Windows CI is rerunning now. @clawsweeper re-review |
|
Fixed the Windows CI compile failure in the GPU test fixture. |
Adversarial dual-model reviewVerdict: SHIP AFTER FIXES Claude Opus and GPT Codex independently reviewed the PR diff, then cross-examined the disputed interruption path. Both confirmed one release blocker. HIGH consensus
Affected regions:
Required fix direction: make the replacement transition durable across process termination, retaining enough trusted prior-install/provider provenance to complete or roll back the A-to-B gateway transition. Keep the exact-provider ownership checks. Do not broaden them to accept merely managed-looking configuration. Required regression coverage: add a fresh-process crash/resume test for the window after manifest replacement and before gateway configuration, plus uninstall behavior from that drift state. LOW consensus
In-process rollback ordering, reused-runtime preservation, API-key redaction handling, and fallback/primary propagation were reviewed and found sound for uninterrupted replacement. Regression risk: Medium-high for interrupted model replacement; low for the uninterrupted happy path. |
Summary
Related context: #1206 and #1208 address complementary post-install Local AI availability and first-start behavior. They do not overlap this setup reconciliation path.
Validation
git diff --check- PASSautoreview --mode local- PASS, no accepted/actionable findings after one rollback-preservation fixReal behavior proof
Not verified yet. Native Windows CI and focused setup-engine regression results are pending. The controller host is macOS, so no local WinUI claim is made.
Security impact
No new permissions, credentials, network endpoints, or command surfaces. Existing runtime and model receipts remain fail-closed; only an explicit catalog model-ID change enters the replacement path.