# ElizaOS Developer Update - Week ending 2025-11-08

## 1. Core Framework

The ElizaOS framework saw several critical architecture updates this week:

### 1.1 Runtime Improvements
- **Dynamic Prompt Execution System** was introduced to optimize prompt context handling. This schema-based executor includes validation, retries, metrics tracking, and automatic token estimation to prevent context overflow with smaller models [PR #6113].
- **Agent Settings Persistence** has been fixed, resolving a critical bug where runtime-generated configurations were lost across agent restarts [PR #6106].
- **Migration Control** added with a new `skipMigrations` option for `runtime.initialize()`, allowing selective migration execution for faster service startup [PR #6132].
- **Entity-level Row Security** implementation is in progress, introducing fine-grained access control to database entries [PR #6107].

### 1.2 Plugin System Enhancements
- **Entity Handling** improved with a fix for the PostgreSQL array serialization issue. The system now properly normalizes `Entity.names` to string arrays, handling diverse input types including Set objects [PR #6133].
- **X402 Payment Middleware** added to protect plugin routes, supporting both EVM (EIP-712/ERC-3009) and Solana verification with a complete payment config registry for Base, Solana, and Polygon USDC [PR #6114].

## 2. New Features

### 2.1 Headless Browser Streaming
Jin implemented a significant new capability for interactive media:

```javascript
// Example of creating a headless Chrome WebGL streaming instance
const stream = new HeadlessWebGLStream({
  targetRTMP: "rtmp://live.pumpfun.com/live/your_stream_key",
  gpuAcceleration: true,
  resolution: { width: 1920, height: 1080 },
  fps: 30,
  enableAudio: true
});

// Connect to interactive chat
await stream.connectChat({
  source: "pumpfun", 
  channelId: "eliza_interactive"
});

// Load 3D scene with interactive avatar
await stream.loadScene("https://assets.elizaos.com/avatars/animated_host.html");

// Start 24/7 reliable streaming
await stream.start();
```

This containerized approach enables:
- Reliable 24/7 streaming of WebGL applications to RTMP endpoints
- GPU-accelerated rendering within Docker containers
- Live chat integration for interactive experiences
- Support for multiple avatars and interactive shows

### 2.2 React Integration
A new `@elizaos/react` package is being developed to provide headless, reusable React hooks for external developers [PR #6093]:

```tsx
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { ElizaReactProvider, useAgents, useStartAgent } from '@elizaos/react';

const queryClient = new QueryClient();

function App() {
  return (
    <QueryClientProvider client={queryClient}>
      <ElizaReactProvider baseUrl="http://localhost:3000">
        <AgentList />
      </ElizaReactProvider>
    </QueryClientProvider>
  );
}

function AgentList() {
  const { data: agents, isLoading } = useAgents();
  const startAgent = useStartAgent({
    onSuccess: () => toast.success('Agent started!'),
  });

  return (
    <div>
      {agents?.map((agent) => (
        <div key={agent.id}>
          <h3>{agent.name}</h3>
          <button onClick={() => startAgent.mutate(agent.id)}>Start</button>
        </div>
      ))}
    </div>
  );
}
```

This package provides 30 hooks covering agent management, messaging, runs, and memories, built on TanStack React Query for optimal state management.

## 3. Bug Fixes

### 3.1 PostgreSQL Entity Creation
Fixed a critical bug in `plugin-sql` that was causing entity creation failures:

```typescript
// Before: Set objects in Entity.names caused PostgreSQL errors
const entity = {
  type: "contact",
  names: new Set(["John", "Johnny"]), // Would fail in PostgreSQL
  metadata: { company: "ElizaOS" }
};

// After: Automatic normalization of diverse input types
// Now handles Sets, Maps, iterables, strings, and non-string values
// All properly converted to string[] for database compatibility
```

The fix adds a robust `normalizeEntityNames()` method to coerce inputs into proper string arrays before database operations. Comprehensive tests were added covering multiple edge cases.

### 3.2 Base Deployment Issues
Shaw reported that LP provider issues on Base were causing migration delays but confirmed these have been resolved with the Aerodrom team. The migration portal successfully launched despite these challenges.

## 4. API Changes

### 4.1 New Runtime API
```typescript
// New runtime API for dynamic prompt execution
interface IAgentRuntime {
  // NEW: Execute prompts with schema validation and retry logic
  dynamicPromptExecFromState<T>(
    state: State,
    prompt: string,
    schemaRow: SchemaRow,
    options?: {
      model?: string;
      temperature?: number;
      validationLevel?: ValidationLevel;
      requestId?: string;
    }
  ): Promise<T>;
  
  // NEW: Skip migrations during initialization
  initialize(options?: { skipMigrations?: boolean }): Promise<void>;
}
```

### 4.2 Payment API
New payment protection middleware exposes:
```typescript
// Define a payment-protected route
router.get('/protected-data', 
  applyPaymentProtection({
    config: "base_usdc",       // Use predefined Base USDC config
    amount: "0.1",             // Cost per request
    facilityPaymentId: "data", // Payment category
    memo: "Access protected data"
  }), 
  (req, res) => {
    // Handle request - only runs after payment verification
    res.json({ data: "Protected content" });
  }
);
```

## 5. Social Media Integrations

### 5.1 X (Twitter) Account Recovery
Shaw announced that a deal is nearly finalized with X to recover accounts through a backdated enterprise license, expected to be completed in 1-2 weeks. This will restore the X integration that was temporarily interrupted.

### 5.2 Discord Integration
Work on a unified messaging API for Discord is in progress [elizaos-plugins/plugin-discord#24], which will standardize how agents interact with Discord channels and users.

## 6. Model Provider Updates

### 6.1 Optimization for Smaller Context Windows
The new dynamic prompt execution system addresses issues with smaller context window models:
- Automatically estimates token usage to prevent context overflow
- Provides schema-based validation to ensure model outputs match expected formats
- Supports XML/JSON parsing with UUID validation codes for reliable structured responses
- Implements a configurable retry policy based on validation levels

This is particularly useful for adapting to models with limited context windows while preventing hallucinations.

## 7. Breaking Changes

### 7.1 Token Migration (AI16Z to elizaOS)
The migration portal for AI16Z to elizaOS tokens launched on November 6th with a 90-day window ending February 4th, 2024. Important details:

- Conversion ratio: 1 AI16Z = 6 elizaOS
- Migration requires minimal gas fees (Solana)
- Exchange migrations are being handled automatically but at varying paces
- Users can check official announcements for exchange-specific timelines
- Unclaimed tokens after the deadline won't be burned; support tickets will be available
- For wallet visibility issues in Phantom, manually add the token in Phantom settings

### 7.2 Framework ID System
There have been reports of confusion around the framework ID system when creating groups and triggering agent posts. Documentation improvements are planned to clarify this system. Developers should be aware that some API restructuring may occur to address these usability concerns.

---

**Links:**
- [Entity Normalization Fix PR #6133](https://github.com/elizaos/eliza/pull/6133)
- [X402 Payment Middleware PR #6114](https://github.com/elizaos/eliza/pull/6114)
- [Dynamic Prompt Framework PR #6113](https://github.com/elizaos/eliza/pull/6113)
- [React Hooks Package PR #6093](https://github.com/elizaos/eliza/pull/6093)
- [Entity-level Row Security PR #6107](https://github.com/elizaos/eliza/pull/6107)
- [Migration Skip Option PR #6132](https://github.com/elizaos/eliza/pull/6132)