- Clear CLI-provided API key and token options when retrying
- Forces fresh prompt instead of reusing old credentials
- Consistent behavior with base URL retry
Co-Authored-By: Claude <noreply@anthropic.com>
- Extract promptForApiKey and promptForBaseUrl as helper functions
- Use recursive retry instead of throwing errors
- Re-enter API key now retries the entire flow with new key
- Re-enter base URL now properly prompts for new URL and retries
- Both options maintain full onboarding flow instead of crashing
Co-Authored-By: Claude <noreply@anthropic.com>
- Add options to retry with different API key or base URL
- Allow manual model entry as fallback
- Option to return to provider selection instead of crashing
- Show helpful error context about why fetch might have failed
Co-Authored-By: Claude <noreply@anthropic.com>
- Remove manual context window prompt when not auto-detected
- Remove 'Enter custom model name' option from model selection
- Throw error if model fetch fails instead of prompting for manual entry
- Strip litellm/ prefix from API-returned model IDs to fix double prefix
This commit completes the LiteLLM prompt caching implementation by:
1. Applying cacheControlTtl defaults to litellm/claude-* models in addition
to anthropic/* models. Previously, only direct Anthropic models received
the default 1h cache TTL, causing LiteLLM Claude models to skip caching.
2. Setting api: "anthropic-messages" for Claude models during onboarding.
LiteLLM was using openai-completions API which doesn't support Anthropic's
cache control headers. The anthropic-messages API is required for proper
prompt caching functionality.
Result: 90% cost reduction for LiteLLM Claude usage (from $0.47 to $0.05 per
message with ~94K token conversations), matching direct Anthropic API costs.
Co-Authored-By: Claude (claude-sonnet-4-5) <noreply@anthropic.com>
- Set api: 'anthropic-messages' for claude-* models through LiteLLM
- Add LiteLLM to resolveCacheControlTtl for cache parameter passthrough
- Enables proper Anthropic cache control headers for cost savings
This fixes the missing cache support by ensuring:
1. Claude models use the correct API format (anthropic-messages)
2. Cache control TTL is resolved and passed through for LiteLLM
- Add LiteLLM + Claude model detection to isCacheTtlEligibleProvider
- Reduces cost by 90% for Claude models through LiteLLM proxy
- Add test coverage for cache eligibility detection
- Document prompt caching behavior and cost savings
Before: $0.47 per message (no caching)
After: $0.05 per message (90% cached)
Closes#2683
The pairing CLI calls listPairingChannels() at registration time,
which requires the plugin registry to be populated. Without this,
plugin-provided channels like Matrix fail with "does not support
pairing" even though they have pairing adapters defined.
This mirrors the existing pattern used by the plugins CLI entry.
Co-authored-by: Shakker <165377636+shakkernerd@users.noreply.github.com>
Add mappings for audio/x-m4a, audio/mp4, and video/quicktime to ensure
media files sent as documents are saved with proper extensions, enabling
automatic transcription/analysis tools to work correctly.
- audio/x-m4a → .m4a
- audio/mp4 → .m4a
- video/quicktime → .mov
Also adds comprehensive test coverage for extensionForMime().
Adds `messages` config option to session-memory hook (default: 15).
Fixes filter order bug - now filters user/assistant messages first,
then slices to get exactly N messages. Previously sliced first which
could result in fewer messages when non-message entries were present.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add support for --litellm-api-key, --litellm-base-url, and
--litellm-model CLI flags to enable non-interactive/automation
use cases for LiteLLM provider onboarding.
Co-Authored-By: Claude (claude-opus-4-5) <noreply@anthropic.com>
Add LiteLLM as a new OpenAI-compatible proxy provider:
- Add onboarding flow with API key, base URL, and model selection
- Fetch available models from LiteLLM /v1/models endpoint
- Auto-detect context window from /model/info endpoint
- Set supportsStore: false to avoid "Extra inputs are not permitted" errors
with providers that don't support the OpenAI Responses API store parameter
- Preserve compat settings through model resolution pipeline
- Add provider documentation
Closes#2639Closes#2305
Co-Authored-By: Claude <noreply@anthropic.com>
Adds a new dmScope option that includes accountId in session keys,
enabling isolated sessions per channel account for multi-bot setups.
- Add 'per-account-channel-peer' to DmScope type
- Update session key generation to include accountId
- Pass accountId through routing chain
- Add tests for new routing behavior (13/13 passing)
Closes#3094
Co-authored-by: Sebastian Almeida <89653954+SebastianAlmeida@users.noreply.github.com>
The MiniMax provider config was updated to use api.minimax.chat
instead of api.minimax.io in PR #3064, but the test expectation
was not updated.
🤖 Generated with Claude Code
- Re-export DirectoryConfigParams and ChannelDirectoryEntry from channels/targets
- Remove unused ChannelDirectoryEntry and resolveDiscordAccount imports
- Fix parseDiscordTarget calls to not pass incompatible options type
- Fix unused catch parameter
Fixes CI build failures on main.
🤖 Generated with Claude Code
Regular Telegram groups (without Topics/Forums enabled) can send
message_thread_id when users reply to messages. This was incorrectly
being used to create separate session keys like '-123:topic:42',
causing each reply chain to get its own conversation context.
Now resolveTelegramForumThreadId only returns a thread ID when the
chat is actually a forum (is_forum=true). For regular groups, the
thread ID is ignored, ensuring all messages share the same session.
DMs continue to use messageThreadId for thread sessions as before.
When sending Discord messages via cron jobs or the message tool,
usernames like "john.doe" were incorrectly treated as channel names,
causing silent delivery failures.
This fix adds a resolveDiscordTarget() function that:
- Queries Discord directory to resolve usernames to user IDs
- Falls back to standard parsing for known formats
- Enables sending DMs by username without requiring explicit user:ID format
Changes:
- Added resolveDiscordTarget() in targets.ts with directory lookup
- Added parseAndResolveRecipient() in send.shared.ts
- Updated all outbound send functions to use username resolution
Fixes#2627
MiniMax has updated their API. The previous configuration used an
incorrect endpoint (api.minimax.io/anthropic) with anthropic-messages
format, which no longer works.
Changes:
- Update MINIMAX_API_BASE_URL to https://api.minimax.chat/v1
- Change API format from anthropic-messages to openai-completions
- Remove minimax from isAnthropicApi check in transcript-policy
This fixes the issue where MiniMax API calls return no results.
Wraps plugin.actions.listActions() in a try/catch so a single
broken channel plugin cannot crash the entire agent boot sequence.
Errors are logged once per plugin+message (deduped) via
defaultRuntime.error() and the call gracefully returns an empty
array instead of propagating the exception.
Fixes: 'Cannot read properties of undefined (reading listActions)'
after the clawdbot→moltbot rename left some plugin state undefined.