Skip to content

Conversation

@yungalgo
Copy link
Contributor

@yungalgo yungalgo commented Jun 25, 2025

Problem

  • Plugin Management: Plugins were managed at the project level in package.json, forcing all agents to share the same plugin set
  • No Character Flexibility: No ability to configure different plugins for different characters/agents within the same project
  • Tight Coupling: Plugin management was tightly coupled to project dependencies rather than agent-specific configurations
  • Limited Multi-Agent Support: Agent commands only supported single agents, with elizaos agent start silently ignoring multiple characters
  • Inconsistent UX: Different commands used different parameter names (--name, --path, --remote-character) for character specification
  • CI Test Failures: Tests passed locally but failed in CI due to orphaned processes, causing false negatives in GitHub Actions

Solution

Comprehensive refactor implementing character-centric architecture with full multi-agent support:

Character-Centric Plugin Management

  • Character-scoped plugins: Plugins are now configured in individual character files (character.plugins array)
  • Dynamic plugin loading: Runtime loads plugins from character configurations rather than project dependencies
  • Character-targeted operations: Plugin commands operate directly on character file configurations

Multi-Agent Support

  • Unified character specification: All commands now use consistent -c, --character flags
  • Multi-character operations: Most commands support operating on multiple characters simultaneously
  • Flexible input formats: Supports space-separated, comma-separated, and mixed character specification
  • Comprehensive agent lifecycle: Full multi-agent support across start, stop, get, remove, and clear-memories operations

Key Changes

Core Infrastructure

  • character-finder.ts - Standardized character file discovery across project directories with path resolution
  • character-parser.ts - Unified parsing for both JSON and TypeScript character files with flexible input handling
  • character-updater.ts - Safe character configuration updates with plugin-specific utilities
  • BREAKING: Plugins are NO LONGER listed as dependencies in project's package.json - defined exclusively in character plugins arrays

Multi-Agent Command Support

  • Unified Character Specification: All agent commands now use consistent -c, --character <paths...> syntax
  • Multi-Character Operations:
    • elizaos agent start -c bobby,billy - Start multiple agents simultaneously
    • elizaos agent stop -c bobby,billy - Stop multiple agents
    • elizaos agent get -c bobby,billy - Get details for multiple agents
    • elizaos agent remove -c bobby,billy - Remove multiple agents
    • elizaos agent clear-memories -c bobby,billy - Clear memories for multiple agents
  • Single Agent Restriction: elizaos agent set -c bobby - Only accepts single character (by design)
  • Flexible Input Formats:
    • Comma-separated: elizaos agent start -c bobby,billy
    • Space-separated: elizaos agent start -c bobby billy
    • Mixed sources: elizaos agent start -c bobby ./billy.json https://example.com/alice.json
    • Auto-extension: .json extension added automatically if missing

Refactors & Code Cleanup

  • Modular Design: Extracted installed-plugins.ts from list.ts for improved separation of concerns
  • Standardized Utilities: Implemented reusable character argument handling across start, dev, agent, and plugins commands
  • Error Handling Improvements: Enhanced error recovery with graceful fallbacks instead of hard exits
  • Code Quality: Applied optional chaining, removed redundant try-catch blocks, and improved consistency
  • Dependency Cleanup: Removed unnecessary OpenAI dependency from CLI package.json

CI Test Infrastructure Fixes

  • Root Cause: Tests using Bun.spawn weren't properly terminating server processes, leaving orphaned processes that CI environments detect as failures. This was causing all 3 CLI tests (ubuntu, macos, windows) to fail
  • Process Cleanup: Enhanced afterAll hooks in test files to kill entire process groups, not just individual processes
  • Multi-Layer Cleanup: Added cleanup at test level, script level, and CI workflow level to ensure no processes remain
  • CI Verification: Created scripts to reproduce CI behavior locally (test-like-ci.sh, verify-cleanup.sh)
  • Affected Files:
    • agent.test.ts and dev.test.ts - Enhanced process termination
    • cleanup-processes.sh - Shell script for process cleanup
    • .github/workflows/cli-tests.yml - Added always-run cleanup step
    • package.json - Updated test:cli to include cleanup

CLI Commands

