Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dirtysouthalpha/sentinel-cli",
"version": "3.2.0",
"version": "3.3.0",
"description": "AI-powered development CLI with cyberpunk aesthetic",
"type": "module",
"author": "DirtySouthAlpha",
Expand Down
15 changes: 14 additions & 1 deletion src/ai/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,21 @@ class ProviderManager {
// runs, so drop the marker here and let the provider's env-var fallback
// resolve it. Otherwise the literal "keyring://zai" gets sent as the
// bearer token and the API rejects it with 401.
// 2026-08-05: blanking the marker and leaving it to "the provider's env-var
// fallback" only works for the BUILT-IN providers in the switch below -
// anthropic, openai, zai and ollama each register their own well-known
// variable. A CUSTOM provider (longcat, and anything else added to config by
// hand) has no such fallback, so it received an empty bearer token and every
// request 401'd.
//
// This has been patched in the INSTALLED dist on NUKE since 2026-07-03 by
// scripts/sentinel-cli-repatch.sh, re-applied by cron every day because
// `npm update -g` silently reinstalls dist and wipes it. The fix belongs
// here, in source, so that cron can be retired. Resolve the variable
// directly instead of assuming a fallback exists downstream.
if (typeof config.apiKey === "string" && config.apiKey.startsWith("keyring://")) {
config.apiKey = "";
const envName = `${name.toUpperCase().replace(/[^A-Z0-9]/g, "_")}_API_KEY`;
config.apiKey = process.env[envName] || "";
}
switch (name) {
case "anthropic":
Expand Down
Loading