fix: always send tenant headers in OpenViking _headers() when account/user are set#22414
Merged
kshitijk4poor merged 1 commit intoMay 9, 2026
Conversation
…/user are set OpenViking 0.3.x requires X-OpenViking-Account and X-OpenViking-User headers for ROOT API key requests to tenant-scoped APIs. Previously the `!= "default"` guard skipped these headers when account/user were the literal string "default", causing INVALID_ARGUMENT errors. Remove the `!= "default"` guard so headers are sent whenever account/user are truthy. Empty strings are still correctly skipped since `""` is falsy. Update tests to reflect the new behavior: - test_viking_client_headers_send_tenant_when_default: asserts "default" headers ARE present (was test_omit_tenant_when_legacy_default) - test_viking_client_headers_send_tenant_when_empty_falls_back_to_default: asserts "default" headers ARE present from constructor fallback (was test_omit_tenant_when_empty) Based on NousResearch#21775 by @happy5318 Co-authored-by: kshitijk4poor <82637225+kshitijk4poor@users.noreply.github.com>
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.
Salvage of #21775 (happy5318) — with test fixes
Original PR removed the
!= "default"guard from_headers()so ROOT API keys can send tenant headers even when account/user are "default". OpenViking 0.3.x requires these headers for tenant-scoped APIs.Changes vs original
!= "default"guard)test_omit_tenant_when_legacy_default→test_headers_send_tenant_when_default== "default"test_omit_tenant_when_empty→test_headers_send_tenant_when_empty_falls_back_to_default== "default"Test results
Based on #21775 by @happy5318 (NouseResearch/hermes-agent#21775)