Skip to content

fix(openviking): send tenant-scoping headers for multi-tenant servers#4863

Closed
Mibayy wants to merge 1 commit into
NousResearch:mainfrom
Mibayy:fix/openviking-tenant-headers-4825
Closed

fix(openviking): send tenant-scoping headers for multi-tenant servers#4863
Mibayy wants to merge 1 commit into
NousResearch:mainfrom
Mibayy:fix/openviking-tenant-headers-4825

Conversation

@Mibayy

@Mibayy Mibayy commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #4825 — OpenViking memory plugin fails on multi-tenant servers because it doesn't send the required X-OpenViking-Account and X-OpenViking-User headers.

Root cause: _VikingClient._headers() only set Content-Type and X-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_ACCOUNTX-OpenViking-Account (default: root)
  • OPENVIKING_USERX-OpenViking-User (default: default)

Since the values are read in the _VikingClient constructor from env vars, all 4 instantiation sites in the plugin automatically inherit the fix.

Changes

  • plugins/memory/openviking/__init__.py:
    • _VikingClient.__init__(): accept account/user params, fall back to env vars
    • _VikingClient._headers(): include both tenant headers
    • Module docstring: document new env vars

Test plan

  • Set OPENVIKING_ACCOUNT=root and OPENVIKING_USER=default in .env
  • Verify POST /api/v1/search/find succeeds (was failing without headers)
  • Verify session lifecycle (commit, memory extraction) works
  • Verify default values work when env vars are unset

🤖 Generated with Claude Code

…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>
@teknium1

teknium1 commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

Merged via PR #4936. Your commit was cherry-picked onto current main with authorship preserved. Thanks @Mibayy!

@teknium1 teknium1 closed this Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(openviking memory): send tenant headers for multi-tenant OpenViking

2 participants