Repository navigation
v1.0.0 - descubrimiento dinamico, hardening de credenciales y docs bilingues
Plugin de resiliencia, descubrimiento dinamico de modelos y telemetria de cuota
para el proveedor Command Code en OpenCode.
Verificado contra OpenCode v2.0.32, CLI de Command Code 1.73.4 y Bun 1.4.0.
Documentacion bilingue (ingles y espanol) en README.md / README.es.md.
First modular release. Migrates the single-file commandcode-quota plugin into a
structured package with dynamic model discovery.
Added
- Dynamic model discovery from
GET /provider/v1/modelsthrough the OpenCode v2
model editor, with transport-aware filtering and automatic[FREE PROMO]
badges for free/promo tiers. - On-disk model catalog cache (12h TTL) so an upstream outage cannot leave the
provider with an empty model list at startup. - Multi-source credential resolution:
COMMAND_CODE_API_KEY,COMMANDCODE_KEY_FILE,
$XDG_CONFIG_HOME/commandcode/key.txt,/etc/environment, then the official CLI
stores under~/.commandcode/. - Strict origin guard (
isCommandCodeHost) for credential injection, plus the
COMMANDCODE_ALLOWED_HOSTSallow-list opt-in. - Bounded API calls via
AbortSignal.timeout(10s default). - Vision capability metadata (
imageinput) for multimodal models. applyModelCatalogexported for testability.- Offline test suite (58 tests) and an opt-in live suite gated by
COMMANDCODE_LIVE_TESTS. - Strict typecheck configuration (
allowImportingTsExtensions,strict,
noUncheckedIndexedAccess) withbun-types. - Documentation:
README.md,docs/ARCHITECTURE.md,docs/CONFIGURATION.md,
docs/TROUBLESHOOTING.md,LICENSE.
Changed
- State directory, key paths and the connection-close sentinel are resolved from
XDG/home instead of hardcoded/rootpaths. - Retry telemetry now ignores non-Command-Code providers, keeping
commandcode-retries.logmeaningful. - The
retrylog records the provider id and degrades gracefully when the hook
is unsupported by the running build.
Fixed
- Security: credentials were attached based on substring URL matching
(api.commandcode.aianywhere in the URL, or any URL containing
/provider/v1/chat/completions). That leaked the API key to lookalike hosts
such asapi.commandcode.ai.evil.com, to any host carrying the provider path,
and to values injected in query strings or fragments. - Anthropic-shaped models (
claude-*,/messagesonly) were registered under the
OpenAI-compatible transport and failed with400 unsupported_model. They are now
filtered out. - Free-model detection missed
-free/_free/.freeid shapes, so e.g.
poolside/laguna-s-2.1-freewas not tagged. - The sanitizer had regressed relative to the proven v1 implementation:
nulland
empty tool response content was no longer normalized, orphan detection was no
longer order-sensitive, and malformedtool_callentries were not pruned. - The sanitizer mutated the caller's message array in place instead of working on
a shallow clone. - The watchdog could fire an abort after a consumer cancellation, and a throwing
logging callback could leave the stream open. - Quota report rendering crashed on a missing window; it now degrades per field.
Removed
- Hardcoded user-specific absolute paths removed from the runtime code in favour of
XDG/home resolution. - Network calls from the default test suite.