# ElizaOS Developer Update
**Week of September 21 to September 25, 2025**

## 1. Core Framework

This week saw significant progress in the ElizaOS architecture with core system stability enhancements and a focus on more streamlined development workflows:

### Zod Schema Validation Upgrade
The team resolved critical compatibility issues between Zod v3 and v4, affecting plugin loading:

```typescript
// PR #5994: Updated Zod across CLI, Core, plugins, and starter templates
// Previously failing due to:
// Error: Cannot find module 'zod/v4' from '.../node_modules/@elizaos/plugin-openrouter/node_modules/ai/dist/index.mjs'

// Example update in core character schema
import { z } from 'zod'; // Now using Zod v4 consistently

export const CharacterSchema = z.object({
  name: z.string(),
  settings: z.record(z.string()).optional(),
  plugins: z.array(z.any()).optional(),
  // ... rest of schema
});
```

### Runtime Improvements
Fixed a critical bug causing an infinite development restart loop in the CLI by implementing recursion prevention:

```typescript
// PR #5991: Fixed infinite dev restart loop with recursion detection
if (isDevRecursion()) {
  logger.debug("Detected dev recursion, exiting to prevent infinite loop");
  process.exit(0);
}

// Improved client directory detection
const clientDir = findClientDirectory();
if (!clientDir) {
  logger.warn("No client directory found, skipping client build");
} else {
  await buildClient(clientDir);
}
```

### Framework Architecture Changes
Continuing work on the CLI refactor proposal to simplify and centralize business logic within the server package:

```typescript
// Current pattern (being refactored):
// CLI bootstraps AgentServer directly

// New approach:
// CLI only handles config and delegates execution:
await bunExec(["run", "start"], { cwd: projectDir });

// While project code fully owns AgentServer instantiation:
// project-starter/src/index.ts
const server = new AgentServer(config);
await server.start();
```

## 2. New Features

### Cloudflare Sandbox Deployment
ElizaOS CLI can now be deployed on Cloudflare's Sandbox environment:

```typescript
// Successful deployment with billing and API cost tracking
// Includes 20% sandbox fee on API requests
const cloudflareConfig = {
  billing: true,
  apiTracking: true,
  sandboxFee: 0.2, // 20% fee applied to API costs
};

// Implementation example
const agent = new ElizaOSAgent({
  provider: "cloudflare",
  config: cloudflareConfig,
});
```

### Standalone CLI Chat Interface
A new standalone CLI chat interface was added with improved user experience:

```typescript
// From standalone-cli-chat.ts
import { ElizaOS } from "@elizaos/core";
import readline from "readline";

const elizaos = new ElizaOS();
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
});

async function startChat() {
  console.log("ElizaOS CLI Chat - Type 'exit' to quit");
  await promptUser();
}

async function promptUser() {
  rl.question("You: ", async (input) => {
    if (input.toLowerCase() === "exit") {
      rl.close();
      return;
    }
    
    const response = await elizaos.chat(input);
    console.log(`ElizaOS: ${response}`);
    promptUser();
  });
}

startChat();
```

### Dynamic Prompting for Scenarios
A major feature was added to enable dynamic prompting for multi-turn conversations in ElizaOS scenarios:

```yaml
# Example from basic-conversation.scenario.yaml
run:
  - input: "Hi, I need help with something"
    conversation:
      max_turns: 4
      user_simulator:
        persona: "polite customer with a billing question"
        objective: "find out why charged twice this month"
        temperature: 0.6
      final_evaluations:
        - type: "llm_judge"
          prompt: "Did the agent successfully help resolve the billing issue?"
          expected: "yes"
```

## 3. Bug Fixes

### Zod Dependency Conflict Resolution
A critical bug was identified that prevented multiple plugins from loading after upgrading to CLI version 1.5.10:

```
Debug      Import failed using direct path ('@elizaos/plugin-openrouter'): 
error: Cannot find module 'zod/v4' from '.../node_modules/@elizaos/plugin-openrouter/node_modules/ai/dist/index.mjs'
```

The root cause was traced to a version conflict between the AI SDK requiring Zod v4 while the project was still on Zod v3. PR #5994 resolved this by upgrading all packages to Zod v4 consistently.

### Infinite Dev Restart Loop
Fixed a critical bug causing the CLI to restart infinitely when the client directory was missing:

```typescript
// Before: No recursion detection
// After: Added proper prevention
export function isDevRecursion(): boolean {
  return process.env.ELIZAOS_DEV_RECURSION === "true";
}

if (isDevRecursion()) {
  logger.debug("Preventing infinite recursion");
  process.exit(0);
}

process.env.ELIZAOS_DEV_RECURSION = "true";
```

### PGLite Data Directory Standardization
Standardized the environment variable for the PGLite data directory across examples, CLI, and SQL plugin:

```typescript
// Before: Multiple inconsistent variable names
// - PGLITE_DATA_DIR
// - SQL_PGLITE_DATA_DIR
// - DB_PGLITE_DATA_DIR

// After: Standardized to a single variable
const dataDir = process.env.PGLITE_DATA_DIR || path.join(os.homedir(), '.elizaos', 'pglite');
```

## 4. API Changes

### Enhanced CLI Port Detection
Improved port detection for automatic fallback when the default port is occupied:

