fix(openviking): send tenant-scoping headers for multi-tenant servers#4863
Closed
Mibayy wants to merge 1 commit into
Closed
fix(openviking): send tenant-scoping headers for multi-tenant servers#4863Mibayy wants to merge 1 commit into
Mibayy wants to merge 1 commit into
Conversation
…search#4825) OpenViking is multi-tenant and requires X-OpenViking-Account and X-OpenViking-User headers. Without them, API calls like POST /api/v1/search/find fail on authenticated servers. Add both headers to _VikingClient._headers(), read from env vars OPENVIKING_ACCOUNT (default: root) and OPENVIKING_USER (default: default). All instantiation sites inherit the fix automatically. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
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
Fixes #4825 — OpenViking memory plugin fails on multi-tenant servers because it doesn't send the required
X-OpenViking-AccountandX-OpenViking-Userheaders.Root cause:
_VikingClient._headers()only setContent-TypeandX-API-Key. OpenViking v0.3.3+ requires tenant-scoping headers on every request.Fix: Add both headers to
_headers(), sourced from env vars with safe defaults:OPENVIKING_ACCOUNT→X-OpenViking-Account(default:root)OPENVIKING_USER→X-OpenViking-User(default:default)Since the values are read in the
_VikingClientconstructor from env vars, all 4 instantiation sites in the plugin automatically inherit the fix.Changes
plugins/memory/openviking/__init__.py:_VikingClient.__init__(): acceptaccount/userparams, fall back to env vars_VikingClient._headers(): include both tenant headersTest plan
OPENVIKING_ACCOUNT=rootandOPENVIKING_USER=defaultin.envPOST /api/v1/search/findsucceeds (was failing without headers)🤖 Generated with Claude Code