CherryHQ/cherry-studio · warning · Error
Channel type "${this.channelType}" does not support sending
Error message
Channel type "${this.channelType}" does not support sending files What it means
Thrown by the default ChannelAdapter.sendFile — a non-abstract method so adapters can adopt outbound file forwarding incrementally. Any adapter that has not overridden sendFile hits this default, which rejects with the adapter's channelType in the message. It signals an unsupported capability, not a runtime fault: file forwarding was requested on a channel whose platform upload path is not wired.
Source
Thrown at src/main/ai/channels/ChannelAdapter.ts:216
*/
protected abstract performConnect(signal: AbortSignal): Promise<void>
/**
* Tear down the connection. Release resources, stop polling, close sockets.
*/
protected abstract performDisconnect(): Promise<void>
abstract sendMessage(chatId: string, text: string, opts?: SendMessageOptions): Promise<void>
abstract sendTypingIndicator(chatId: string): Promise<void>
/**
* Send a file to a chat. Non-abstract so adapters can adopt outbound file
* forwarding incrementally — the default rejects with a clear reason for
* adapters whose platform upload isn't wired yet.
*/
// oxlint-disable-next-line no-unused-vars
async sendFile(_chatId: string, _file: FileAttachment): Promise<void> {
throw new Error(`Channel type "${this.channelType}" does not support sending files`)
}
/**
* Called on every text update during streaming. The adapter decides
* internally when/how to flush to the platform (throttle, mutex, etc.).
* @param fullText - The full cumulative response text so far.
*/
// oxlint-disable-next-line no-unused-vars
async onTextUpdate(_chatId: string, _fullText: string): Promise<void> {
// Default no-op — adapters that support streaming should override.
}
/**
* Called when the stream is complete. The adapter should finalize the
* streaming UI (close streaming card, send final message, etc.).
* @returns true if the adapter handled the final delivery (e.g. updated the card).
* false means the caller should fall back to sendMessage().
*/View on GitHub (pinned to 726446b54c)
Solutions
- Before calling sendFile, check whether the adapter supports it (capability flag / `sendFile === ChannelAdapter.prototype.sendFile`), and skip or fall back to a text link for unsupported channels.
- If the channel should support files, implement sendFile in that adapter (upload to the platform, then send).
- Gate the file-forwarding UI/feature per channel type so users cannot trigger it on unsupported adapters.
- Catch the error at the call site and degrade gracefully (e.g. send a text notice) instead of failing the whole message.
Example fix
// before: unconditionally send files
await adapter.sendFile(chatId, file)
// after: capability check + graceful fallback
if (adapter.supportsFiles) {
await adapter.sendFile(chatId, file)
} else {
await adapter.sendMessage(chatId, `[file: ${file.name}]`)
} Defensive patterns
Strategy: type-guard
Validate before calling
function adapterSupportsFiles(adapter: ChannelAdapter): boolean {
return adapter.sendFile !== ChannelAdapter.prototype.sendFile
}
if (adapterSupportsFiles(adapter)) {
await adapter.sendFile(chatId, file)
} else {
await adapter.sendMessage(chatId, `[file: ${file.name}]`)
} Type guard
function supportsFileSend(adapter: ChannelAdapter): boolean {
return adapter.sendFile !== ChannelAdapter.prototype.sendFile
} Try / catch
try {
await adapter.sendFile(chatId, file)
} catch (e) {
if (e instanceof Error && /does not support sending files/.test(e.message)) {
await adapter.sendMessage(chatId, `[file: ${file.name}]`) // graceful fallback
} else throw e
} Prevention
- Gate file-forwarding per channel capability, not globally.
- Implement sendFile when adding a new channel adapter that should forward files.
- Degrade to a text notice instead of failing the whole message.
When it happens
Trigger: Message-handling code calls adapter.sendFile(chatId, file) on a ChannelAdapter subclass that did not override sendFile (e.g. a channel with no platform file-upload implementation).
Common situations: A user forwards/attaches a file in a channel whose adapter only implements text; a new channel adapter was added without file support; file-forwarding feature enabled globally but not all adapters support it.
Related errors
- Channel not found: ${channelId}
- Cannot stream on orphan session ${session.id} — its agent wa
- Discord bot token is required
- Failed to get gateway URL: HTTP ${response.status} - ${error
- Failed to upload image to WeChat CDN
AI-assisted analysis of CherryHQ/cherry-studio@726446b54c (2026-08-12).
Data as JSON: /api/errors/50fdbe6aed796b8e.
Report an issue: GitHub.