From 2c48fc46fe15cc3a76d96182995e657274e3f8ff Mon Sep 17 00:00:00 2001 From: JoshRob297 <99092299+JoshRob297@users.noreply.github.com> Date: Sat, 24 Oct 2026 23:46:57 -0600 Subject: [PATCH] chore: lower catalog cache TTL from 12h to 6h (v1.0.5) - Update CATALOG_TTL_MS in src/client/api.ts from 12h to 6h for faster detection of upstream model additions, deprecations, and free promotions - Update docs and architecture specs (EN/ES) - Bump version to 1.0.5 and update CHANGELOG --- CHANGELOG.md | 8 +++++++- README.es.md | 4 ++-- README.md | 4 ++-- docs/ARCHITECTURE.md | 2 +- docs/CONFIGURATION.md | 4 ++-- docs/es/architecture.md | 2 +- docs/es/configuration.md | 4 ++-- package.json | 2 +- src/client/api.ts | 2 +- 9 files changed, 19 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c062904..00292a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,13 @@ Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) - SemVer. ## [Unreleased] -## [1.0.4] - 2026-10-20 +## [1.0.5] - 2026-10-24 + +### Changed + +- Lowered catalog cache TTL (`CATALOG_TTL_MS`) from 12h to 6h so upstream provider rotations, deprecations, and newly added free promo models are discovered twice as fast. + + ### Fixed diff --git a/README.es.md b/README.es.md index b2fbce1..0ff3884 100644 --- a/README.es.md +++ b/README.es.md @@ -46,7 +46,7 @@ mediante el editor de modelos de OpenCode v2: `trial` en el nombre visible. - **Ventana de contexto real** por modelo, y los modelos multimodales declaran entrada `image`. -- **Funciona sin red.** El catalogo se cachea en disco (TTL 12h). Si Command Code esta +- **Funciona sin red.** El catalogo se cachea en disco (TTL 6h). Si Command Code esta caido o no hay red, OpenCode arranca igual con el ultimo catalogo bueno en lugar de quedarse con el proveedor vacio. @@ -224,7 +224,7 @@ Kill switch en runtime para la higiene de conexion: crea un archivo centinela ll | `/commandcode-sanitizer.log` | Cada reparacion de payload en vuelo, con las correcciones aplicadas | | `/commandcode-watchdog.log` | Streams SSE abortados por inactividad | | `/commandcode-retries.log` | Reintentos de transporte de Command Code: sesion, agente, proveedor, modelo, tipo de error, status HTTP, numero de intento, delay del backoff y mensaje | -| `/commandcode-models-cache.json` | Ultimo catalogo de modelos bueno (TTL 12h) | +| `/commandcode-models-cache.json` | Ultimo catalogo de modelos bueno (TTL 6h) | `` por defecto es `~/.local/state/opencode`. diff --git a/README.md b/README.md index 32d462c..11d5cac 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ through the OpenCode v2 model editor: `trial` in the display name. - **Advertised context window** is preserved per model, and vision-capable models declare `image` input. -- **Offline-safe.** The catalog is cached on disk (12h TTL). If Command Code is +- **Offline-safe.** The catalog is cached on disk (6h TTL). If Command Code is down or the network is unavailable, OpenCode still starts with the last known good catalog instead of an empty provider. @@ -218,7 +218,7 @@ Runtime kill switch for connection hygiene: create a sentinel file named | `/commandcode-sanitizer.log` | Every in-flight payload repair, with the fixes applied | | `/commandcode-watchdog.log` | Aborted stalled SSE streams | | `/commandcode-retries.log` | Command Code transport retries: session, agent, provider, model, error type, HTTP status, attempt number, backoff delay and message | -| `/commandcode-models-cache.json` | Last known good model catalog (12h TTL) | +| `/commandcode-models-cache.json` | Last known good model catalog (6h TTL) | `` defaults to `~/.local/state/opencode`. diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 2a7dbd6..a508cbc 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -149,7 +149,7 @@ chunk 1 arrives 60s inactivity window armed ``` /latest catalog (network, 10s timeout) | - +-- ok --------> filter -> register -> write cache (12h TTL) + +-- ok --------> filter -> register -> write cache (6h TTL) | +-- fail ------> read cache -> register | diff --git a/docs/CONFIGURATION.md b/docs/CONFIGURATION.md index d672303..931479f 100644 --- a/docs/CONFIGURATION.md +++ b/docs/CONFIGURATION.md @@ -70,7 +70,7 @@ Files written under the state directory: | `commandcode-sanitizer.log` | append | JSON lines, one per repaired payload | | `commandcode-watchdog.log` | append | JSON lines, one per aborted stream | | `commandcode-retries.log` | append | JSON lines, Command Code retries only | -| `commandcode-models-cache.json` | overwrite | `{ at, models[] }`, 12h TTL | +| `commandcode-models-cache.json` | overwrite | `{ at, models[] }`, 6h TTL | Logs are append-only and never rotated by the plugin. At the observed event rate (tens of lines per week) this is not a concern; if you want rotation, point @@ -81,7 +81,7 @@ Logs are append-only and never rotated by the plugin. At the observed event rate | Constant | Value | Location | | --- | --- | --- | | API request timeout | 10s | `DEFAULT_TIMEOUT_MS` in `src/client/api.ts` | -| Catalog cache TTL | 12h | `CATALOG_TTL_MS` in `src/client/api.ts` | +| Catalog cache TTL | 6h | `CATALOG_TTL_MS` in `src/client/api.ts` | | SSE inactivity window | 60s | `WATCHDOG_TIMEOUT_MS` in `src/index.ts` | | Default output limit per model | 16384 | `applyModelCatalog` in `src/index.ts` | diff --git a/docs/es/architecture.md b/docs/es/architecture.md index 5051498..25d5002 100644 --- a/docs/es/architecture.md +++ b/docs/es/architecture.md @@ -152,7 +152,7 @@ llega el chunk 1 se arma la ventana de inactividad de 60s ``` catalogo vivo (red, timeout 10s) | - +-- ok --------> filtrar -> registrar -> escribir cache (TTL 12h) + +-- ok --------> filtrar -> registrar -> escribir cache (TTL 6h) | +-- falla -----> leer cache -> registrar | diff --git a/docs/es/configuration.md b/docs/es/configuration.md index 2a5237e..8d3179f 100644 --- a/docs/es/configuration.md +++ b/docs/es/configuration.md @@ -70,7 +70,7 @@ Archivos escritos bajo el directorio de estado: | `commandcode-sanitizer.log` | append | JSON lines, una por payload reparado | | `commandcode-watchdog.log` | append | JSON lines, una por stream abortado | | `commandcode-retries.log` | append | JSON lines, solo reintentos de Command Code | -| `commandcode-models-cache.json` | sobrescritura | `{ at, models[] }`, TTL 12h | +| `commandcode-models-cache.json` | sobrescritura | `{ at, models[] }`, TTL 6h | Los logs son append-only y el plugin no los rota. A la tasa observada (decenas de lineas por semana) no es un problema; si querés rotacion, apunta @@ -81,7 +81,7 @@ lineas por semana) no es un problema; si querés rotacion, apunta | Constante | Valor | Ubicacion | | --- | --- | --- | | Timeout de request a la API | 10s | `DEFAULT_TIMEOUT_MS` en `src/client/api.ts` | -| TTL de la cache del catalogo | 12h | `CATALOG_TTL_MS` en `src/client/api.ts` | +| TTL de la cache del catalogo | 6h | `CATALOG_TTL_MS` en `src/client/api.ts` | | Ventana de inactividad SSE | 60s | `WATCHDOG_TIMEOUT_MS` en `src/index.ts` | | Limite de salida por defecto | 16384 | `applyModelCatalog` en `src/index.ts` | diff --git a/package.json b/package.json index c138fef..89b7953 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "opencode-commandcode", - "version": "1.0.4", + "version": "1.0.5", "description": "Production-grade OpenCode plugin for Command Code: dynamic model discovery, stability hooks and quota telemetry", "main": "index.ts", "type": "module", diff --git a/src/client/api.ts b/src/client/api.ts index edbe68e..953a13c 100644 --- a/src/client/api.ts +++ b/src/client/api.ts @@ -21,7 +21,7 @@ export const API_BASE = "https://api.commandcode.ai"; export const CLI_VERSION = "1.73.4"; const DEFAULT_TIMEOUT_MS = 10_000; -const CATALOG_TTL_MS = 12 * 60 * 60 * 1000; +const CATALOG_TTL_MS = 6 * 60 * 60 * 1000; export interface CommandCodeModel { id: string;