```typescript
// PR #5876: Improved port detection and fallback
export async function findAvailablePort(
  startPort: number,
  endPort = startPort + 10
): Promise<number> {
  for (let port = startPort; port <= endPort; port++) {
    try {
      const server = net.createServer();
      await new Promise<void>((resolve) => {
        server.once('error', () => {
          resolve(); // Port is in use, continue to next port
        });
        server.once('listening', () => {
          server.close();
          resolve(); // Port is available
        });
        server.listen(port);
      });
      return port; // Return the first available port
    } catch (error) {
      // Continue to next port
    }
  }
  throw new Error(`No available ports found between ${startPort} and ${endPort}`);
}
```

### Browser-Safe SQL Plugin
Added a browser build for `@elizaos/plugin-sql` with PGlite WASM support:

```typescript
// packages/plugin-sql/package.json
{
  "exports": {
    ".": {
      "browser": "./dist/browser/index.browser.js",
      "node": "./dist/node/index.node.js",
      "default": "./dist/index.js"
    }
  }
}

// packages/plugin-sql/src/index.browser.ts
// Browser-specific implementation using PGlite WASM
import { createPGlite } from 'pglite';

export default function sqlPlugin() {
  return {
    name: 'sql',
    setup: (runtime) => {
      // Browser-only PGlite implementation
      const pglite = createPGlite();
      // ... plugin implementation
    }
  };
}
```

## 5. Social Media Integrations

### Twitter (X) Plugin Update
Users reported rate limiting issues with the Twitter API integration. The team is investigating potential changes to the request handling to better manage Twitter's rate limits:

```typescript
// Planned improvement to X plugin rate limiting
const rateLimitedApiCall = async (call) => {
  try {
    return await call();
  } catch (error) {
    if (error.status === 429) { // Rate limited
      logger.warn(`Rate limited by Twitter API. Retrying in ${error.retryAfter}s`);
      await sleep(error.retryAfter * 1000);
      return rateLimitedApiCall(call);
    }
    throw error;
  }
};
```

### Telegram Plugin Enhancement
Investigation started into implementing inline menu in the Telegram plugin:

```typescript
// Planned implementation for inline menu
const inlineMenu = {
  reply_markup: {
    inline_keyboard: [
      [
        { text: "Option 1", callback_data: "option1" },
        { text: "Option 2", callback_data: "option2" }
      ]
    ]
  }
};

// Using the menu in responses
await bot.sendMessage(chatId, "Please select an option:", inlineMenu);
```

## 6. Model Provider Updates

### GPT-5-Codex Availability
GPT-5-Codex is now available through OpenRouter, optimized for coding workflows:

```typescript
// Example usage of GPT-5-Codex via OpenRouter
const response = await runtime.callAction("GENERATE_TEXT", {
  provider: "openrouter",
  model: "openai:gpt-5-codex",
  prompt: "Write a React component that implements a color picker with hex code output",
  temperature: 0.2,
  max_tokens: 1500
});
```

### OpenRouter Plugin Fix
Fixed an issue in the OpenRouter plugin related to Zod v4 compatibility:

```typescript
// Before: Error importing Zod v4
// Cannot find module 'zod/v4' from '.../node_modules/@elizaos/plugin-openrouter/node_modules/ai/dist/index.mjs'

// After: Updated dependencies in package.json
{
  "dependencies": {
    "ai": "^2.2.33",
    "zod": "^4.0.0" // Explicit dependency on Zod v4
  }
}
```

## 7. Breaking Changes

### Token Migration from $ai16z to $elizaOS
A major token migration is underway from $ai16z to $elizaOS:

```
Important: All token holders will need to follow a specific migration process
that will be detailed next week. This affects holdings on all exchanges.
```

Key information:
- Token holders need to follow a specific migration process (details coming next week)
- Trades and spot orders will be suspended during migration
- Perpetual futures contracts won't be migrated ("perpetual" remains as a contract)
- Different exchanges will handle the transition according to their own timelines
- The team is designing the migration to avoid classification as an airdrop for tax purposes

### CLI Version Check Improvements
Fixed CLI version check to respect distribution channels:

```typescript
// PR #5980: Only show update notifications for same channel
export function getVersionChannel(version: string): VersionChannel {
  if (version.includes('alpha')) return 'alpha';
  if (version.includes('beta')) return 'beta';
  return 'stable';
}

// Only notify about updates in same channel
if (
  latestVersion && 
  semver.gt(latestVersion, currentVersion) && 
  getVersionChannel(latestVersion) === getVersionChannel(currentVersion)
) {
  console.log(`Update available: ${latestVersion}`);
}
```

---

**Links:**
- [PR #5994: Update Zod package version](https://github.com/elizaos/eliza/pull/5994)
- [PR #5991: Prevent infinite dev restart loop](https://github.com/elizaos/eliza/pull/5991)
- [PR #5987: Standardize PGLite data directory environment variable](https://github.com/elizaos/eliza/pull/5987)
- [PR #5876: Fix port detection for automatic fallback](https://github.com/elizaos/eliza/pull/5876)
- [Issue #5995: Zod/v4 not loading in 1.5.10](https://github.com/elizaos/eliza/issues/5995)
- [Issue #5860: Refactor Eliza CLI](https://github.com/elizaos/eliza/issues/5860)