Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

718 B
Raw Blame
/** Structured chat send / delivery errors (issue #219) — stable `code` for analytics and tests. */

export type ChatSendErrorCode =
  | 'socket_disconnected'
  | 'local_model_failed'
  | 'cloud_send_failed'
  | 'voice_transcription'
  | 'stt_not_ready'
  | 'voice_synthesis'
  | 'tts_not_ready'
  | 'microphone_unavailable'
  | 'microphone_recording'
  | 'microphone_access'
  | 'voice_playback'
  | 'usage_limit_reached'
  | 'prompt_blocked'
  | 'prompt_review'
  | 'attachment_invalid'
  | 'create_thread_failed';

export interface ChatSendError {
  code: ChatSendErrorCode;
  message: string;
}

export const chatSendError = (code: ChatSendErrorCode, message: string): ChatSendError => ({
  code,
  message,
});