Skip to content

Commit 2c48fc4

Browse files
committed
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
1 parent 0e5cb17 commit 2c48fc4

9 files changed

Lines changed: 19 additions & 13 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) - SemVer.
55

66
## [Unreleased]
77

8-
## [1.0.4] - 2026-10-20
8+
## [1.0.5] - 2026-10-24
9+
10+
### Changed
11+
12+
- 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.
13+
14+
915

1016
### Fixed
1117

‎README.es.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ mediante el editor de modelos de OpenCode v2:
4646
`trial` en el nombre visible.
4747
- **Ventana de contexto real** por modelo, y los modelos multimodales declaran entrada
4848
`image`.
49-
- **Funciona sin red.** El catalogo se cachea en disco (TTL 12h). Si Command Code esta
49+
- **Funciona sin red.** El catalogo se cachea en disco (TTL 6h). Si Command Code esta
5050
caido o no hay red, OpenCode arranca igual con el ultimo catalogo bueno en lugar de
5151
quedarse con el proveedor vacio.
5252

@@ -224,7 +224,7 @@ Kill switch en runtime para la higiene de conexion: crea un archivo centinela ll
224224
| `<state>/commandcode-sanitizer.log` | Cada reparacion de payload en vuelo, con las correcciones aplicadas |
225225
| `<state>/commandcode-watchdog.log` | Streams SSE abortados por inactividad |
226226
| `<state>/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 |
227-
| `<state>/commandcode-models-cache.json` | Ultimo catalogo de modelos bueno (TTL 12h) |
227+
| `<state>/commandcode-models-cache.json` | Ultimo catalogo de modelos bueno (TTL 6h) |
228228

229229
`<state>` por defecto es `~/.local/state/opencode`.
230230

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ through the OpenCode v2 model editor:
4343
`trial` in the display name.
4444
- **Advertised context window** is preserved per model, and vision-capable models
4545
declare `image` input.
46-
- **Offline-safe.** The catalog is cached on disk (12h TTL). If Command Code is
46+
- **Offline-safe.** The catalog is cached on disk (6h TTL). If Command Code is
4747
down or the network is unavailable, OpenCode still starts with the last known
4848
good catalog instead of an empty provider.
4949

@@ -218,7 +218,7 @@ Runtime kill switch for connection hygiene: create a sentinel file named
218218
| `<state>/commandcode-sanitizer.log` | Every in-flight payload repair, with the fixes applied |
219219
| `<state>/commandcode-watchdog.log` | Aborted stalled SSE streams |
220220
| `<state>/commandcode-retries.log` | Command Code transport retries: session, agent, provider, model, error type, HTTP status, attempt number, backoff delay and message |
221-
| `<state>/commandcode-models-cache.json` | Last known good model catalog (12h TTL) |
221+
| `<state>/commandcode-models-cache.json` | Last known good model catalog (6h TTL) |
222222

223223
`<state>` defaults to `~/.local/state/opencode`.
224224

‎docs/ARCHITECTURE.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ chunk 1 arrives 60s inactivity window armed
149149
```
150150
/latest catalog (network, 10s timeout)
151151
|
152-
+-- ok --------> filter -> register -> write cache (12h TTL)
152+
+-- ok --------> filter -> register -> write cache (6h TTL)
153153
|
154154
+-- fail ------> read cache -> register
155155
|

‎docs/CONFIGURATION.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Files written under the state directory:
7070
| `commandcode-sanitizer.log` | append | JSON lines, one per repaired payload |
7171
| `commandcode-watchdog.log` | append | JSON lines, one per aborted stream |
7272
| `commandcode-retries.log` | append | JSON lines, Command Code retries only |
73-
| `commandcode-models-cache.json` | overwrite | `{ at, models[] }`, 12h TTL |
73+
| `commandcode-models-cache.json` | overwrite | `{ at, models[] }`, 6h TTL |
7474

7575
Logs are append-only and never rotated by the plugin. At the observed event rate
7676
(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
8181
| Constant | Value | Location |
8282
| --- | --- | --- |
8383
| API request timeout | 10s | `DEFAULT_TIMEOUT_MS` in `src/client/api.ts` |
84-
| Catalog cache TTL | 12h | `CATALOG_TTL_MS` in `src/client/api.ts` |
84+
| Catalog cache TTL | 6h | `CATALOG_TTL_MS` in `src/client/api.ts` |
8585
| SSE inactivity window | 60s | `WATCHDOG_TIMEOUT_MS` in `src/index.ts` |
8686
| Default output limit per model | 16384 | `applyModelCatalog` in `src/index.ts` |
8787

‎docs/es/architecture.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ llega el chunk 1 se arma la ventana de inactividad de 60s
152152
```
153153
catalogo vivo (red, timeout 10s)
154154
|
155-
+-- ok --------> filtrar -> registrar -> escribir cache (TTL 12h)
155+
+-- ok --------> filtrar -> registrar -> escribir cache (TTL 6h)
156156
|
157157
+-- falla -----> leer cache -> registrar
158158
|

‎docs/es/configuration.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Archivos escritos bajo el directorio de estado:
7070
| `commandcode-sanitizer.log` | append | JSON lines, una por payload reparado |
7171
| `commandcode-watchdog.log` | append | JSON lines, una por stream abortado |
7272
| `commandcode-retries.log` | append | JSON lines, solo reintentos de Command Code |
73-
| `commandcode-models-cache.json` | sobrescritura | `{ at, models[] }`, TTL 12h |
73+
| `commandcode-models-cache.json` | sobrescritura | `{ at, models[] }`, TTL 6h |
7474

7575
Los logs son append-only y el plugin no los rota. A la tasa observada (decenas de
7676
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
8181
| Constante | Valor | Ubicacion |
8282
| --- | --- | --- |
8383
| Timeout de request a la API | 10s | `DEFAULT_TIMEOUT_MS` en `src/client/api.ts` |
84-
| TTL de la cache del catalogo | 12h | `CATALOG_TTL_MS` en `src/client/api.ts` |
84+
| TTL de la cache del catalogo | 6h | `CATALOG_TTL_MS` en `src/client/api.ts` |
8585
| Ventana de inactividad SSE | 60s | `WATCHDOG_TIMEOUT_MS` en `src/index.ts` |
8686
| Limite de salida por defecto | 16384 | `applyModelCatalog` en `src/index.ts` |
8787

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "opencode-commandcode",
3-
"version": "1.0.4",
3+
"version": "1.0.5",
44
"description": "Production-grade OpenCode plugin for Command Code: dynamic model discovery, stability hooks and quota telemetry",
55
"main": "index.ts",
66
"type": "module",

‎src/client/api.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const API_BASE = "https://api.commandcode.ai";
2121
export const CLI_VERSION = "1.73.4";
2222

2323
const DEFAULT_TIMEOUT_MS = 10_000;
24-
const CATALOG_TTL_MS = 12 * 60 * 60 * 1000;
24+
const CATALOG_TTL_MS = 6 * 60 * 60 * 1000;
2525

2626
export interface CommandCodeModel {
2727
id: string;

0 commit comments

Comments
 (0)