# ElizaOS Developer Update - Week of June 9, 2025

## 1. Core Framework

We've made significant improvements to the ElizaOS architecture and code organization this week to enhance maintainability and developer experience.

### Types Refactoring

The monolithic `types.ts` file has been split into logical, granular sections to improve code maintainability and search capabilities ([PR #4999](https://github.com/elizaos/eliza/pull/4999)). This refactoring enables better agentic search functionality and makes the codebase more approachable for developers.

### Cursor Rules Implementation

Added `.cursorrules` to improve code navigation and assist developer tooling ([PR #4982](https://github.com/elizaos/eliza/pull/4982)). This helps Cursor AI and similar tools better understand our codebase structure for more accurate code suggestions.

### Runtime Improvements

The `ensureAgentExists` method has been moved from plugin-sql to the runtime level where it logically belongs ([PR #4970](https://github.com/elizaos/eliza/pull/4970)), enabling agent configuration to be updated on restart for a more consistent agent lifecycle.

## 2. New Features

### Environment Variable Prompting for Plugins

Added support for prompting users to input required environment variables during plugin installation ([PR #4945](https://github.com/elizaos/eliza/pull/4945)). This enhancement guides developers through the configuration process:

```bash
> elizaos plugins add openai

Plugin @elizaos/plugin-openai requires environment variables:
? OPENAI_API_KEY: ************
```

### Agent Memory Filtering

Added support for filtering agent memories by room ([PR #4948](https://github.com/elizaos/eliza/pull/4948)), allowing developers to view memories specific to a selected conversation context:

```typescript
// Example of filtering memories by room
const memories = await agentMemoryService.getMemoriesByRoom(agentId, roomId);
```

### Retry Button for User Messages

Added a retry button to user messages in chat interfaces ([PR #4973](https://github.com/elizaos/eliza/pull/4973)), making it easier for developers to test agent behavior with repeated prompts without manual copy/paste.

## 3. Bug Fixes

### Agent Message Handling

We've resolved critical issues in the agent messaging system:

1. **Agent Cross-Interference**: Fixed an issue where multiple agents would respond to messages intended for a single agent in DM channels ([PR #4935](https://github.com/elizaos/eliza/pull/4935)). The root cause was incorrect metadata preservation causing `agent_response` messages to lose their targeting information.

2. **Infinite Response Loops**: Resolved a bug where agents would create endless back-and-forth conversations by processing and responding to each other's messages ([PR #4934](https://github.com/elizaos/eliza/pull/4934)).

### Plugin Development Issues

1. **Circular Dependency in Plugin Testing**: Fixed a critical circular dependency issue when running `elizaos test` from within a plugin directory ([PR #4917](https://github.com/elizaos/eliza/pull/4917)):

```
Error: Dependency Loop: A => B => A
  - @elizaos/plugin-local-ai => @elizaos/core => @elizaos/plugin-local-ai
```

2. **Plugin Route Handler Conflicts**: Corrected an issue where the plugin route handler was incorrectly intercepting standard agent API routes ([PR #4916](https://github.com/elizaos/eliza/pull/4916)).

### Logs Display

Fixed an issue where the logs viewer incorrectly showed an empty state despite having data present ([PR #5006](https://github.com/elizaos/eliza/pull/5006)). Also improved log readability by excluding text embedding content from debug logs ([PR #5003](https://github.com/elizaos/eliza/pull/5003)).

## 4. API Changes

### Message API Enhancements

The message server has been refactored to be completely standalone from agents ([PR #4864](https://github.com/elizaos/eliza/pull/4864)), providing a more robust messaging architecture. This change separates concerns between the messaging infrastructure and agent behavior.

Key API changes include:

1. New endpoint for retrieving agent rooms: `GET /api/agents/:agentId/rooms/:roomId` ([PR #4860](https://github.com/elizaos/eliza/pull/4860))

2. Fixed foreign key issues in chat messages ([PR #4898](https://github.com/elizaos/eliza/pull/4898), [PR #4936](https://github.com/elizaos/eliza/pull/4936))

3. Improved validation for direct message channels ([PR #4920](https://github.com/elizaos/eliza/pull/4920))

Updated API documentation is available in [PR #4976](https://github.com/elizaos/eliza/pull/4976) and [PR #4975](https://github.com/elizaos/eliza/pull/4975).

## 5. Social Media Integrations

### Twitter Plugin Enhancements

Several Twitter plugin issues have been resolved this week:

1. Fixed a critical bug where Twitter agent would not respond to mentions ([Issue #4272](https://github.com/elizaos/eliza/issues/4272), now closed)

2. Resolved Twitter client errors related to undefined properties ([Issue #4365](https://github.com/elizaos/eliza/issues/4365), now closed)

3. Addressed action processing in Twitter client ([Issue #4405](https://github.com/elizaos/eliza/issues/4405), now closed)

4. Fixed Twitter activity detection problems ([Issue #4588](https://github.com/elizaos/eliza/issues/4588), now closed)

Twitter automation has been confirmed to be safe when implemented carefully, so agents can be configured to automate Twitter accounts without risking bans.

## 6. Model Provider Updates

### Plugin Loading Optimization

We've significantly improved the plugin loading process for model providers:

1. Implemented smart strategy selection that checks file existence before attempting imports ([PR #4868](https://github.com/elizaos/eliza/pull/4868))

2. Reordered import strategies to prioritize most likely successful paths (package.json entry first)

3. Fixed workspace dependencies in plugin loading ([PR #4888](https://github.com/elizaos/eliza/pull/4888))

### Embedding Model Configuration

When using multiple LLM providers (such as OpenRouter and Ollama), you can now configure them with proper fallback behavior by ordering your plugins appropriately:

```json
{
  "plugins": [
    "@elizaos/plugin-openrouter",
    "@elizaos/plugin-ollama"
  ]
}
```

This ensures that any models not available in the first provider will fallback to the second.

## 7. Breaking Changes

### RAG Functionality Issues

Knowledge management (RAG) appears to be non-functional in version 1.0.6, with code seemingly commented out despite being referenced in documentation ([Issue #5004](https://github.com/elizaos/eliza/issues/5004)). Developers who rely on knowledge plugins should remain on 1.0.5 until this is fixed.

### Environment Variable Handling

LOG_LEVEL settings in .env files are being ignored in v1.0.6, though they work when set via command line ([Issue #5005](https://github.com/elizaos/eliza/issues/5005)). This appears to be a timing issue with logger initialization. Use command-line arguments to set log levels as a workaround:

```bash
LOG_LEVEL=debug elizaos start
```

### CLI Package Manager Migration

ElizaOS has switched from npm to Bun as the primary package manager. Users with npm-installed CLI version <1.0.5 should use our auto-migration functionality when updating to version 1.0.6+ ([PR #4979](https://github.com/elizaos/eliza/pull/4979)):

```bash
# For users on older npm-based installations
npm update -g @elizaos/cli
# The updated CLI will automatically migrate to Bun
```