Skip to content

fix(session): allow explicit role_id passthrough#1643

Merged
chenjw merged 1 commit intomainfrom
fix/allow-session-role-id
Apr 22, 2026
Merged

fix(session): allow explicit role_id passthrough#1643
chenjw merged 1 commit intomainfrom
fix/allow-session-role-id

Conversation

@qin-ctx
Copy link
Copy Markdown
Collaborator

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

Description

Allow session add-message requests to persist explicit role_id values without server-side caller-role or format enforcement.

Related Issue

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

  • Remove the USER-specific rejection path for explicit session message role_id values.
  • Stop normalizing or validating role_id format on the sessions add-message route and only auto-fill when the field is missing or empty.
  • Update the server session API tests to cover explicit role_id passthrough for USER requests, including raw sender-style identifiers.

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

Local verification:

  • python -m pytest -o addopts='' tests/server/test_api_sessions.py
  • python -m compileall openviking/server/routers/sessions.py tests/server/test_api_sessions.py

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)

Additional Notes

Existing test output includes pre-existing Pydantic deprecation warnings unrelated to this change.

Allow add-message callers to persist explicit role_id values
without USER gating or server-side format normalization.
@github-actions
Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🏅 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 5a8ed95 into main Apr 22, 2026
6 checks passed
@chenjw chenjw deleted the fix/allow-session-role-id branch April 22, 2026 14:04
@github-project-automation github-project-automation Bot moved this from Backlog to Done in OpenViking project Apr 22, 2026
r266-tech added a commit to r266-tech/OpenViking that referenced this pull request Apr 23, 2026
qin-ctx pushed a commit that referenced this pull request Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants