Skip to content

fix(session): drop user registry check for message role_id#1601

Merged
chenjw merged 1 commit intomainfrom
fix/session-role-id-registry-check
Apr 20, 2026
Merged

fix(session): drop user registry check for message role_id#1601
chenjw merged 1 commit intomainfrom
fix/session-role-id-registry-check

Conversation

@qin-ctx
Copy link
Copy Markdown
Collaborator

@qin-ctx qin-ctx commented Apr 20, 2026

Description

Remove the session add_message user-registry validation for role_id so message actor IDs remain backward-compatible and are not forced to map to registered account users.

Related Issue

N/A

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test update

Changes Made

  • removed api_key_manager.has_user(...) validation from session role_id resolution for add_message
  • restored compatibility for unregistered/default user contexts when writing user messages
  • updated the existing session API test to assert unregistered role_id values are accepted

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this on the following platforms:
    • Linux
    • macOS
    • Windows

Checklist

  • My code follows the project's coding style
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Screenshots (if applicable)

N/A

Additional Notes

session.role_id is now treated purely as the message actor identifier on this HTTP path instead of being constrained by account user registration.

Restore add_message compatibility by treating session role_id as a message actor
identifier instead of requiring it to be a registered account user.
@github-actions
Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🏅 Score: 95
🧪 PR contains tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ No major issues detected

@github-actions
Copy link
Copy Markdown

PR Code Suggestions ✨

No code suggestions found for the PR.

@chenjw chenjw merged commit 1b5728a into main Apr 20, 2026
5 checks passed
@chenjw chenjw deleted the fix/session-role-id-registry-check branch April 20, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants