# ElizaOS Developer Update: Week of May 22 - May 28, 2025

## 1. Core Framework

### V2 Launch Preparation
- **Imminent Release**: ElizaOS V2 is being finalized this week with a target launch day of Friday, May 30th. The new version represents a "complete rework" of the system with significant architectural improvements.
- **Runtime Enhancements**: PR #4556 implemented a substantial database API upgrade including batch operations capabilities, entity management improvements, and more efficient data retrieval patterns.
- **Plugin System Overhaul**: PR #4789 introduced a comprehensive plugin dependency management system, allowing plugins to define dependencies and ensure proper loading order at runtime.
- **Cross-Platform Memory**: Implemented single world per runtime as the default, enabling agents to maintain conversation context across different messaging platforms (Discord, Slack, Telegram).

### Service Architecture
- **Service Registry Pattern**: PR #4719 introduced a service registry for typed services, allowing external plugins to register services that can be referenced elsewhere with proper type safety.
- **Environment Resolution**: Unified environment file lookup with `findNearestEnvFile` utility (PR #4686) to ensure consistent configuration loading across all CLI commands.
- **Improved Error Handling**: Added Sentry logging integration (PR #4650) for better error tracking and diagnostics in production environments.

## 2. New Features

### Comprehensive Media Support
- **Image and Video Chat**: PR #4750 added complete support for image and video handling in chat interfaces with automatic content description capabilities:
```javascript
// Sample code for attaching and processing media
const mediaResponse = await runtime.handleAttachment({
  type: "image", 
  url: imageUrl,
  generateDescription: true
});

// Media descriptions are automatically generated and included in context
if (mediaResponse.description) {
  message.content += `\n\n[Image shows: ${mediaResponse.description}]`;
}
```

### Real-Time Interface Improvements
- **WebSocket Log Streaming**: PR #4765 implemented WebSocket-based log streaming with a live mode toggle:
```javascript
// Client-side implementation for real-time logs
const startLogStream = () => {
  const socket = new WebSocket(`ws://${host}/api/logs/stream`);
  
  socket.onmessage = (event) => {
    const logs = JSON.parse(event.data);
    updateLogDisplay(logs);
  };
  
  return socket;
};
```

### Memory and Knowledge Management
- **Knowledge Plugin**: PR #4701 and #4719 migrated knowledge functionality from the runtime into a dedicated plugin with improved RAG pipeline compared to V1:
```javascript
// New knowledge plugin API usage
const { searchKnowledge } = await runtime.getPlugin('knowledge');
const results = await searchKnowledge(query, {
  limit: 5,
  minRelevance: 0.75
});
```

- **Memory UI Enhancements**: PR #4766 added a graph view for memories to visualize relationships between entities and conversations.

## 3. Bug Fixes

### Critical Issues Fixed
- **Agent Deletion**: PR #4510 resolved a foreign key constraint violation that prevented deleting agents that had participated in rooms.
```sql
-- Previous behavior: Foreign key constraint error
-- New behavior: Properly cascades deletion
DELETE FROM room_participants WHERE entity_id = ?;
DELETE FROM entities WHERE id = ?;
```

- **Response Handling**: PR #4728 fixed a critical issue with message response handling that was preventing agents from responding correctly:
```javascript
// Fixed response handling to ensure dynamic providers are processed correctly
const processResponse = async (message, responseContent) => {
  // Now properly handles content from dynamic providers
  if (responseContent.providers?.length > 0) {
    await Promise.all(responseContent.providers.map(provider => 
      runtime.invokeProvider(provider, message)
    ));
  }
  return responseContent;
};
```

- **Twitter Integration**: PR #4506 refactored Twitter plugin code for improved error handling and text validation in tweet creation, resolving several reported issues with duplicate actions.

### Environment and Configuration
- **Env File Management**: PR #4752 fixed `.env` hoisting issues in non-monorepo directories, ensuring project-specific environment settings are respected.
- **CLI Update Issues**: PR #4710 and #4711 addressed dependency resolution problems in the `elizaos update` command, ensuring proper version selection when exact matches aren't found.

## 4. API Changes

### Breaking Changes
- **Room Structure Simplification**: PR #4798 completely redesigned the GET rooms endpoint response structure:
```javascript
// OLD: Multiple room entries with different agentIds for the same room
[
  { roomId: "123", agentId: "agent1", ... },
  { roomId: "123", agentId: "agent2", ... }
]

// NEW: Single room with participants array
[
  { 
    roomId: "123", 
    participants: [
      { agentId: "agent1", ... },
      { agentId: "agent2", ... }
    ]
  }
]
```

### New Endpoints
- **World Management**: PR #4667 added endpoints for creating, updating, and managing worlds via API:
```javascript
// Create a new world
POST /api/worlds
{
  "name": "Custom World",
  "description": "A personalized world for my agent"
}

// Get rooms in current world
GET /api/worlds/:worldId/rooms
```

- **Room Creation**: PR #4647 implemented an API endpoint for creating new rooms:
```javascript
// Example usage with curl
curl -X POST http://localhost:3000/api/rooms \
  -H "Content-Type: application/json" \
  -d '{"name": "New Discussion", "participants": ["agentId1", "agentId2"]}'
```

## 5. Social Media Integrations

### Twitter Improvements
- **Timeline Feature**: PR #4429 introduced a new timeline.ts module for bot interactions with the Twitter timeline, now configurable via environment variables:
```
TWITTER_TIMELINE_ENABLED=true
TWITTER_TIMELINE_INTERVAL=15 # minutes
TWITTER_TIMELINE_MAX_RESULTS=10
```

- **Media Handling**: Fixed issues with Twitter media generation and formatting (PR #4241, #4224).
- **Authentication**: Cloudflare authentication issues can now be resolved by manually setting cookies in the .env file:
```
TWITTER_COOKIES_AUTH_TOKEN=your_auth_token
TWITTER_COOKIES_CT0=your_ct0_value
TWITTER_COOKIES_GUEST_ID=your_guest_id
```

### Discord Plugin
- **Channel Filtering**: PR #4665 added support for limiting responses to specific channels via the `CHANNEL_IDS` environment variable.
- **Response Timeouts**: PR #4450 fixed Discord service unregister timeout issues that were causing stalled processes.

## 6. Model Provider Updates

### OpenAI Integration
- **Embedding Endpoint Customization**: PR #4421 extended the OpenAI plugin to support a custom embedding endpoint:
```
OPENAI_EMBEDDING_BASE_URL=https://custom-embedding-api.example.com/v1
```

- **Model Usage Tracking**: PR #4438 implemented comprehensive model usage events for embeddings and image description operations:
```javascript
// Example of tracking OpenAI API usage
runtime.on('MODEL_USAGE', (data) => {
  console.log(`Model: ${data.model}, Tokens: ${data.totalTokens}, Cost: ${data.cost}`);
});
```

### Local AI Support
- **Removed StudioLM**: PR #4459 removed StudioLM support in favor of focusing exclusively on llama.cpp for local AI models.
- **Community Manager Configuration**: PR #4557 updated the community manager (Eli5) to use plugin-local-ai out of the box for better default performance.

## 7. Breaking Changes

### V1 to V2 Migration Issues
- **Package Manager Change**: ElizaOS V2 has switched from pnpm (used in V0/V1) to bun as the primary package manager. This requires adapting installation commands:
```bash
# Old (V0/V1) installation with pnpm
npx elizaos plugins install @elizaos-plugins/client-twitter

# New (V2) installation with bun
bun elizaos plugins install @elizaos-plugins/plugin-twitter
```

### Plugin Ecosystem Decentralization
- Multiple plugins have been moved to dedicated repositories, requiring updates to import paths:
  - Twitter: https://github.com/elizaos-plugins/plugin-twitter (PR #4669)
  - Discord: https://github.com/elizaos-plugins/plugin-discord (PR #4668)
  - Telegram: https://github.com/elizaos-plugins/plugin-telegram (PR #4680)
  - Farcaster: https://github.com/elizaos-plugins/plugin-farcaster (PR #4682)

- Plugin naming convention has been standardized to "plugin-name" format:
```bash
# Example of installing decentralized plugin
elizaos plugins install @elizaos-plugins/plugin-twitter
```

For comprehensive information on migration from V1 to V2, please refer to the full [Migration Guide](https://docs.eliza.how/v2-migration).