Plugin Commands (Character-Scoped)

  • elizaos plugins add -c <character> - Adds plugins to character files (supports both -c and --character flags)
  • elizaos plugins remove -c <character> - Removes plugins from character files
  • elizaos plugins installed-plugins -c <character> - Displays character-specific plugins, organized by agent
  • Multi-Character Support: All plugin commands support multiple character targets

Agent Commands (Multi-Agent Support)

  • elizaos agent start -c <characters...> - Start single or multiple agents
  • elizaos agent stop -c <characters...> - Stop single or multiple agents
  • elizaos agent get -c <characters...> - Get details for single or multiple agents
  • elizaos agent remove -c <characters...> - Remove single or multiple agents
  • elizaos agent clear-memories -c <characters...> - Clear memories for single or multiple agents
  • elizaos agent set -c <character> - Update configuration (single agent only)

Enhanced Character Resolution

  • Auto-discovery: Intelligent character file discovery across common project directories
  • Multiple formats: Supports character names, file paths, and URLs
  • Path resolution: Automatic .json extension and common directory searching
  • Error recovery: Graceful handling of missing or invalid character files

Technical Fixes & Improvements

  • Critical Fix: Added tsconfig path mapping for @elizaos/core to resolve Bun module resolution issues
  • Architectural Change: Completely removed plugin dependencies from project-level package.json files
  • Enhanced Error Handling: Plugin installation now continues with recovery options instead of hard exits
  • Improved Logging: Better error messages and user guidance throughout the system
  • Template Updates: Updated starter templates to reflect plugin-free project structure

Documentation Updates

  • Comprehensive CLI Documentation: Updated README.md and agent.md to reflect new character-centric workflow
  • Multi-Agent Examples: Added examples for multi-character operations and various input formats
  • Migration Guide: Clear documentation for migrating from project-scoped to character-scoped plugins
  • Troubleshooting: Enhanced error handling documentation and recovery procedures

Breaking Changes

Plugin Management Migration Required

  • Before: Plugins listed in project package.json dependencies
  • After: Plugins specified in individual character plugins arrays
  • Migration: Move plugin entries from package.json to relevant character files

Agent Command Parameter Changes

  • Before: Mixed parameter names (--name, --path, --remote-character)
  • After: Unified -c, --character for all agent operations
  • Impact: All agent command invocations need parameter updates

@yungalgo yungalgo self-assigned this Jun 25, 2025
@yungalgo yungalgo added the 1.x V2 label Jun 25, 2025
@yungalgo yungalgo added this to Eliza Jun 25, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 25, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This update refactors plugin management in ElizaOS CLI from a project-level to a character-centric approach. Core CLI commands (add, remove, installed-plugins) now operate on specified character files, with robust character path parsing and validation. Documentation and examples were revised to reflect these changes, and new utilities for character file resolution and plugin updates were introduced.

Changes

Files/Areas Change Summary
packages/cli/README.md, packages/docs/docs/cli/plugins.md, .../cli/agent.md, etc. Documentation updated to describe character-centric plugin management, revised CLI examples, and troubleshooting.
packages/cli/package.json, packages/project-starter/package.json Removed unused plugin dependencies.
packages/cli/src/commands/plugins/actions/install.ts, .../remove.ts Refactored to require --character, update character files on plugin add/remove, improved error handling.
packages/cli/src/commands/plugins/actions/installed-plugins.ts New module to list plugins per character file.
packages/cli/src/commands/plugins/actions/list.ts Removed project-level plugin listing logic.
packages/cli/src/commands/plugins/index.ts CLI commands updated to operate on character files; new/updated imports and options.
packages/cli/src/commands/plugins/types.ts Added character option to plugin command types; introduced RemovePluginOptions.
packages/cli/src/commands/plugins/utils/character-updater.ts New utility for loading, updating, and saving plugins in character files.
packages/cli/src/commands/agent/actions/lifecycle.ts, .../start/index.ts Improved character file resolution, validation, and error reporting.
packages/cli/src/utils/character-finder.ts New utility for resolving, validating, and discovering character files.
packages/cli/src/utils/character-parser.ts New utility for robust CLI character path parsing and normalization.
packages/cli/src/utils/load-plugin.ts Improved debug logging for plugin import attempts.
packages/project-starter/tsconfig.json Updated TypeScript paths to reference installed packages instead of source.
packages/docs/docs/cli/start.md, .../dev.md, .../quickstart.md Documentation expanded for plugin loading, development, and troubleshooting in the character-centric model.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI
    participant CharacterFile
    participant PluginRegistry

    User->>CLI: elizaos plugins add <plugin> --character <file>
    CLI->>CharacterFile: Resolve and validate <file>
    CLI->>PluginRegistry: Install <plugin> if missing
    CLI->>CharacterFile: Add <plugin> to plugins array
    CharacterFile-->>CLI: Save updated character file
    CLI-->>User: Plugin added to character
