Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/schemas/bifrost.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ const (
BifrostContextKeyRealtimeVoice BifrostContextKey = "bifrost-realtime-voice" // string
BifrostIsAsyncRequest BifrostContextKey = "bifrost-is-async-request" // bool (set by bifrost - DO NOT SET THIS MANUALLY)) - whether the request is an async request (only used in gateway)
BifrostContextKeyRequestHeaders BifrostContextKey = "bifrost-request-headers" // map[string]string (all request headers with lowercased keys)
BifrostContextKeyRequestQuery BifrostContextKey = "bifrost-request-query" // map[string]string (request query params with lowercased keys; consumed by governance routing CEL rules)
BifrostContextKeyAllowPerRequestStorageOverride BifrostContextKey = "bifrost-allow-per-request-storage-override" // bool (set by transport from config — gates whether x-bf-disable-content-logging and x-bf-store-raw-request-response per-request overrides are honored)
BifrostContextKeyAllowPerRequestRawOverride BifrostContextKey = "bifrost-allow-per-request-raw-override" // bool (set by transport from config — gates whether x-bf-send-back-raw-request and x-bf-send-back-raw-response per-request overrides are honored)
BifrostContextKeyDisableContentLogging BifrostContextKey = "x-bf-disable-content-logging" // bool (per-request override for content logging; only honored when BifrostContextKeyAllowPerRequestStorageOverride is true)
Expand Down
1 change: 1 addition & 0 deletions plugins/governance/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ require (
github.com/bahlo/generic-list-go v0.2.0 // indirect
github.com/buger/jsonparser v1.1.2 // indirect
github.com/bytedance/gopkg v0.1.3 // indirect
github.com/bytedance/sonic v1.15.0 // indirect
Comment thread
Pratham-Mishra04 marked this conversation as resolved.
github.com/bytedance/sonic/loader v0.5.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cloudwego/base64x v0.1.6 // indirect
Expand Down
10 changes: 10 additions & 0 deletions plugins/governance/httptransportprehook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ import (

// TestHTTPTransportPreHook_VirtualKeyReplicateRefinesNestedModel verifies that
// virtual-key provider pinning rewrites the request model to Replicate's nested provider slug.
//
// Body-having governance routing moved to PreRequestHook; HTTPTransportPreHook now no-ops for
// body-having requests. Equivalent PreRequestHook test belongs in Phase 3 once integration
// normalization is finalized. See private/pre-request-hook-refactor-plan.md.
func TestHTTPTransportPreHook_VirtualKeyReplicateRefinesNestedModel(t *testing.T) {
t.Skip("body-having branch migrated to PreRequestHook — rewrite as PreRequestHook test in Phase 3")
Comment thread
coderabbitai[bot] marked this conversation as resolved.
logger := NewMockLogger()
mc := modelcatalog.NewTestCatalog(map[string]string{
"openai/gpt-5-nano": "gpt-5-nano",
Expand Down Expand Up @@ -403,6 +408,7 @@ func TestHTTPTransportPreHook_WildcardOpaqueProviderRespectsBlacklist(t *testing
// matches on the /genai path, governance load balancing does not override the routing-rule target
// with a provider from the VK pool (regression test for issue #2516).
func TestHTTPTransportPreHook_GenAIRoutingRulePreservesTarget(t *testing.T) {
t.Skip("body-having branch migrated to PreRequestHook; ctx.Value(\"model\") cross-plugin handoff removed — rewrite as PreRequestHook test in Phase 3")
logger := NewMockLogger()

routingRule := configstoreTables.TableRoutingRule{
Expand Down Expand Up @@ -470,6 +476,7 @@ func TestHTTPTransportPreHook_GenAIRoutingRulePreservesTarget(t *testing.T) {
// containing the routing-rule provider, confirming the fix holds when p.inMemoryStore != nil
// and the provider IS present in GetConfiguredProviders (the normal production code path).
func TestHTTPTransportPreHook_GenAIRoutingRulePreservesTarget_WithStore(t *testing.T) {
t.Skip("body-having branch migrated to PreRequestHook; ctx.Value(\"model\") cross-plugin handoff removed — rewrite as PreRequestHook test in Phase 3")
logger := NewMockLogger()

routingRule := configstoreTables.TableRoutingRule{
Expand Down Expand Up @@ -545,6 +552,7 @@ func TestHTTPTransportPreHook_GenAIRoutingRulePreservesTarget_WithStore(t *testi
// TestHTTPTransportPreHook_GenAINoRoutingRuleStillLoadBalances verifies that when no routing rule
// matches on the /genai path, governance load balancing still selects a provider from the VK pool.
func TestHTTPTransportPreHook_GenAINoRoutingRuleStillLoadBalances(t *testing.T) {
t.Skip("body-having branch migrated to PreRequestHook — rewrite as PreRequestHook test in Phase 3")
logger := NewMockLogger()

// VK with repro-openai-b at weight=1 — LB should select this
Expand Down Expand Up @@ -593,6 +601,7 @@ func TestHTTPTransportPreHook_GenAINoRoutingRuleStillLoadBalances(t *testing.T)
// matches on the /bedrock path, governance load balancing does not override the routing-rule target
// (regression test mirroring the GenAI fix for the Bedrock integration).
func TestHTTPTransportPreHook_BedrockRoutingRulePreservesTarget(t *testing.T) {
t.Skip("body-having branch migrated to PreRequestHook; ctx.Value(\"modelId\") cross-plugin handoff removed — rewrite as PreRequestHook test in Phase 3")
logger := NewMockLogger()

routingRule := configstoreTables.TableRoutingRule{
Expand Down Expand Up @@ -658,6 +667,7 @@ func TestHTTPTransportPreHook_BedrockRoutingRulePreservesTarget(t *testing.T) {
// TestHTTPTransportPreHook_BedrockNoRoutingRuleStillLoadBalances verifies that when no routing rule
// matches on the /bedrock path, governance load balancing still selects a provider from the VK pool.
func TestHTTPTransportPreHook_BedrockNoRoutingRuleStillLoadBalances(t *testing.T) {
t.Skip("body-having branch migrated to PreRequestHook — rewrite as PreRequestHook test in Phase 3")
logger := NewMockLogger()

// VK with repro-openai-b at weight=1 — LB should select this
Expand Down
Loading
Loading