Skip to content

test: add unit tests for AgentInstanceManager getOrCreate identity semantics (Issue #113) - #201

Open
rafaio1 wants to merge 1 commit into
Lilly-Protocol:mainfrom
rafaio1:bounty/issue-113-agent-instance-identity
Open

test: add unit tests for AgentInstanceManager getOrCreate identity semantics (Issue #113)#201
rafaio1 wants to merge 1 commit into
Lilly-Protocol:mainfrom
rafaio1:bounty/issue-113-agent-instance-identity

Conversation

@rafaio1

@rafaio1 rafaio1 commented Aug 26, 2026

Copy link
Copy Markdown

Summary

Adds unit tests verifying AgentInstanceManager.getOrCreate identity semantics including reference stability, createdAt preservation, distinct instances for different IDs, and empty-ID rejection.

Tests Added

  • ✅ Same instance reference returned for identical agentId
  • ✅ Original createdAt preserved on subsequent calls
  • ✅ Distinct instances created for different agentIds
  • ✅ agentId and ISO createdAt populated on creation
  • ✅ list() returns all instances without duplicates
  • ✅ Empty agentId rejected with INVALID_TASK error

Verification

All 6 tests pass locally via npx vitest run tests/agents/agent-instance-manager.test.ts.

Closes #113

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.

[Bounty: $35] Add unit tests for AgentInstanceManager getOrCreate identity semantics

1 participant