Skip to content

fix: keep models that one catalog refresh omits - #6

Open
moutansos wants to merge 1 commit into
mainfrom
fix/retain-flapping-catalog-models
Open

moutansos wants to merge 1 commit into
mainfrom
fix/retain-flapping-catalog-models

Conversation

@moutansos

Copy link
Copy Markdown
Owner

Summary

  • Keep a model that CLIProxyAPI omits from a single /v1/models response instead of unregistering it immediately. One incomplete catalog was enough for OpenCode to report Model unavailable: cliproxyapi/<model> (seen with gpt-6.1-sol).
  • Drop the model only after it is missing from three consecutive successful catalogs. A failed request still keeps the previous catalog and does not count toward that window.
  • Write the retained list to the shared disk cache so another OpenCode process does not pick up the incomplete snapshot.

Test plan

  • bun run check (typecheck, 53 tests, build)
  • Unit coverage for the grace window, a model that returns, and a newly discovered model
  • Plugin refresh test: one catalog that omits a model leaves it registered and cached

CLIProxyAPI can leave a model out of a single /v1/models response and
include it again on the next. Replacing the catalog immediately
unregistered that model, so OpenCode reported it as unavailable. Hold a
missing model for three consecutive successful catalogs before dropping
it, and write that retained list to the shared cache.

Co-authored-by: Ben Brougher <Ben Brougher>
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.

1 participant