# ElizaOS Developer Update - 2025-06-27

## Core Framework

The past week has seen significant architectural changes for ElizaOS, with the most impactful being the transition from project-scoped to agent-scoped plugins. This allows different plugins to be used for different characters, enhancing flexibility and customization options for builders.

```typescript
// Old approach (project-wide plugins)
const project: Project = {
  plugins: ['@elizaos/plugin-openai', '@elizaos/plugin-twitter'],
  agents: [agentA, agentB] // Both agents share the same plugins
};

// New approach (agent-specific plugins)
const agentA: ProjectAgent = {
  character: {
    name: 'Agent A',
    plugins: ['@elizaos/plugin-openai', '@elizaos/plugin-twitter']
  }
};
const agentB: ProjectAgent = {
  character: {
    name: 'Agent B',
    plugins: ['@elizaos/plugin-openai', '@elizaos/plugin-discord']
  }
};
```

The framework has also completed its migration to the new type-safe `@elizaos/api-client` package, providing developers with improved TypeScript support and more reliable API interactions. This client package offers comprehensive type definitions and a service-based architecture that makes API integration more robust.

Additionally, the server functionality has been split from the CLI into its own `@elizaos/server` package, enabling independent usage of server components while maintaining backward compatibility.

## New Features

### 1. Enhanced Chat UI

Major improvements to chat rendering and UI components include:

```jsx
// New animated markdown component for smoother rendering
<AnimatedMarkdown 
  content={message.text} 
  codeTheme="github-dark" 
  animationDuration={300}
/>
```

The chat interface now features improved styling, enhanced code block components with syntax highlighting, and better responsive design for mobile and desktop experiences.

### 2. Agent-scoped Plugins

As mentioned above, plugins are now scoped to agents rather than projects, allowing for more flexible agent configurations:

```typescript
// Example character file with agent-specific plugins
export const myAgent: Character = {
  name: 'Custom Agent',
  plugins: [
    '@elizaos/plugin-openai',
    '@elizaos/plugin-twitter',
    // Agent-specific plugins not shared with other agents
    '@elizaos/plugin-knowledge'
  ],
  settings: {
    // Plugin-specific settings
    chains: {
      evm: ['sepolia']
    }
  }
};
```

### 3. Additional AI Provider Support

ElizaOS now offers improved model provider options with:

- OpenRouter integration for accessing multiple AI models through a single provider
- Embedding model selection for better control over vector embeddings
- Support for Google Generative AI (Gemini) models
- Ollama support for locally-run AI models

```typescript
// Example of configuring an agent with OpenRouter
const agent = {
  character: {
    name: "OpenRouter Agent",
    plugins: ["@elizaos/plugin-openrouter"],
    settings: {
      OPENROUTER_API_KEY: process.env.OPENROUTER_API_KEY,
      OPENROUTER_MODEL: "anthropic/claude-3-opus",
      EMBEDDING_MODEL: "openai/text-embedding-3-small"
    }
  }
};
```

### 4. File Upload & Media Handling Improvements

Support for user-uploaded plain text (.txt) files has been added to the GUI, and attachment handling has been improved for both local and remote images. The system now migrates from express-fileupload to multer for all upload functionality, ensuring more reliable file handling.

## Bug Fixes

### Critical Message Callback Issue

A significant bug was fixed where callbacks from plugin actions weren't reaching end users in chat. This affected plugins like `plugin-evm` where transfer confirmations were not being shown to users.

```typescript
// In transfer.ts (before fix)
if (callback) {
  callback({
    text: `Successfully transferred ${amount} tokens to ${address}\nTransaction Hash: ${hash}`,
    content: {
      success: true,
      hash: hash,
      // Other details...
    }
  });
}
// The callback wasn't properly reaching the chat UI
```

The issue has been resolved by ensuring action callbacks properly propagate through the message bus system.

### Database Schema Type Mismatch

A critical foreign key constraint issue was fixed where:
- The `message_servers.id` column was TEXT
- While `server_agents.server_id` (which references it) was UUID

This inconsistency was causing database migration failures in fresh deployments. The fix converted the column to proper UUID type:

