feat(config): live model fetching for Copilot and Venice#3103
feat(config): live model fetching for Copilot and Venice#3103taoeffect wants to merge 16 commits into
Conversation
…dates in update-providers
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds authenticated “live” provider model syncing for Venice and Copilot (with caching), and changes UI model-related actions to persist at workspace scope to avoid being overridden.
Changes:
- Persist selected models + thinking/reasoning settings at
ScopeWorkspace(and add regression tests). - Introduce live provider model clients/syncing for Venice and Copilot, including CLI support (
update-providers --source=venice|copilot) and best-effort refresh on default updates. - Add unit/integration tests covering live provider overlays, caching/TTL behavior, and CLI help/examples.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/ui/model/ui_test.go | Adds tests ensuring workspace-scoped persistence for model selection/thinking/reasoning. |
| internal/ui/model/ui.go | Persists model selection/thinking/reasoning at workspace scope and factors logic into helpers. |
| internal/server/recover_test.go | Updates tests to use context-aware HTTP requests. |
| internal/config/venice_models_test.go | Tests Venice live models client mapping/filtering and auth header behavior. |
| internal/config/venice_models.go | Implements Venice /models live client + response-to-catwalk mapping. |
| internal/config/provider_test.go | Adds integration tests for live overlay behavior, credentials, and cache updates. |
| internal/config/provider.go | Adds live overlay plumbing, Venice/Copilot update entrypoints, and credential detection helpers. |
| internal/config/live_provider_test.go | Adds comprehensive tests for live provider sync behavior (cache, TTL, errors). |
| internal/config/live_provider.go | Implements generic live provider sync w/ cache + TTL merge behavior. |
| internal/config/copilot_models_test.go | Tests Copilot live models client mapping and OAuth refresh behavior. |
| internal/config/copilot_models.go | Implements Copilot /models live client + filtering/deduping logic. |
| internal/cmd/update_providers_test.go | Ensures CLI flags/examples mention the new live providers. |
| internal/cmd/update_providers.go | Adds `--source=venice |
| README.md | Documents that update-providers also refreshes live providers when authenticated. |
| AGENTS.md | Documents provider update/live overlay behavior and TTL concept. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ffort toggles Assisted-by: Claude Opus 4.6 (via Crush)
|
If we have a manual update command and these things only change every few months, does there need to be a request happening every minute? I've got 8-15 instances of crush running on my machine, mostly idling in different work trees. Do they all need to check every minute? I would say remove them or check once or twice a day. |
|
The check isn't happening once per minute, it's once at startup (and then at most, once per minute), so your 8-15 instances won't be checking at all while they're idling. I don't think users will be starting crush up that frequently... EDIT: Edited PR description to make this clearer. |
Make live provider model refresh non-blocking on startup and propagate completed refreshes into the running session. The TUI now starts with the catwalk seed or warm cache immediately while stale/missing live caches refresh in the background. A syncer completion callback updates a lock-guarded provider list and publishes a ProvidersUpdatedEvent over a config pubsub broker, which the UI uses to repopulate an open model dialog without restarting Crush.
Closes #2740
Motivation
Crush's model list for GitHub Copilot and Venice comes from Catwalk, a static community-maintained database. When these providers add, remove, or change models, users have to wait for a Catwalk update — even though both providers expose a
/modelsAPI with the current list. This led to stale model pickers, missing new models, and outdated metadata (context windows, pricing, reasoning support).Also, per #2740, some of the models that are in Catwalk could be different from the actual models the user has access to, depending on their subscription/plan.
Approach
When you're signed in to Copilot (OAuth, with expired tokens refreshed just for the fetch) or Venice (API key), Crush fetches the model list directly from the provider at startup:
crush update-providersalso refreshes authenticated live providers;--source=venice/--source=copilotrefresh them directly, bypassing the cache.capabilities.typefield rather than ID guesswork.Respects
disable_provider_auto_updateand works offline, same as the existing Catwalk/Hyper sync.AI Disclosure
Assisted with: Fable 5 (max), GPT-5.5 (xhigh), and Opus 4.8
I had Opus 4.8 create the plan files, GPT-5.5 implement them, and finally Fable 5 review and fix bugs.
Three rounds of reviews were used (two local, one Copilot).
CONTRIBUTING.md.