Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

fix(models): align catalog revalidation with upstream cache (#996)

Call Whitedd4d2ad330ae
diff --git a/docs/plans/backend-model-catalog-service.md b/docs/plans/backend-model-catalog-service.md
index e19a2bb9b..d3fb916ad 100644
--- a/docs/plans/backend-model-catalog-service.md
+++ b/docs/plans/backend-model-catalog-service.md
@@ -115,7 +115,7 @@ missing metadata but cannot replace populated values.
- `snapshot()` never performs network I/O.
- If the persisted remote payload is absent/stale, `snapshot()` starts one
daemon refresh thread and returns immediately.
-- Successful remote checks are eligible for revalidation after 60 seconds and
+- Successful remote checks are eligible for revalidation after five minutes and
reuse same-source ETag/Last-Modified validators; a 304 advances the check
timestamp without replacing the last-known-good catalog.
- Remote payloads are strictly validated before replacing the cache.
diff --git a/tests/test_backend_model_catalog.py b/tests/test_backend_model_catalog.py
index fe5207877..93a374dd4 100644
--- a/tests/test_backend_model_catalog.py
+++ b/tests/test_backend_model_catalog.py
@@ -257,13 +257,13 @@ def test_snapshot_returns_immediately_while_remote_refresh_runs(monkeypatch, tmp
@pytest.mark.parametrize("timestamp_key", ["fetched_at", "checked_at"])
-def test_remote_catalog_revalidates_after_one_minute(monkeypatch, timestamp_key):
+def test_remote_catalog_revalidates_after_five_minutes(monkeypatch, timestamp_key):
payload = {timestamp_key: 100.0, "catalog": {"schema_version": 1, "backends": {}}}
- monkeypatch.setattr(backend_model_catalog.time, "time", lambda: 159.0)
+ monkeypatch.setattr(backend_model_catalog.time, "time", lambda: 399.0)
assert backend_model_catalog._remote_cache_stale(payload) is False
- monkeypatch.setattr(backend_model_catalog.time, "time", lambda: 160.0)
+ monkeypatch.setattr(backend_model_catalog.time, "time", lambda: 400.0)
assert backend_model_catalog._remote_cache_stale(payload) is True
diff --git a/vibe/backend_model_catalog.py b/vibe/backend_model_catalog.py
index e2f8c2707..bf9d2ff9b 100644
--- a/vibe/backend_model_catalog.py
+++ b/vibe/backend_model_catalog.py
@@ -20,7 +20,7 @@ REMOTE_CATALOG_URL_ENV = "AVIBE_BACKEND_MODEL_CATALOG_URL"
DEFAULT_REMOTE_CATALOG_URL = (
"https://raw.githubusercontent.com/avibe-bot/avibe/master/vibe/data/backend_models.json"
)
-REMOTE_CATALOG_REVALIDATE_SECONDS = 60
+REMOTE_CATALOG_REVALIDATE_SECONDS = 5 * 60
REMOTE_CATALOG_FAILURE_TTL_SECONDS = 10 * 60
REMOTE_CATALOG_TIMEOUT_SECONDS = 3.0
REMOTE_CATALOG_USER_AGENT = "avibe/backend-model-catalog"