```sql
-- Migration fix (simplified)
ALTER TABLE message_servers 
ALTER COLUMN id TYPE UUID USING id::uuid;
```

### Embedding Model Selection

Fixed an issue with Ollama embedding models not being properly selected, along with project loading problems:

```typescript
// Now properly selects embedding model based on provider
const embeddingModel = provider === 'ollama' 
  ? 'nomic-embed-text' // Default Ollama embedding model
  : openAIEmbeddingModel;
```

## API Changes

The API architecture has undergone significant reorganization:

1. Routes are now structured by domain (agents, messages, memory, etc.) instead of functionality
2. A comprehensive Postman collection has been added with 90+ REST API endpoints
3. The new `@elizaos/api-client` package provides type-safe client methods

The most significant API changes involve:

```typescript
// New API client usage
import { createApiClient } from '@elizaos/api-client';

const client = createApiClient({ baseUrl: 'http://localhost:3000' });

// Type-safe API calls
const agents = await client.agents.list();
const memories = await client.memory.list({ agentId });
const rooms = await client.rooms.list({ agentId });
```

## Social Media Integrations

The ElizaOS Twitter account has been suspended for 14 days, and the team is in active dialogue with X to resolve the issue. Consequently, the Twitter plugin will undergo maintenance, and relevant documentation has been updated with deprecation notices.

Twitter plugin users should note that the authentication method has changed from username/password to API-based authentication using Twitter API keys, tokens, and secrets:

```
# Old Twitter env vars
TWITTER_USERNAME=your_username
TWITTER_PASSWORD=your_password

# New Twitter env vars
TWITTER_API_KEY=your_api_key
TWITTER_API_SECRET=your_api_secret
TWITTER_ACCESS_TOKEN=your_access_token
TWITTER_ACCESS_SECRET=your_access_secret
```

Discord integration received fixes for token validation issues, and work is being done to integrate Farcaster access for agents.

## Model Provider Updates

### OpenRouter Integration

ElizaOS now supports OpenRouter as a model provider, allowing access to various AI models through a single API:

```typescript
// OpenRouter configuration
{
  OPENROUTER_API_KEY: "your_api_key",
  OPENROUTER_MODEL: "anthropic/claude-3-opus", // Or any other supported model
  EMBEDDING_MODEL: "openai/text-embedding-3-small" // Embedding model selection
}
```

Note that for embeddings, OpenRouter must be placed before OpenAI in your configuration, as OpenRouter doesn't work without an embedding provider.

### Google Generative AI

Added support for Google Gemini models:

```typescript
// Google Generative AI configuration
{
  GOOGLE_API_KEY: "your_api_key",
  GOOGLE_MODEL: "gemini-1.5-pro",
}
```

### Improved Model and Embedding Selection

The CLI now provides better options for selecting both AI models and embedding models, with clearer descriptions and a simplified selection process.

## Breaking Changes

### V1 to V2 Migration Considerations

While ElizaOS V2 is being actively developed and nearing completion, current users should be aware of several breaking changes in the existing version:

1. **Plugin Architecture**: Plugins have changed from project-scoped to agent-scoped. You'll need to update your agent configuration to include plugins directly in the character definition.

2. **API Client Migration**: If you're using direct API calls, you should migrate to the new `@elizaos/api-client` package:

   ```typescript
   // Old approach
   fetch('/api/agents/list')
   
   // New approach
   import { createApiClient } from '@elizaos/api-client';
   const client = createApiClient();
   client.agents.list();
   ```

3. **Server Separation**: The server functionality is now in a separate `@elizaos/server` package. If you were importing server components directly from the CLI package, you'll need to update your imports.

4. **Database Schema Changes**: Some database columns have changed types (e.g., TEXT to UUID). Make sure to run the latest migrations before upgrading.

5. **Twitter Authentication**: If using the Twitter plugin, update to the new API-based authentication method as described above.

For more detailed migration information, refer to the migration guide in the updated API documentation.

[Issue #5270](https://github.com/elizaos/eliza/pull/5270) | [Issue #5240](https://github.com/elizaos/eliza/pull/5240) | [Issue #5122](https://github.com/elizaos/eliza/pull/5122)