Refresh live model catalog when a harness session becomes active - #238
Merged
hardbeat920 merged 2 commits intoSep 15, 2026
Merged
hardbeat920 merged 2 commits into
hardbeat920 merged 2 commits into
Conversation
Model catalogs load lazily via CLI probes, but opening the model picker was the only trigger after boot (the boot refresh runs before restored sessions land, so it saw an empty harness list). A fresh Pi session therefore showed only the built-in 'Default' fallback model. Probe the active session's harness whenever it changes so the live catalog arrives with the session. refreshHarnessCatalogs is idempotent (deduped by hasLiveCatalog + inflight map), so this adds no repeat spawns.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughChangesLive harness catalog
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~2 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The documented catalog-refresh behavior has no identified merge-blocking risk in the supplied evidence. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Opening the model picker for a fresh session showed only the built-in fallback model (e.g. just
Defaultfor Pi) instead of the live catalog from the CLI (pi --mode rpcreports ~70 models for a gateway-configured setup).Root cause
Live model catalogs are loaded lazily — probing a CLI spawns a real process, so MonoCode deliberately avoids probing every harness at boot (see the comment in
refreshHarnessCatalogs). But the boot-time refresh runs in auseEffectwith[]deps that fires before restored sessions land insessionsRef, so it sees an empty harness list and never probes anything.The only remaining trigger was opening the model picker itself (
ModelPicker.tsx). If the probe fails or hasn't run, a newly created session sits on the fallback list indefinitely.Fix
Refresh the live catalog for the active session's harness whenever the active harness changes (
App.tsx). This covers:No repeat spawns:
refreshHarnessCatalogsis already idempotent —hasLiveCatalogskips harnesses whose catalog is loaded, andinflightdedupes concurrent probes.Testing
vitest run: 2121 passed, 0 failedSummary by CodeRabbit