Loading
sequenceDiagram
    participant User
    participant CLI
    participant CharacterFile

    User->>CLI: elizaos plugins remove <plugin> --character <file>
    CLI->>CharacterFile: Resolve and validate <file>
    CLI->>CharacterFile: Remove <plugin> from plugins array
    CharacterFile-->>CLI: Save updated character file
    CLI-->>User: Plugin removed from character
Loading

Possibly related PRs

Suggested reviewers

  • wtfsayo
  • ChristopherTrimboli

Poem

In files where characters dwell and dream,
Plugins now join by a more focused scheme.
No more global sprawl—each hero their own,
With add and remove, the new seeds are sown.
The CLI now asks, “Which soul shall I tend?”
Character by character, plugins ascend!
🌟

✨ Finishing Touches
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Post Copyable Unit Tests in Comment
  • Commit Unit Tests in branch feat/agent-scoped-plugins

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@graphite-app
Copy link

graphite-app bot commented Jun 25, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • merge-queue-hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@yungalgo
Copy link
Contributor Author

@BugBot full review

@yungalgo
Copy link
Contributor Author

@coderabbitai full review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 25, 2025

✅ Actions performed

Full review triggered.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the ElizaOS plugin system from a project-scoped architecture to a character-centric model, enabling individual characters/agents to have their own plugin configurations.

  • Removed plugin dependencies from package.json and adjusted tsconfig path mappings.
  • Added new utilities for character file discovery, parsing, and updates.
  • Updated CLI commands and associated documentation to reflect the shift to character-scoped plugin management.

