Clodds 1.7.7: Discord env credentials not loaded + deprecated Anthropic models
Bug report: Discord credentials not loaded + deprecated Anthropic models in Clodds 1.7.7
Environment
- Clodds npm package:
1.7.7 - Linux
- Node.js:
v22.x - Installed globally with npm
- Config directory:
~/.clodds - Anthropic API
- Discord bot integration
I ran into several issues while setting up Clodds 1.7.7. After debugging the compiled dist/ code, I found what appear to be multiple bugs/inconsistencies in the packaged version.
I was able to work around all of them locally.
1. Discord bot token and App ID are not loaded by the config implementation used by the CLI
My Discord configuration was:
{
"channels": {
"discord": {
"enabled": true
}
}
}
and ~/.clodds/.env contained:
DISCORD_BOT_TOKEN=...
DISCORD_APP_ID=...
clodds doctor could see the Discord bot, but when running:
clodds start
the Discord channel was never initialized.
The bot remained offline in Discord.
Root cause
The CLI imports:
const config_1 = require("../utils/config");
from:
dist/cli/index.js
There appear to be two different config implementations in the package:
dist/config/index.js
dist/utils/config.js
dist/config/index.js contains environment mappings for:
DISCORD_BOT_TOKEN
DISCORD_APP_ID
but the config implementation actually used by clodds start:
dist/utils/config.js
does not.
I confirmed this by loading both config modules with the same environment:
dist/config:
enabled: true
token: true
appId: true
dist/utils/config:
enabled: true
token: false
appId: false
Because createChannelManager() checks:
if (config.discord?.enabled && config.discord.token)
the Discord channel is silently skipped.
Local workaround
I added the missing environment mappings to loadConfig() in:
dist/utils/config.js
before return config;:
// Apply Discord credentials from environment
if (process.env.DISCORD_BOT_TOKEN || process.env.DISCORD_APP_ID) {
if (!config.channels)
config.channels = {};
if (!config.channels.discord)
config.channels.discord = {};
if (process.env.DISCORD_BOT_TOKEN)
config.channels.discord.token = process.env.DISCORD_BOT_TOKEN;
if (process.env.DISCORD_APP_ID)
config.channels.discord.appId = process.env.DISCORD_APP_ID;
}
After this change, Clodds successfully initialized Discord:
INFO: Initializing discord channel
INFO: Starting channel
channel: "discord"
INFO: Discord: Connected
INFO: Discord: Logged in as DISCORD_CLODDS_BOT#xxxx
INFO: Discord: Registered slash commands
count: 41
The bot then appeared online in Discord and responded normally.
2. Anthropic provider health check uses retired claude-3-haiku-20240307
Even though my Anthropic API key was valid and actual Claude requests worked, the Clodds provider health monitor repeatedly reported:
provider: "anthropic"
available: false
lastError: "Unavailable"
Direct requests to the Anthropic API worked correctly.
Root cause
In:
dist/providers/index.js
AnthropicProvider.isAvailable() uses:
body: JSON.stringify({
model: 'claude-3-haiku-20240307',
max_tokens: 1,
messages: [{ role: 'user', content: 'hi' }],
})
The same retired model is also used by the Anthropic check in:
dist/doctor/index.js
This causes the health check to fail even though the API key and Anthropic provider are working.
Local workaround
I replaced:
claude-3-haiku-20240307
with:
claude-haiku-4-5-20251001
in the provider health check and doctor check.
After restarting Clodds, the health monitor correctly reported:
Provider health snapshot
"provider": "anthropic",
"available": true,
"consecutiveFailures": 0
3. Memory/summarization defaults still use deprecated claude-3-5-haiku-20241022
Clodds also periodically produced the following warning:
The model 'claude-3-5-haiku-20241022' is deprecated and will reach end-of-life on February 19th, 2026.
Please migrate to a newer model.
Searching the installed package showed several references to this model, including:
dist/agents/index.js
dist/agents/subagents.js
dist/models/adaptive.js
dist/memory/summarizer.js
dist/providers/discovery.js
dist/cli/commands/index.js
Two important defaults are:
const MEMORY_EXTRACT_MODEL =
process.env.CLODDS_MEMORY_EXTRACT_MODEL ||
process.env.CLODDS_SUMMARY_MODEL ||
'claude-3-5-haiku-20241022';
and:
const DEFAULT_SUMMARY_MODEL =
process.env.CLODDS_SUMMARY_MODEL ||
'claude-3-5-haiku-20241022';
Local workaround
Since these already support environment overrides, I added the following to ~/.clodds/.env:
CLODDS_SUMMARY_MODEL=claude-haiku-4-5-20251001
CLODDS_MEMORY_EXTRACT_MODEL=claude-haiku-4-5-20251001
This avoids modifying those source files and prevents Clodds from selecting the deprecated Haiku 3.5 model for summarization/memory extraction.
Other stale Anthropic model references
A search of the installed dist/ package also shows additional references to old Anthropic models:
dist/agents/subagents.js
dist/models/adaptive.js
dist/providers/discovery.js
dist/providers/index.js
dist/cli/commands/index.js
dist/cli/commands/onboard.js
dist/doctor/index.js
For example, both of these old IDs are still present in various locations:
claude-3-5-haiku-20241022
claude-3-haiku-20240307
It may be worth reviewing all hardcoded Anthropic model IDs in the packaged build.
Expected behavior
-
DISCORD_BOT_TOKENandDISCORD_APP_IDfrom~/.clodds/.envshould be applied tochannels.discordby the same config loader used byclodds start. -
A configured Discord channel should initialize without requiring manual modifications to
dist/utils/config.js. -
Anthropic health checks should use a currently supported model and should not report the provider as unavailable when the API key/provider is functioning.
-
Default internal models for memory extraction and summarization should not reference deprecated/retired Anthropic models.
Actual behavior
Without the local fixes:
- Discord configuration has
enabled: truebut no token/App ID at runtime. - Discord initialization is silently skipped.
- The Discord bot remains offline.
- Anthropic health monitoring reports
available: false. doctorcan fail its Anthropic test despite a valid API key.- Periodic internal operations generate deprecated-model warnings.
After applying the local fixes:
- Discord connects successfully.
- Discord slash commands are registered.
- The bot is online and responds to messages.
- Anthropic health monitoring reports
available: true. - Memory/summarization can use
claude-haiku-4-5-20251001.
Possible underlying issue
The Discord problem in particular looks like there may be two config implementations in the distributed package that have diverged:
dist/config/index.js
dist/utils/config.js
The former contains Discord environment mappings, while the latter is the one imported by the CLI and does not.
It may be worth consolidating these implementations or ensuring they use the same environment mappings.
Resolved by #108 and #109: #108 updates the retired Anthropic model IDs, and #109 loads Discord credentials from the environment. Both fixes have been merged.