Repository navigation
feat: say where each upstream's model list stands, and let the page ask for missing ones - #47
Merged
Merged
Conversation
…sk for missing ones The overview only said where a list came from (discovered, manual, none), so an upstream not asked yet, one whose key was refused and one that offers no list all read as "not fetched". And background fetches finished without telling anyone, so the upstream page kept what it read at startup until something else made it reload. - ProviderView and ProviderModelsView carry the fetch status (pending / listed / no_list / failed), whether a fetch is in flight, when the list was last checked and why it failed. - Every fetch reports models_changed when it starts and when its answer is recorded. - POST /models/refresh asks, in the background, the enabled upstreams with no answer, a failed one, or an out-of-date one. It skips upstreams asked in the last minute, upstreams being asked, and upstreams that offer no list until that answer expires, and returns the names it started on. - In-flight asks are counted per upstream, so a background round and a user refresh at the same time do not clear each other's state, and the background round skips upstreams already being asked. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Thanks for the PR. One thing before review: this targets
No need to close and reopen: click Edit next to the PR title and change the base branch to See CONTRIBUTING.md and CONTRIBUTING.md for the branch contract. |
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
4 tasks done
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.
Summary
The upstream page shows "not fetched" for upstreams whose models core had already fetched, failed to fetch, or cannot fetch at all:
model_source(discovered / manual / none), so "not asked yet", "key refused" and "offers no list" were indistinguishable.This adds what the page needs to show the real state and to fetch missing lists without the user asking.
ProviderViewgainsmodel_status(pending/listed/no_list/failed),model_fetching,model_checked_at_msandmodel_error;ProviderModelsViewgainsstatusandfetching. Status and source are separate on purpose: a failed fetch can still be backed by a manual list.models_changedevent when a fetch starts and when its answer is recorded (after the catalog is republished, so a reload sees the new count).POST /models/refreshfor page visits: asks the enabled upstreams with no answer, a failed answer or an expired one, in the background, and returns the names it started on. It skips upstreams asked in the last minute, upstreams already being asked, and upstreams that offer no list until that answer expires.Test plan
models_changedand endslistedwith the right count, then asks nothing on a second visit; a refused key endsfailedwith the reason.cargo fmt,cargo clippy --workspace --all-targets -D warnings,cargo test --workspace,scripts/smoke.sh(51 pass, 0 fail; covers the new endpoint and fields).🤖 Generated with Claude Code