# ElizaOS Developer Update - 2025-11-17

## 1. Core Framework

The ElizaOS team has been actively working on strengthening the framework's core stability and configuration. Key developments include:

- **Environment Variable Handling**: Fixed a critical bug where environment variables were not loading correctly from `process.env`, causing agent settings to fail when variables are exported on the host rather than defined in `.env` files ([PR #6141](https://github.com/elizaOS/eliza/pull/6141)).

- **Row-Level Security (RLS)**: Resolved an issue where `server_id` validation was incorrectly blocking all users when RLS isolation was disabled. This fix ensures proper user access to resources ([PR #6139](https://github.com/elizaOS/eliza/pull/6139)).

- **Agent Settings Persistence**: Fixed a bug that prevented agent settings from persisting across restarts, ensuring that runtime-generated configurations are now properly retained ([PR #6106](https://github.com/elizaOS/eliza/pull/6106)).

- **Plugin-MySQL Support**: Work is in progress to add conditional MySQL database support alongside the existing PostgreSQL capabilities, with dynamic plugin loading based on connection URL configuration ([PR #6143](https://github.com/elizaOS/eliza/pull/6143)).

- **Runtime Initialization**: Added a new `initPromise` to the `IAgentRuntime` interface and an optional `skipMigrations` parameter to allow for more flexible runtime initialization scenarios ([PR #6132](https://github.com/elizaOS/eliza/pull/6132)).

## 2. New Features

### ElizaOS Reference in Runtime

A new feature has been added to include an ElizaOS reference within the runtime, laying groundwork for a unified messaging API:

```typescript
// Example of using the ElizaOS reference in the runtime
import { IAgentRuntime } from "@elizaos/core";

async function sendMessage(runtime: IAgentRuntime, message: string) {
  if (runtime.hasElizaOS()) {
    // Use the new unified messaging API
    await runtime.elizaOS.messaging.sendMessage({
      content: message,
      channelId: "channel-123"
    });
  } else {
    // Fall back to legacy method
    console.log("ElizaOS messaging not available");
  }
}
```

### Rock-Paper-Scissors Game Implementation

A detailed discussion took place on implementing a rock-paper-scissors game for Eliza agents:

```typescript
// Recommended implementation using commit-reveal scheme
const gameContract = {
  // Player commits a hash of their choice plus a random nonce
  commit: async (player, commitHash) => {
    return await contract.methods.commitChoice(player, commitHash).send();
  },
  
  // Later reveal the original choice and nonce to verify against the hash
  reveal: async (player, choice, nonce) => {
    return await contract.methods.revealChoice(player, choice, nonce).send();
  },
  
  // Determine winner after both players have revealed
  determineWinner: async (player1, player2) => {
    return await contract.methods.determineWinner(player1, player2).call();
  }
};
```

The team has decided to use a commit-reveal scheme with HSM/MPC vault instead of a full zk-SNARK implementation, which would be more cost-effective (3-5k vs 12k for a custom smart contract).

## 3. Bug Fixes

Several critical bugs were fixed in the past week:

- **Entity Array Serialization**: Fixed entity creation failures in PostgreSQL by normalizing the `names` field to ensure it's always a proper array before database operations. This fix handles Set objects and other iterables by properly converting them ([PR #6133](https://github.com/elizaOS/eliza/pull/6133)).

- **TypeScript Declaration Generation**: Resolved build errors by adding the missing `hasElizaOS()` method to the test-utils mock runtime and fixing plugin-sql TypeScript declaration generation issues ([PR #6146](https://github.com/elizaOS/eliza/pull/6146)).

- **Documentation Links**: Updated old links in documentation to their current URLs, ensuring developers can access the correct resources ([PR #6050](https://github.com/elizaOS/eliza/pull/6050)).

- **Plugin-SQL Types Path**: Fixed an incorrect types path in the package.json exports for the plugin-sql package, resolving TypeScript import errors when using the plugin ([PR #6134](https://github.com/elizaOS/eliza/pull/6134)).

## 4. API Changes

### Core Runtime API Updates

The `IAgentRuntime` interface has been extended with new methods and properties:

```typescript
interface IAgentRuntime {
  // New methods and properties
  initPromise: Promise<void>;  // Promise that resolves when runtime is fully initialized
  hasElizaOS(): this is IAgentRuntimeWithElizaOS;  // Type guard for ElizaOS capabilities
  elizaOS?: IElizaOS;  // Optional ElizaOS interface for unified API access
  
  // New parameter for initialize method
  initialize(options: RuntimeOptions & { skipMigrations?: boolean }): Promise<void>;
}
```

### Plugin Configuration Changes

The way plugins are loaded and configured has been updated to support multiple database types:

```typescript
// Dynamic plugin loading based on connection URL
if (process.env.MYSQL_URL) {
  const mysqlPlugin = await import("@elizaos/plugin-mysql");
  runtime.use(mysqlPlugin.default);
} else {
  const sqlPlugin = await import("@elizaos/plugin-sql");
  runtime.use(sqlPlugin.default);
}
```

## 5. Social Media Integrations

While addressing token migration issues, developers have been discussing improvements to the social media plugins:

- **Twitter/X Integration**: There's an ongoing task to regain control of ElizaOS Twitter accounts, which is currently tracked as a priority action item.

- **Farcaster Integration**: An updated Farcaster plugin with improved configuration handling and API updates has been proposed in [plugin-farcaster#13](https://github.com/elizaOS-plugins/plugin-farcaster/pull/13).

- **Discord Plugin**: Work is in progress to integrate a unified messaging API for the Discord plugin, which will provide better compatibility with the core ElizaOS framework.

- **Cross-Platform Sharing**: A feature has been proposed to enable Eliza agents to post commentary about game winnings to X.com and Farcaster, enhancing the social engagement of autonomous agents.

## 6. Model Provider Updates

### OpenRouter Integration

A new pull request has been opened to add OpenRouter embedding options to the command-line interface:

```bash
# Example of using the new OpenRouter embedding option
eliza embed --provider openrouter --model=openrouter/text-embedding-ada-002 "Text to embed"
```

This enhancement expands ElizaOS's integration capabilities with different AI model providers, giving developers more flexibility in choosing embedding models.

## 7. Breaking Changes

The ongoing token migration from AI16Z to ElizaOS has highlighted some important considerations for developers working with ElizaOS agents across different chains:

- **Multi-Chain Compatibility**: ElizaOS tokens now operate across multiple chains (Solana, Ethereum, Base, BSC), requiring developers to consider chain-specific implementations when building agent-based applications.

- **Bridge Functionality**: Agents may need to interact with bridge services like Jumper.exchange when operating across different blockchains.

- **Gas Fee Management**: For on-chain games and applications, developers should implement systems to compensate agents for transaction costs, potentially using accumulated ElizaOS tokens to subsidize agent gas fees.

- **LangChain Deprecation**: There's an ongoing migration from Langchain v0.3 to langchain-classic, which may require updates to existing integrations ([Issue #6145](https://github.com/elizaOS/eliza/issues/6145)).

As we continue to evolve from ElizaOS v1 to v2, developers should follow the repositories closely for additional migration guidance and breaking changes.