# ElizaOS Developer Update: May 19-23, 2025

## Core Framework

The ElizaOS framework saw significant architectural improvements this week, focusing on stability and modularity:

### Environment Management Overhaul
- Unified environment file lookup system implemented via `findNearestEnvFile` utility ([PR #4686](https://github.com/elizaOS/eliza/pull/4686), [PR #4705](https://github.com/elizaOS/eliza/pull/4705))
- PGLite database directories now scoped per-project rather than global, keeping `.pglite` file with the project instead of in global space ([PR #4695](https://github.com/elizaOS/eliza/pull/4695))
- Improved handling of environment variables across CLI commands for consistency

### Runtime Improvements
- Fixed critical "No handler found for delegate type: TEXT_EMBEDDING" error in beta.57+ by removing dependency conflicts ([Issue discussion](https://discord.com/channels/1051457140637827122/1300025221834739744))
- Made the runtime logger public to enable better diagnostics and external integration ([PR #4696](https://github.com/elizaOS/eliza/pull/4696))
- Fixed Docker voice functionality for TEE deployments ([PR #4715](https://github.com/elizaOS/eliza/pull/4715))

### Agent System Enhancements
- Optimized agent loading for better performance with multiple agents ([PR #4519](https://github.com/elizaOS/eliza/pull/4519))
- Resolved character environment loading with improvements to default character ([PR #4716](https://github.com/elizaOS/eliza/pull/4716))
```typescript
// Example of using the unified environment resolution
import { findNearestEnvFile } from './utils/env-utils';

// Automatically finds and uses the closest .env file in parent directories
const envPath = findNearestEnvFile(process.cwd());
```

## New Features

### World and Room Management API
- Added new API endpoints for creating and managing worlds and rooms ([PR #4647](https://github.com/elizaOS/eliza/pull/4647), [PR #4667](https://github.com/elizaOS/eliza/pull/4667), [PR #4677](https://github.com/elizaOS/eliza/pull/4677))
- Implemented world selection in message API ([PR #4637](https://github.com/elizaOS/eliza/pull/4637))

```typescript
// Create a new world
const response = await fetch('/api/worlds', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    name: 'My Virtual World',
    description: 'A collaborative space for agents'
  })
});
const world = await response.json();

// Get rooms for specific agent
const agentId = 'b850bc30-4...';
const roomsResponse = await fetch(`/api/agents/${agentId}/rooms`);
const rooms = await roomsResponse.json();
```

### Chat and Message Management
- Added chat clear and delete message features ([PR #4659](https://github.com/elizaOS/eliza/pull/4659))
- Improved message content display with better action placement ([PR #4689](https://github.com/elizaOS/eliza/pull/4689))
- Agent start button now properly refreshes agent status in UI ([PR #4642](https://github.com/elizaOS/eliza/pull/4642))

### Sentry Integration 
- Added Sentry logging to core logger errors for better production monitoring ([PR #4650](https://github.com/elizaOS/eliza/pull/4650))
```typescript
// Configure Sentry in your project
// Add to .env file or set in environment:
// SENTRY_DSN=your-sentry-dsn
// SENTRY_ENVIRONMENT=development
// SENTRY_RELEASE=v1.0.0

// The logger will now automatically report errors to Sentry
logger.error('This will be reported to Sentry', { context: 'additional data' });
```

### Multi-Platform Support
- Configured Tauri for multi-platform CI/CD and mobile support ([PR #4699](https://github.com/elizaOS/eliza/pull/4699))

## Bug Fixes

### TEXT_EMBEDDING Error Resolution
A critical bug affecting beta.57+ where agents would fail with "No handler found for delegate type: TEXT_EMBEDDING" was identified and resolved. The solution involves:

1. Wiping node_modules: `rm -rf node_modules`
2. Cleaning npm cache: `npm cache clean --force`
3. Ensuring the latest OpenAI plugin is in package.json: `"@elizaos/plugin-openai": "^1.0.0-beta.57"`
4. Reinstalling dependencies: `npm install`

This issue was caused by dependency conflicts with the OpenAI plugin ([Discord discussion](https://discord.com/channels/1051457140637827122/1300025221834739744)).

### CLI Command Fixes
- Fixed issues with the update command to look for the latest version by tag ([PR #4714](https://github.com/elizaOS/eliza/pull/4714))
- Implemented using beta versions when exact versions aren't found ([PR #4710](https://github.com/elizaOS/eliza/pull/4711))
- Fixed issues with the create command and setup directories ([PR #4708](https://github.com/elizaOS/eliza/pull/4708))

### Other Critical Fixes
- Fixed filter for `:user` in client chat ignores ([PR #4709](https://github.com/elizaOS/eliza/pull/4709))
- Improved tweet text formatting with double newlines between sentences ([PR #4706](https://github.com/elizaOS/eliza/pull/4706))
- Fixed agent deletion when the agent has been in a room, resolving foreign key constraint violations ([PR #4510](https://github.com/elizaOS/eliza/pull/4510))
- Fixed knowledge file integration through UI - agents weren't properly utilizing uploaded files despite them appearing in the database

## API Changes

### Agent API Enhancements
- Return ID of newly created agent in API response ([PR #4634](https://github.com/elizaOS/eliza/pull/4634))
- Added API endpoints for creating new rooms ([PR #4647](https://github.com/elizaOS/eliza/pull/4647))
- Added API to get rooms per agent ([PR #4677](https://github.com/elizaOS/eliza/pull/4677))
- World creation and management API endpoints ([PR #4667](https://github.com/elizaOS/eliza/pull/4667))

```typescript
// Example of creating a new agent and using the returned ID
const response = await fetch('/api/agents', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify(agentConfig)
});
const { id: agentId } = await response.json();

// Use the ID immediately without needing another API call
const messagesResponse = await fetch(`/api/agents/${agentId}/messages`);
```

### Reply Action Improvements
- Fixed reply action to skip LLM call if existing REPLY response is found ([PR #4608](https://github.com/elizaOS/eliza/pull/4608))
- Fixed issue with reply action skipping dynamic providers ([PR #4651](https://github.com/elizaOS/eliza/pull/4651))
- Improved LLM response parsing to support custom fields and clean up empty message headers ([PR #4580](https://github.com/elizaOS/eliza/pull/4580))

## Social Media Integrations

### Twitter Plugin Enhancements
- Added Twitter timeline interaction capabilities ([PR #4429](https://github.com/elizaOS/eliza/pull/4429))
- Improved tweet text formatting with better line breaks ([PR #4706](https://github.com/elizaOS/eliza/pull/4706))
- Fixed and enhanced Twitter plugin functionality ([PR #4506](https://github.com/elizaOS/eliza/pull/4506))

To address Twitter plugin issues:
1. Add `client: ["twitter"]` to your character file
2. Install the plugin: `npm install @elizaos-plugins/plugin-twitter`
3. For Cloudflare issues, manually browse Twitter with the agent account
4. Set up cookies according to Twitter guide

### Discord Integration Update
- Added Discord channel ID filtering ([PR #4665](https://github.com/elizaOS/eliza/pull/4665))
```typescript
// Configure Discord channel filtering in .env
CHANNEL_IDS=123456789012345678,987654321098765432
```

### Plugin Reorganization
- The Twitter, Discord, Farcaster, and Telegram plugins have been moved to dedicated repositories to improve maintenance
  - Twitter: https://github.com/elizaos-plugins/plugin-twitter
  - Discord: https://github.com/elizaos-plugins/plugin-discord
  - Farcaster: https://github.com/elizaos-plugins/plugin-farcaster
  - Telegram: https://github.com/elizaos-plugins/plugin-telegram

## Model Provider Updates

### OpenAI Plugin Improvements
- Extended OpenAI plugin to support custom embedding endpoints ([PR #4421](https://github.com/elizaOS/eliza/pull/4421))
- Added model usage events for embeddings and image description in OpenAI plugin ([PR #4438](https://github.com/elizaOS/eliza/pull/4438))

```typescript
// Configure custom embedding endpoint in .env
OPENAI_EMBEDDING_API_URL=https://your-custom-embedding-service.com/v1/embeddings
```

### Local AI and Ollama Enhancements
- Fixed community manager to use plugin-local-ai out of box ([PR #4557](https://github.com/elizaOS/eliza/pull/4557))
- Support for o3-mini model configuration requested and under development

### RAG Implementation Improvements
Chunking configuration for RAG is handled in the core `@elizaos/plugin-rag` package:
- Default maximum chunk size: 1000 tokens
- Default overlap: 200 tokens

```typescript
// Override RAG chunking settings in config.js
export default {
  RAG_CHUNK_SIZE: 1500,
  RAG_CHUNK_OVERLAP: 300
}
```

## Breaking Changes

### V1 to V2 Migration Notes
- The CLI has been completely redesigned for v2, featuring a modular approach for easier agent development and management
- Removed Opus dependencies ([PR #4693](https://github.com/elizaOS/eliza/pull/4693)) - may affect audio implementations
- Multiple plugins have been moved to dedicated repositories and will require reinstallation from the new sources
- Environment handling has changed, with global environment support removed in favor of local environment management ([PR #4666](https://github.com/elizaOS/eliza/pull/4666))

### Database Changes
- PGLite target directory changed to keep `.pglite` file with the project rather than in global space ([PR #4695](https://github.com/elizaOS/eliza/pull/4695))
- If you're upgrading from an earlier version, you may need to migrate your data

To migrate from a global database to a project-specific one:
```bash
# Back up your existing data
cp -r ~/.pglite ./project-db-backup

# Start using the new location
# The system will automatically initialize a new database in your project directory
```

This comprehensive update addresses critical bugs, improves system architecture, and lays groundwork for the upcoming v2 full release.