docs(design): sync §4.6 role_id rules with #1643 passthrough behavior#1657
Merged
qin-ctx merged 1 commit intovolcengine:mainfrom Apr 23, 2026
Merged
Conversation
…gh + no server-side format check)
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
qin-ctx
approved these changes
Apr 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Sync
docs/design/account-namespace-shared-session-design.md§4.6 with the behavior merged in #1643 (fix(session): allow explicit role_id passthrough, qin-ctx, ~14h ago).What #1643 changed
openviking/server/routers/sessions.py::_resolve_message_role_idwas simplified: the auth-mode/role-basedallow_explicit_role_idgate and the_ROLE_ID_PATTERNalpha-numeric regex validation were both removed. After #1643:USER) can passrole_idexplicitly, and the server uses the caller-provided value verbatim.role_idis not provided, the server falls back toctx.user.user_id(forrole=user) orctx.user.agent_id(forrole=assistant) — same default as before.^[a-zA-Z0-9_-]+$format or account-scoped legitimacy; those become caller responsibilities.The design doc §4.6 still documented the pre-#1643 rules (USER rejected explicit
role_id, server regex-validated the result, assistant.role_id had format/context checks), so a user reading the doc and hitting the runtime would see a mismatch.Doc change (single file, +11/-12)
role_id,服务端以传入值为准" + the same default-fill fallback as other modes.role_idfor each role, but clarify validation is now caller-side and the server no longer performs regex / context-consistency checks.No behavioral / API change; no English mirror exists for this file.
Why worth the change
The design doc is the canonical spec that reviewers and integrators consult before wiring
role_idinto clients. Leaving it documenting removed server-side guards would mislead downstream implementers into relying on validation that no longer runs, and into thinking USER-scoped API keys still reject explicitrole_id.Fixes doc/code drift from #1643. Pure docs, no tests/code changes.