Reviewed Changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/project-starter/tsconfig.json Updated path mapping for @elizaos/core to resolve Bun module issues.
packages/project-starter/package.json Removed project-scoped plugin dependencies.
packages/docs/* Updated documentation and examples for character-centric plugins.
packages/cli/src/utils/* Added/modified utilities for character file finding, parsing, and logging.
packages/cli/src/commands/* Adjusted CLI commands (start, agent, plugins) to support character files.
packages/cli/package.json & packages/cli/README.md Updated dependencies and documentation to align with the new architecture.
Comments suppressed due to low confidence (1)

packages/cli/src/commands/plugins/actions/install.ts:124

  • [nitpick] Including a comment that clarifies the required format and behavior of the '--character' flag (such as supporting multiple file paths) would help future developers understand the expected input.
async function updateCharacterFiles(pluginName: string, opts: AddPluginOptions): Promise<void> {

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (8)
packages/docs/docs/cli/agent.md (1)

145-157: Fix duplicated "directory" phrase.

The character file resolution documentation is excellent, but there's a grammatical issue with "directory directory" repetition.

- 2. Search common directories:
-    - Current directory
-    - `./characters/` directory
-    - `./agents/` directory
-    - `./src/characters/` directory
-    - `./src/agents/` directory
+ 2. Search common directories:
+    - Current directory
+    - `./characters/`
+    - `./agents/`
+    - `./src/characters/`
+    - `./src/agents/`
packages/cli/src/commands/plugins/actions/installed-plugins.ts (3)

30-66: Missing error handling for empty results.

When specific character paths are provided but yield no valid character files (line 36), the function returns without any user feedback. Consider logging a message to inform the user that their specified paths didn't match any valid character files.

  if (characterFilePaths.size === 0) {
-   console.log('No valid character files found.');
+   console.log('No valid character files found for the specified paths.');
+   console.log('Please check your character paths and try again.');
    return;
  }

87-91: Remove unnecessary continue statement.

The continue statement is redundant as it's the last statement in the loop iteration.

  } catch (error) {
    // Skip files that can't be loaded
-   continue;
  }

54-63: Inconsistent output formatting between paths.

The output format differs between specific character queries and all character scans. Consider using consistent formatting for better user experience.

For consistency, consider using the same header style in both paths. Either use logHeader once for all output or use it consistently per character.

Also applies to: 99-107

packages/cli/src/commands/plugins/actions/install.ts (1)

137-141: Consider graceful error handling for character updates.

The function exits the process when character file updates fail, even though the plugin installation may have succeeded. Consider offering a recovery option or warning instead of a hard exit.

  } catch (error) {
    logger.error(`Failed to update character file ${characterPath}:`, error);
-   process.exit(1);
+   logger.warn('Plugin was installed but character file update failed.');
+   logger.info('You can manually add the plugin to your character file.');
+   // Optionally continue with other character files or exit based on a flag
  }
packages/cli/README.md (1)

310-313: Consider expanding the plugin loading documentation.

While the auto-installation feature is mentioned, users might benefit from more details about:

  • Where plugins are installed (node_modules?)
  • What happens if installation fails
  • Network requirements for auto-installation
packages/cli/src/commands/plugins/utils/character-updater.ts (1)

39-45: TypeScript character file support needed.

The current implementation throws an error for TypeScript files. Since the character finder utility can detect TypeScript character files, this limitation should be addressed.

Would you like me to help implement TypeScript character file update support? This would involve parsing and updating the TypeScript AST.

packages/cli/src/utils/character-finder.ts (1)

361-385: Use optional chaining for cleaner code.

Replace manual null checks with optional chaining.

-    if (characterMatch && characterMatch[1]) {
-      return characterMatch[1];
+    if (characterMatch?.[1]) {
+      return characterMatch[1];
     }
     
     // Look for agents array with character
     const agentsMatch = content.match(/agents\s*:\s*\[[^\]]*character\s*:\s*{[^}]*name\s*:\s*["'`]([^"'`]+)["'`]/);
-    if (agentsMatch && agentsMatch[1]) {
-      return agentsMatch[1];
+    if (agentsMatch?.[1]) {
+      return agentsMatch[1];
     }
     
     // Look for const characterName: Character = { name: "..." }
     const typedCharMatch = content.match(/const\s+\w+\s*:\s*Character\s*=\s*{[^}]*name\s*:\s*["'`]([^"'`]+)["'`]/);
-    if (typedCharMatch && typedCharMatch[1]) {
-      return typedCharMatch[1];
+    if (typedCharMatch?.[1]) {
+      return typedCharMatch[1];
     }
     
     // Fallback to simple patterns
     for (const pattern of patterns) {
       const match = content.match(pattern);
-      if (match && match[1]) {
-        return match[1];
+      if (match?.[1]) {
+        return match[1];
       }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 854d047 and 18041bd.

📒 Files selected for processing (22)
  • packages/cli/README.md (6 hunks)
  • packages/cli/package.json (0 hunks)
  • packages/cli/src/commands/agent/actions/lifecycle.ts (2 hunks)
  • packages/cli/src/commands/agent/index.ts (1 hunks)
  • packages/cli/src/commands/plugins/actions/install.ts (6 hunks)
  • packages/cli/src/commands/plugins/actions/installed-plugins.ts (1 hunks)
  • packages/cli/src/commands/plugins/actions/list.ts (0 hunks)
  • packages/cli/src/commands/plugins/actions/remove.ts (2 hunks)
  • packages/cli/src/commands/plugins/index.ts (5 hunks)
  • packages/cli/src/commands/plugins/types.ts (1 hunks)
  • packages/cli/src/commands/plugins/utils/character-updater.ts (1 hunks)
  • packages/cli/src/commands/start/index.ts (3 hunks)
  • packages/cli/src/utils/character-finder.ts (1 hunks)
  • packages/cli/src/utils/character-parser.ts (1 hunks)
  • packages/cli/src/utils/load-plugin.ts (2 hunks)
  • packages/docs/docs/cli/agent.md (3 hunks)
  • packages/docs/docs/cli/dev.md (3 hunks)
  • packages/docs/docs/cli/plugins.md (6 hunks)
  • packages/docs/docs/cli/start.md (2 hunks)
  • packages/docs/docs/quickstart.md (2 hunks)
  • packages/project-starter/package.json (0 hunks)
  • packages/project-starter/tsconfig.json (1 hunks)
💤 Files with no reviewable changes (3)
  • packages/cli/package.json
  • packages/project-starter/package.json
  • packages/cli/src/commands/plugins/actions/list.ts
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: wtfsayo
PR: elizaOS/eliza#4493
File: packages/docs/docs/core/plugins.md:95-101
Timestamp: 2025-05-08T09:37:35.805Z
Learning: The ElizaOS CLI uses the plural form "plugins" for plugin management commands (e.g., "elizaos plugins add", "elizaos plugins remove", "elizaos plugins list"), while the singular form "plugin" is used for plugin development operations (e.g., "elizaos plugin publish").
packages/docs/docs/cli/plugins.md (1)
Learnt from: wtfsayo
PR: elizaOS/eliza#4493
File: packages/docs/docs/core/plugins.md:95-101
Timestamp: 2025-05-08T09:37:35.805Z
Learning: The ElizaOS CLI uses the plural form "plugins" for plugin management commands (e.g., "elizaos plugins add", "elizaos plugins remove", "elizaos plugins list"), while the singular form "plugin" is used for plugin development operations (e.g., "elizaos plugin publish").
packages/cli/README.md (1)
Learnt from: wtfsayo
PR: elizaOS/eliza#4493
File: packages/docs/docs/core/plugins.md:95-101
Timestamp: 2025-05-08T09:37:35.805Z
Learning: The ElizaOS CLI uses the plural form "plugins" for plugin management commands (e.g., "elizaos plugins add", "elizaos plugins remove", "elizaos plugins list"), while the singular form "plugin" is used for plugin development operations (e.g., "elizaos plugin publish").
🪛 LanguageTool
packages/docs/docs/cli/agent.md

[grammar] ~149-~149: This phrase is duplicated. You should probably use “directory directory” only once.
Context: ...Search common directories: - Current directory - ./characters/ directory - ./agents/ directory - ./src/characters/ directory - ./src/agents/ directory 3. If no...

(PHRASE_REPETITION)

🪛 Biome (1.9.4)
packages/cli/src/commands/plugins/actions/installed-plugins.ts

[error] 89-89: Unnecessary continue statement

Unsafe fix: Delete the unnecessary continue statement

(lint/correctness/noUnnecessaryContinue)

packages/cli/src/utils/character-finder.ts

[error] 318-318: The catch clause that only rethrows the original error is useless.

An unnecessary catch clause can be confusing.
Unsafe fix: Remove the try/catch clause.

(lint/complexity/noUselessCatch)


[error] 362-362: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 368-368: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 374-374: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 381-381: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: validate
  • GitHub Check: databaseIntegrationTests
  • GitHub Check: test (ubuntu-latest)
  • GitHub Check: test (windows-latest)
  • GitHub Check: test (macos-latest)
🔇 Additional comments (33)
packages/cli/src/utils/character-parser.ts (1)

1-57: Well-designed utility with comprehensive format support.

The implementation correctly handles multiple CLI input formats and edge cases. The regex pattern, deduplication logic, and defensive filtering are all properly implemented.

packages/project-starter/tsconfig.json (1)

26-27: Path mapping correctly updated for new architecture.

The change from source paths to node_modules aligns with the character-centric plugin management where core modules are treated as installed dependencies.

packages/cli/src/commands/plugins/types.ts (1)

14-19: Types properly support character-scoped plugin management.

The optional character properties correctly enable plugin operations on specific character files while maintaining flexibility for multiple file handling.

packages/cli/src/utils/load-plugin.ts (2)

70-74: Enhanced logging improves plugin loading visibility.

The detailed debug messages with emojis clearly indicate import success/failure, making plugin loading issues easier to troubleshoot.


223-231: Strategy-level logging provides excellent debugging detail.

The per-strategy logging helps users understand exactly which import methods are being attempted and their outcomes.

packages/docs/docs/quickstart.md (2)

51-95: Excellent documentation of character-centric workflow.

The new character creation step clearly explains the architecture shift and provides a practical JSON template. The optional nature keeps the quickstart accessible while introducing advanced concepts.


106-106: Wording correctly reflects new plugin management.

The updated text accurately describes how plugins are now added to character configurations rather than project-level dependencies.

packages/cli/src/commands/agent/index.ts (1)

53-62: Excellent documentation enhancement.

The detailed character file resolution explanation and examples significantly improve user experience by clearly documenting the automatic path resolution behavior.

packages/docs/docs/cli/dev.md (1)

114-162: Comprehensive plugin loading documentation.

The new sections clearly explain the character-centric plugin architecture and provide practical examples for both development and troubleshooting scenarios.

packages/cli/src/commands/agent/actions/lifecycle.ts (2)

79-102: Solid refactoring to use new character utilities.

The implementation correctly uses the new utility functions with proper async handling and maintains comprehensive error handling throughout the character path resolution flow.


109-112: Improved error messaging.

The updated error messages provide clearer context about character file parsing failures, enhancing debugging experience.

packages/docs/docs/cli/start.md (2)

138-162: Clear explanation of character-centric plugin loading.

The updated startup process documentation and plugin loading section effectively communicate the architectural shift from project-scoped to character-scoped plugin management.


207-223: Practical plugin troubleshooting guidance.

The troubleshooting section provides useful commands and steps for debugging plugin loading issues in the new character-centric architecture.

packages/cli/src/commands/plugins/actions/install.ts (1)

125-128: Good defensive programming.

The function properly validates the character option before proceeding, preventing undefined behavior.

packages/cli/src/commands/plugins/actions/remove.ts (1)

67-75: Smart handling of missing dependencies.

Good approach to attempt character file updates even when the plugin isn't found in package.json, as it may have been manually removed.

packages/cli/src/commands/start/index.ts (2)

83-89: Excellent user guidance.

The informative output clearly shows available characters and how to use them, improving the user experience significantly.


118-125: Clean error handling.

Good distinction between expected and unexpected errors, avoiding unnecessary noise in the logs.

packages/cli/src/commands/plugins/index.ts (2)

47-49: Clear requirement for character specification.

The required --character option with descriptive help text makes the new architecture clear to users.


21-23: Consistent with established naming conventions.

The plural form "plugins" for management commands aligns with the documented ElizaOS CLI patterns.

packages/cli/README.md (5)

142-144: LGTM! Clear explanation of the new architecture.

The documentation effectively communicates the paradigm shift from project-level to character-centric plugin management.


147-147: Good clarification on the list command behavior change.

The updated description accurately reflects that list now shows registry plugins rather than project dependencies.


164-176: Helpful character file example.

The JSON example clearly shows how plugins are now declared within character files, supporting both npm packages and local paths.


179-189: Comprehensive usage examples.

The examples effectively demonstrate the new --character flag requirement across different plugin operations.


679-684: Clear development workflow updates.

The documentation properly reflects the new character-centric workflow for both plugin and project development.

Also applies to: 768-771

packages/cli/src/commands/plugins/utils/character-updater.ts (3)

51-64: Well-implemented plugin addition logic.

Good use of immutable updates and duplicate checking.


69-82: Clean plugin removal implementation.

Proper existence checking and immutable updates.


87-94: LGTM!

Simple and effective JSON file update.

packages/docs/docs/cli/plugins.md (3)

29-32: Accurate command documentation updates.

The table correctly reflects the new --character requirement for plugin management commands.


143-168: Excellent architectural explanation.

The documentation clearly explains the benefits of character-centric plugin management and provides a helpful example.


280-347: Comprehensive troubleshooting guide.

Excellent coverage of common issues with practical command examples for debugging character and plugin problems.

packages/cli/src/utils/character-finder.ts (3)

21-72: Robust character path resolution.

The function implements a comprehensive search strategy checking multiple locations and extensions.


84-105: Well-configured file search patterns.

Good use of globby with comprehensive ignore patterns to exclude non-character files.


186-241: Thorough TypeScript character detection.

Excellent pattern matching for various character export formats with proper test file exclusion.

@yungalgo yungalgo marked this pull request as ready for review June 25, 2025 10:11
@yungalgo
Copy link
Contributor Author

@wtfsayo @ChristopherTrimboli still a failing ci test or two to clean up but otherwise good to review

cursor[bot]

This comment was marked as outdated.

Resolved conflicts:
- packages/core/src/utils.ts: Used develop's smarter attachment formatting logic
- packages/cli/package.json: Kept our character-centric approach without plugin dependencies
@wtfsayo
Copy link
Member

wtfsayo commented Jun 25, 2025

Plugin Management: Plugins were managed at the project level in package.json, forcing all agents to share the same plugin set
No Character Flexibility: No ability to configure different plugins for different characters/agents within the same projec

Incorrect

@wtfsayo
Copy link
Member

wtfsayo commented Jun 25, 2025

BREAKING: Plugins are NO LONGER listed as dependencies in project's package.json - defined exclusively in character plugins arrays

umm what?

cursor[bot]

This comment was marked as outdated.

@yungalgo
Copy link
Contributor Author

@wtfsayo windows macos and ubuntu are passing

cursor[bot]

This comment was marked as outdated.

@yungalgo
Copy link
Contributor Author

Bug: Agent Configuration Validation Error

The setAgentConfig function expects a single character, as defined by its command signature. However, it directly passes opts.character to resolveAgentId without validating that it's a single, non-comma-separated string. If a user provides a comma-separated string (e.g., "agent1,agent2"), resolveAgentId will receive this as a single, invalid agent ID, leading to unexpected behavior or errors. This is inconsistent with other agent commands (get, remove, clear) which were updated to handle multiple characters.

packages/cli/src/commands/agent/actions/crud.ts#L230-L231
Fix in Cursor

Was this report helpful? Give feedback by reacting with 👍 or 👎

i fixed this

@wtfsayo
Copy link
Member

wtfsayo commented Jun 25, 2025

@coderabbitai full summary what does it change

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 25, 2025

Tip

For best results, initiate chat on the files or code changes.

@wtfsayo Here's a comprehensive summary of what this PR changes:

🔄 Core Architectural Change

From Project-Scoped to Agent-Scoped Plugin Management

Previously, plugins were managed globally at the project level in package.json, forcing all agents in a project to share the same plugin set. Now, each character/agent can have its own specific plugins defined in their individual character files.

📝 Key Changes

1. Plugin Configuration Location

  • Before: Plugins listed in package.json dependencies
  • After: Plugins defined in each character's plugins array within their JSON file

2. CLI Commands Refactored

All plugin management commands now require a --character option:

  • elizaos plugins add <plugin> --character <file>
  • elizaos plugins remove <plugin> --character <file>
  • elizaos plugins installed-plugins --character <file>

3. New Utility Modules

  • character-finder.ts - Discovers and validates character files
  • character-parser.ts - Parses character paths from CLI input
  • character-updater.ts - Updates character files with plugin changes

4. Runtime Plugin Loading

  • Plugins are now loaded dynamically from each character's configuration
  • Missing plugins are automatically installed at runtime
  • Each character loads only its specified plugins

💥 Breaking Changes

  1. Plugin Dependencies: Plugins are NO LONGER listed in package.json dependencies
  2. Migration Required: Existing projects must move plugin declarations from package.json to character files
  3. CLI Usage: All plugin commands now require --character flag

✨ Benefits

  • Flexibility: Different agents can have different plugin sets
  • Isolation: Cleaner separation between plugin availability and usage
  • Multi-Agent Support: Better support for complex deployments with varying requirements
  • Scalability: Easier to manage plugins for multiple characters

📚 Documentation Updates

Extensive updates to:

  • CLI documentation and examples
  • Plugin development workflows
  • Troubleshooting guides
  • Quickstart guides

This is a fundamental architectural shift that makes ElizaOS more flexible for multi-agent scenarios while maintaining backward compatibility through migration guidance.

@wtfsayo wtfsayo merged commit 8dbb232 into develop Jun 25, 2025
12 of 13 checks passed
@wtfsayo wtfsayo deleted the feat/agent-scoped-plugins branch June 25, 2025 17:47
@github-project-automation github-project-automation bot moved this to Done in Eliza Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants