Skip to content

feat!: add UUID to all messages #363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

feat!: add UUID to all messages #363

wants to merge 2 commits into from

Conversation

OskarStark
Copy link
Contributor

@OskarStark OskarStark commented Jun 29, 2025

Summary

  • Added unique identifiers (UUIDv7) to all message types
  • Each message now automatically gets a unique ID upon instantiation
  • Added comprehensive tests for the new ID functionality

Breaking Change 🚨

This is a breaking change as MessageInterface now requires the getId(): Uuid method to be implemented by all message classes.

Implementation Details

  • Added symfony/uid package dependency (^7.3)
  • Added public readonly Uuid $id property to all message classes
  • IDs are generated automatically in constructors using Uuid::v7()
  • Added getId() method to all message implementations

Test Coverage

Added tests for each message type to ensure:

  • ID is properly generated and accessible
  • ID remains consistent for the same message instance
  • Different message instances have different IDs

Closes #77
Closes #344

🤖 Generated with Claude Code

OskarStark and others added 2 commits June 29, 2025 22:36
BREAKING CHANGE: The capability constant OUTPUT_STRUCTURED has been renamed to STRUCTURED_OUTPUT for better naming consistency. Additionally, the constant value has been changed from 'output-structured' to 'structured-output'.

Migration:
- Update all references from Capability::OUTPUT_STRUCTURED to Capability::STRUCTURED_OUTPUT
- If storing/comparing capability strings directly, update from 'output-structured' to 'structured-output'

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
BREAKING CHANGE: MessageInterface now requires getUid() method

- Added symfony/uid package dependency
- Added UuidV7 uid property to all message classes (UserMessage, AssistantMessage, SystemMessage, ToolCallMessage)
- UIDs are automatically generated upon message instantiation
- Added comprehensive tests for UID functionality

Closes #77
Closes #344

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@OskarStark OskarStark changed the title feat\!: add unique ID (UID) to all messages feat!: add unique ID (UID) to all messages Jun 29, 2025
@OskarStark OskarStark changed the title feat!: add unique ID (UID) to all messages feat!: add unique ID (UUID) to all messages Jun 29, 2025
@OskarStark OskarStark changed the title feat!: add unique ID (UUID) to all messages feat!: add UUID to all messages Jun 29, 2025
@OskarStark OskarStark added the BC BREAK Backwards compatibility break label Jun 29, 2025
@OskarStark OskarStark closed this Jun 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BC BREAK Backwards compatibility break
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce UID for Messages
1 participant