fix: support X-OpenViking-Account and X-OpenViking-User headers for root API key#1057
Open
leckylao wants to merge 3 commits intovolcengine:mainfrom
Open
fix: support X-OpenViking-Account and X-OpenViking-User headers for root API key#1057leckylao wants to merge 3 commits intovolcengine:mainfrom
leckylao wants to merge 3 commits intovolcengine:mainfrom
Conversation
…oot API key When using root API key, the plugin needs to send X-OpenViking-Account and X-OpenViking-User headers to access agent scope (viking://agent/*). This fix: - Adds accountId and userId config options - Sends X-OpenViking-Account and X-OpenViking-User headers when configured - Enables proper agent scope memory search with root API key Without this fix, users get 'Access denied for viking://agent/xxx/memories' when using root API key, because OpenViking requires these headers for tenant-scoped APIs. Usage: openclaw config set plugins.entries.openviking.config.accountId default openclaw config set plugins.entries.openviking.config.userId main
|
Failed to generate code suggestions for PR |
OpenClaw validates config against the plugin schema. Add accountId and userId to uiHints so they are recognized as valid config options.
The config.ts has its own validation that checks for unknown keys. Add accountId and userId to the allowed keys list so they pass validation.
MaojiaSheng
approved these changes
Mar 28, 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.
Problem
When using root API key with the OpenClaw plugin, users get this error:
Background
We understand the recommendation is to use user API keys instead of root API keys. However, there is a fundamental mismatch in the current plugin design:
The plugin searches both scopes by default:
viking://user/memories(user scope)viking://agent/memories(agent scope)User API keys can only access user scope (
viking://user/*)Agent scope requires either:
X-OpenViking-Account+X-OpenViking-UserheadersThis means users who follow the recommendation to use user API keys will still get
Access deniederrors for agent scope searches.Current Options (Before This Fix)
Solution
This PR adds
accountIdanduserIdconfig options so that root API key users can properly access agent scope:Usage
Alternative Solutions Considered
Testing
Tested on OpenClaw + OpenViking 0.2.12: