Skip to content

Conversation

@standujar
Copy link
Collaborator

Summary

  • Fixed startAgents API signature mismatch in CLI's e2e-tests.ts
  • Fixed unit test mock function name (getElizaCharactergetDefaultCharacter)

Problem

The CLI's elizaos test command was failing with:

undefined is not an object (evaluating 'agent.character.id')

This was caused by the e2e-tests calling server.startAgents with incorrect arguments:

  • Before: startAgents([character], [plugins], options) (3 separate args)
  • After: startAgents([{ character, plugins }], options) (proper format)

Test Plan

  • Unit tests pass: bun test packages/cli/tests/unit/commands/test/e2e-tests.test.ts
  • CLI builds successfully: bun run build in packages/cli
  • elizaos test runs plugin tests correctly

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 6, 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.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/cli-test-api-signature

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@claude
Copy link
Contributor

claude bot commented Dec 6, 2025

Claude finished @standujar's task —— View job


Code Review Complete

Todo List:

  • Read and analyze changed files
  • Review API signature changes for correctness
  • Check TypeScript usage and error handling
  • Verify test coverage and implementation
  • Provide actionable feedback

Review Results:

LOOKS GOOD: The changes correctly fix the startAgents API signature mismatch.

Analysis:

  • API Signature Fix: The change from startAgents([character], [plugins], options) to startAgents([{character, plugins}], options) is correct according to the actual API definition in packages/server/src/index.ts:582-587
  • Function Name Fix: The test mock change from getElizaCharacter to getDefaultCharacter is correct - verified export exists in packages/cli/src/characters/eliza.ts

Code Quality:

  • Changes follow existing TypeScript patterns
  • Error handling remains consistent
  • No security issues introduced
  • Follows ElizaOS architectural patterns

Testing:

  • Unit test mock correctly updated to match actual function signature
  • Changes target the exact error described: undefined is not an object (evaluating 'agent.character.id')
  • Test coverage maintained

Compliance:

  • ✅ Uses @elizaos/core imports correctly
  • ✅ No usage of banned tools (npm/pnpm/jest/vitest)
  • ✅ Proper TypeScript types maintained
  • ✅ Follows bun test framework

The PR successfully resolves the CLI test failures by correcting the API signature to match the server implementation.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants