Skip to content

Keep newly set-up local models on the Agents panel index - #20167

Merged
dhh merged 2 commits into
quattrofrom
fix-local-model-setup-race
Nov 25, 2026
Merged

dhh merged 2 commits into
quattrofrom
fix-local-model-setup-race

Conversation

@dhh

@dhh dhh commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes a race where a local model set up from the Agents add screen finished installing and running, disappeared from the Add screen's progress bar, and never appeared on the Agents index.

Root cause

When omarchy-models use --detach exited (exitCode === 0), Models.qml's finishSetup(0) cleared settingUp synchronously while localModelFile.reload() (status.json) was still in flight asynchronously. In that window, Panel.qml's removedLocalModels binding saw !localModels[target], an empty setupRows(), and recipe.installed === false in list.json—mistaking the newly started setup for an uninstalled model and wiping usage.addedLocalModels in memory (also emitting a Binding loop detected for property "removedLocalModels" warning).

Changes

  • Track recipes whose detached setup just exited cleanly in Models.qml (handingOff) until parseLocalModel reloads status.json with them.
  • Exclude settingUpLocal and handingOff in Panel.qml's findRemovedLocalModels() so setups handing off to the background unit are never dropped from addedLocalModels.
  • Defer usage.removeLocalModels(...) and settingUpLocal = "" via Qt.callLater(...) to eliminate both the removedLocalModels and localSetup QML binding loop warnings.

Verification

  • bash test/shell.d/local-models-test.sh
  • bash test/shell.d/agents-panel-test.sh

@greptile-apps

greptile-apps Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the previous model-removal issue is fixed.

Summary

Keeps newly added local models on the Agents index while setup moves into the background.

  • Newly set-up local models stay on the Agents index.

Reviews (2) · Last reviewed commit: "Recheck removedLocalModels inside deferr..." · Reviewed by Greptile

Comment thread shell/plugins/agents/Panel.qml Resolved
@dhh
dhh merged commit f836723 into quattro Nov 25, 2026
6 checks passed
@dhh
dhh deleted the fix-local-model-setup-race branch November 25, 2026 17:12
cursor Bot pushed a commit to mark-groves/omarchy that referenced this pull request Nov 25, 2026
* Keep newly set-up local models on the Agents panel index

* Recheck removedLocalModels inside deferred removal callback
@emirb emirb added this to the 4.6.0 milestone Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants