Skip to content

feat: Add message UUIDs to get_messages response (Issue #77)#85

Merged
gusye1234 merged 3 commits intomemodb-io:mainfrom
slyt3:feat/message-uuids
Dec 17, 2025
Merged

feat: Add message UUIDs to get_messages response (Issue #77)#85
gusye1234 merged 3 commits intomemodb-io:mainfrom
slyt3:feat/message-uuids

Conversation

@slyt3
Copy link
Copy Markdown
Contributor

@slyt3 slyt3 commented Dec 16, 2025

Added ids field to GetMessagesOutput in Python SDK

  • Extract and return message UUIDs in Go converter
  • Add comprehensive tests for ID extraction and ordering
  • Verify end-to-end integration with test script

Changes

  • Python SDK: Added ids: list[str] field to GetMessagesOutput model
  • Go API Server: Modified converter to extract and return message UUIDs
  • Tests: Added 6 comprehensive test cases covering edge cases and integration

API Changes

Before

msgs = client.sessions.get_messages(session_id='xxx')
print(msgs.items)  # Only had message content

After

msgs = client.sessions.get_messages(session_id='xxx')
print(msgs.items)  # Message content
print(msgs.ids)    # Corresponding UUIDs

Testing

  • All Go tests pass (go test)
  • End-to-end integration test verified
  • IDs order matches items order
  • Works with all formats (OpenAI, Anthropic, Acontext)

This should close issue #77

Related to Issue (#77)

Tasks

Please ensure your pull request meets the following requirements:

  • Add ids field to GetMessagesOutput model in Python SDK
  • Modify Go converter to extract message UUIDs
  • Add comprehensive unit tests (6 test cases)
  • Verify end-to-end integration with test script
  • Ensure IDs order matches items order

Impact Areas

Which part of Acontext would this feature affect?

  • Client SDK (Python)
  • Client SDK (TypeScript)
  • Core Service
  • API Server (Go)
  • Dashboard
  • CLI Tool
  • Documentation
  • Other: please_specify_here

Checklist

  • Open your pull request against the dev branch.
  • All tests pass in available continuous integration systems (e.g., GitHub Actions).
  • Tests are added or modified as needed to cover code changes.

- Added ids field to GetMessagesOutput in Python SDK
- EXtract and return message UUIDs in Go converter
- Add comprehensive tests for ID extraction and ordering
- Verify end-to-end integration with test script

This should close issue memodb-io#77
@slyt3
Copy link
Copy Markdown
Contributor Author

slyt3 commented Dec 16, 2025

Forgot to implement TS SDK gonna fix it easily

- Fix 4 failing tests that were missing ids in mocked responses
- All Python SDK tests now pass
@slyt3
Copy link
Copy Markdown
Contributor Author

slyt3 commented Dec 16, 2025

Additional Notes

While implementing this feature, I discovered that 4 existing Python SDK tests were missing the new required ids field in their mocked responses, causing them to fail. I've updated these test mocks to include ids: [] to maintain compatibility:

  • test_async_sessions_get_messages_forwards_format
  • test_sessions_get_messages_forwards_format
  • test_sessions_get_messages_with_edit_strategies
  • test_sessions_get_messages_without_edit_strategies

All tests now should pass

The ids field is required in the GetMessagesOutput model, so any mocked API responses must include it going forward.

- add ids field to GetMessageOutputSchema
- all TS tests pass
- Matches Python SDK implementation
@slyt3
Copy link
Copy Markdown
Contributor Author

slyt3 commented Dec 16, 2025

Finished, everything should work @GenerQAQ @gusye1234

@gusye1234 gusye1234 merged commit 8710234 into memodb-io:main Dec 17, 2025
3 checks passed
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