# ElizaOS Developer Update: July 21, 2025

## 1. Core Framework

### Service Type System Implementation
We've completed a major architectural enhancement by implementing standardized service types and interfaces via `getServicesByType()` ([#5565](https://github.com/elizaos/eliza/pull/5565)). This allows plugins to depend on abstract service types rather than specific implementations:

```typescript
// Get all services implementing WebSearchServiceType
const searchServices = runtime.getServicesByType(WebSearchServiceType);

// Use the first available implementation 
if (searchServices.length > 0) {
  const results = await searchServices[0].search("ElizaOS features");
}
```

### EventTarget Migration
Migrated core event handling from Node.js EventEmitter to Bun's native EventTarget API ([#5609](https://github.com/elizaos/eliza/pull/5609)). This improves performance, type safety, and runtime compatibility.

```typescript
// Previously: EventEmitter-based implementation
this.emit('progress', { step, message });

// Now: EventTarget-based implementation
this.dispatchEvent(new CustomEvent('progress', { 
  detail: { step, message }
}));
```

### ModuleLoader Enhancement
Implemented enhanced ModuleLoader with local-first guarantees ([#5629](https://github.com/elizaos/eliza/pull/5629)) for consistent module resolution across different execution contexts. This ensures plugins are resolved correctly whether running in a development or production environment.

## 2. New Features

### Action Chaining
Implemented a new action chaining system ([#5436](https://github.com/elizaos/eliza/pull/5436), [#5490](https://github.com/elizaos/eliza/pull/5490)) to enable sequential execution of actions with managed state:

```typescript
// Define an action that can be chained
const saveUserInfoAction = defineAction({
  name: "saveUserInfo",
  description: "Save user information to database",
  execute: async (state, context) => {
    // Access previous action's result via state.actionState
    const userInfo = state.actionState.getUserInfo?.result || {};
    
    // Store in database
    await context.services.database.saveUser(userInfo);
    
    // Return result for next action in chain
    return { success: true, userId: userInfo.id };
  }
});

// In agent template:
// ACTION_CHAIN: getUserInfo,saveUserInfo,sendWelcomeEmail
```

### Plugin Quick Starter Template
Added a streamlined `plugin-quick-starter` template ([#5589](https://github.com/elizaos/eliza/pull/5589)) for rapid development of backend-only plugins without frontend overhead:

```bash
elizaos create --type plugin --template quick-starter my-backend-plugin
```

### Character V1 to V2 Migration Tool
Implemented automatic V1 to V2 character conversion during JSON import ([#5536](https://github.com/elizaos/eliza/pull/5536)) for seamless backward compatibility:

```typescript
// Detects V1 format and upgrades to V2 schema
const importCharacter = useConvertCharacter();

async function handleImport(file) {
  const imported = await readCharacterFile(file);
  // Automatically converts V1 format to V2 if needed
  const v2Character = importCharacter(imported);
  await createCharacter(v2Character);
}
```

## 3. Bug Fixes

### Plugin Loading Issues
Fixed critical bug preventing plugin actions from loading in NPM-deployed version ([#5624](https://github.com/elizaos/eliza/pull/5624)). This resolves a major issue where globally installed `elizaos` couldn't properly load plugin actions.

Key changes:
- Fixed tsup.config.ts to properly bundle actions
- Updated publish workflow to verify plugin loading

### Windows Compatibility
Resolved several critical Windows-specific bugs:

- Fixed plugin loading failures on Windows ([#5416](https://github.com/elizaos/eliza/pull/5416), [#5499](https://github.com/elizaos/eliza/issues/5499))
- Corrected path normalization issues when loading modules ([#5407](https://github.com/elizaos/eliza/issues/5407))
- Fixed directory creation issues during project setup ([#5603](https://github.com/elizaos/eliza/issues/5603))

### Database Hoisting Prevention
Fixed an issue where creating a new ElizaOS project inside an existing project directory would incorrectly inherit the parent's database configuration ([#5618](https://github.com/elizaos/eliza/pull/5618)), leading to data corruption.

## 4. API Changes

### Mandatory Breaking Changes
1. `runtime.on()` now uses EventTarget-based API, requiring event listeners to adapt to the new pattern:

```typescript
// Old pattern
runtime.on('message', (data) => { /* handle data */ });

// New pattern
runtime.on('message', (event) => { 
  const data = event.detail;
  /* handle data */ 
});
```

2. Action return types now strictly require `Promise<ActionResult>`:

```typescript
// Previously allowed
async execute() { 
  return { success: true }; 
}

// Now required
async execute(): Promise<ActionResult> { 
  return { success: true, result: null }; 
}
```

### New APIs

Added `getServicesByType()` method to runtime to retrieve all services of a specified type:

```typescript
const emailServices = runtime.getServicesByType(EmailServiceType);
if (emailServices.length > 0) {
  await emailServices[0].sendEmail({ 
    to: "user@example.com", 
    subject: "Hello", 
    body: "Testing new API" 
  });
}
```

## 5. Social Media Integrations

### Twitter Plugin Updates
Fixed multiple issues in the Twitter plugin:

- Resolved "Failed to fetch Home timeline" errors ([#38](https://github.com/elizaos/eliza/issues/38))
- Fixed SQL database insertion errors ([#39](https://github.com/elizaos/eliza/issues/39))
- Improved error handling for client initialization failures ([#31](https://github.com/elizaos/eliza/issues/31))

Based on recent Discord discussions, the team is "moving in the right direction" with X to restore the suspended ElizaOS X account, with encouraging replies received this week.

### Discord Integration
Community driven work on agent forwarding between platforms, including a suggested implementation for forwarding Shaw's Farcaster posts to Discord, as mentioned in Discord discussions on July 19th.

## 6. Model Provider Updates

### Ollama Integration
Improved Ollama integration with conditional loading based on environment variables:

```typescript
// Ollama is now only included as a fallback if other LLM providers aren't available
if (process.env.OLLAMA_API_ENDPOINT && !hasOtherLLMProvider) {
  plugins.push('@elizaos/plugin-ollama');
}
```

Additionally, a branch has been created to implement Ollama integration for the plugin-knowledge component (mentioned in Discord on July 19th by user "starlord").

### Model Selection Logic
Enhanced model selection during project creation ([#5594](https://github.com/elizaos/eliza/pull/5594)), automatically installing the appropriate model plugins like OpenAI or Claude rather than hardcoding dependencies.

## 7. Breaking Changes

### V1 to V2 Migration Issues
When migrating from V1 to V2, note these potential issues:

1. **Plugin Schema Migrations**: Custom plugin schema migrations are experiencing issues where the `DatabaseMigrationService` is not being correctly registered ([#5588](https://github.com/elizaos/eliza/issues/5588)).

2. **EventEmitter vs. EventTarget**: Code relying on EventEmitter's method chaining needs to be updated:

```typescript
// V1 style - NO LONGER WORKS
myEmitter.on('event1', handler1).on('event2', handler2);

// V2 style - REQUIRED NOW
myEmitter.on('event1', handler1);
myEmitter.on('event2', handler2);
```

3. **Agent Plugin Ordering**: Explicitly check plugin loading order in your V1 agents when migrating to V2, as some system improvements may affect implicit dependencies.

Remember to always use the V1 to V2 character migrator tool ([#5452](https://github.com/elizaos/eliza/issues/5452)) when updating existing agents.