Repository navigation
fix(ai-gateway): merge request and organization privacy with deny precedence - #6696
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe incremental range Files Reviewed (4 files)
Previous Review Summaries (8 snapshots, latest commit 3f87750)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 3f87750)Status: No Issues Found | Recommendation: Merge Executive SummaryIncremental follow-up Files Reviewed (3 files)
Previous review (commit 6ee8f2f)Status: 1 Issue Found | Recommendation: Address before merge Executive SummaryFollow-up Overview
Issue Details (click to expand)WARNING
Files Reviewed (2 files)
Fix these issues in Kilo Cloud Previous review (commit 9c647c7)Status: No Issues Found | Recommendation: Merge Executive SummaryThe incremental baseline Files Reviewed (15 files)
Previous review (commit edc14a7)Status: No Issues Found | Recommendation: Merge Executive SummaryFollow-up Files Reviewed (1 file)
Previous review (commit 4d53eb5)Status: No Issues Found | Recommendation: Merge Executive SummaryFollow-up commit Files Reviewed (1 file)
Previous review (commit 0d8d36f)Status: No Issues Found | Recommendation: Merge Executive SummaryFollow-up commit Files Reviewed (4 files)
Previous review (commit d979e27)Status: No Issues Found | Recommendation: Merge Executive SummaryThe incremental commit resolves the prior Files Reviewed (14 files)
Previous review (commit 516a6d4)Status: 1 Issue Found | Recommendation: Address before merge Fix: Fix these issues in Kilo Cloud Executive SummaryThe privacy normalization correctly implements deny-wins merging and preserves request ZDR, but applying it before provider selection now injects organization Overview
Issue Details (click to expand)WARNING
Files Reviewed (5 files)
Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0 Review guidance: REVIEW.md from base branch |
edc14a7 to
4d53eb5
Compare
…org embedding privacy directly
Summary
Preparatory PR for #6681, independently based on main. The shared
getEffectiveProviderPrivacyandproviderPrivacySchemahelpers validate and merge request and organization privacy in one place. Each endpoint now sends only the privacy fields its upstream actually supports.data_collection: denywins if either the request or the organization denies collection. Requestzdris preserved independently.provider.data_collection/provider.zdr, which OpenRouter documents for these endpoints (ZDR per-request enforcement).provider, which OpenRouter documents for/embeddings. For Vercel BYOK it is translated intoproviderOptions.gateway.zeroDataRetention/disallowPromptTraining.providersent to OpenRouter/systemone. Client routing, credential, and identity overrides are still stripped.providerobject upstream. OpenRouter's Create transcription reference lists noproviderfield for multipart. For JSON,provideris limited tooptions, a provider-specific passthrough. Routing and privacy preferences (only,order,ignore,data_collection,zdr) are not supported there. The organization/group model-access gate still applies.data_collectionmapping.Intentional Behavior Changes
allowno longer weakens a requestdeny, and organization/group overrides no longer discard request ZDR. Managed gateway restrictions are cumulative.provider.data_collection/provider.zdrvalues now return 400 instead of being silently forwarded or ignored.provider_allow_list(only) ordata_collectionupstream;maindid before this PR. OpenRouter does not document these fields for the endpoint, so this removes the appearance of enforcement, not actual enforcement. A client-supplied JSONproviderobject is still passed through unchanged and is not validated, matchingmain.Boundaries
bypassAccessCheckaccess-policy gating is unchanged. Bypass routes get no extra restoration of the requestproviderproperty; native providers keep their own request handling.Verification
170daceef: chat, embeddings, transcription, TypeSafe, provider-privacy, and llm-proxy-helpers suites pass (8 suites, 256 tests). Redundant per-endpoint privacy matrices were trimmed; the full merge table lives inprovider-privacy.test.ts.apps/webtypecheck (tsgo),oxfmt, andoxlintpass on the changed files.0d8d36f35: an isolated real-HTTP E2E matrix passed 105/105 cases across chat, Responses, Messages, embeddings, transcription JSON/multipart, and TypeSafe. The loopback capture upstream replaced only the external AI provider, with gateway auth, settings, and privacy merging not mocked. The supporting route/schema regression run passed 398/398. The transcription privacy rows of that matrix covered behavior this PR has since removed. Since then, the other surfaces have changed only through the CI type fix in4d53eb5c3, the behavior-preserving embeddings refactor in3f87750e7, and the test trimming in170daceef.