You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Gateway embedding and reranking responses rebuild the tenant from its ID alone, causing billing events to contain UNKNOWN_REGION and fail downstream region resolution. Preserve the original request tenant when converting gateway usage, and reject responses whose tenant ID does not match the request. No gateway protocol changes are required.
A mismatched gateway tenant ID deliberately fails the command with UNEXPECTED_SERVER_ERROR to guard against a response being attributed to the wrong tenant. Both IDs are logged only on the server; the client-facing error remains generic. Case-only differences are accepted, including Cassandra's SINGLE-TENANT / single-tenant round trip.
Both gateway client regression tests reproduced UNKNOWN_REGION before the fix. Afterward, all 99 focused gateway, billing, and tenant tests passed:
./mvnw -B -ntp test -Dtest=EmbeddingGatewayClientTest,RerankingGatewayClientTest,ModelUsageTest,DefaultBillingTest,TenantTests,SubdomainTenantResolverTests -DskipITs
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
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.
What this PR does:
Gateway embedding and reranking responses rebuild the tenant from its ID alone, causing billing events to contain
UNKNOWN_REGIONand fail downstream region resolution. Preserve the original request tenant when converting gateway usage, and reject responses whose tenant ID does not match the request. No gateway protocol changes are required.A mismatched gateway tenant ID deliberately fails the command with
UNEXPECTED_SERVER_ERRORto guard against a response being attributed to the wrong tenant. Both IDs are logged only on the server; the client-facing error remains generic. Case-only differences are accepted, including Cassandra'sSINGLE-TENANT/single-tenantround trip.Both gateway client regression tests reproduced
UNKNOWN_REGIONbefore the fix. Afterward, all 99 focused gateway, billing, and tenant tests passed:./mvnw -B -ntp test -Dtest=EmbeddingGatewayClientTest,RerankingGatewayClientTest,ModelUsageTest,DefaultBillingTest,TenantTests,SubdomainTenantResolverTests -DskipITsWhich issue(s) this PR fixes:
None linked.
Checklist