Performance & Hardening Release
Performance Optimizations
- models.dev-first capability resolution — Fetch capability catalog before per-model API. Eliminates most HTTP calls when models exist in the models.dev catalog.
- Retry on transient failures —
fetchModelInfo now retries once with exponential backoff (500ms × 2^attempt) for network glitches.
- Higher concurrency —
MAX_CONCURRENT_INFO increased from 5 to 15.
- Generous per-model timeout —
MODEL_INFO_TIMEOUT raised from 3s to 5s for slow networks.
- Longer models.dev cache — TTL increased from 5 minutes to 1 hour.
- Cross-platform cache path — Uses
os.homedir() + XDG_CACHE_HOME fallback (works on Windows).
- Capability budget — 10-second cap on per-model API work to prevent startup blocking.
Security & Resilience Fixes
- Path traversal sanitizer —
safeFilename() in cache path construction prevents providerKey-based directory escape.
- Prototype pollution defense —
Object.create(null) for models dictionary.
- Empty payload fallback —
/v1/models returning empty/invalid data now throws to engage stale cache fallback.
- Crash resilience —
cacheDir() falls back to os.tmpdir() if homedir() throws.
- HTTP error fallback — Non-OK responses now throw to engage stale cache (instead of returning null).
Docs
- Added "Validate after publish" / "Validasi setelah publikasi" sections with the
opencode models 9router-local --print-logs --log-level DEBUG command for end-to-end validation after release.
Test
opencode models 9router-local --print-logs --log-level DEBUG
Installation
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@vheins/opencode-9router@latest"]
}