Skip to content

fix: deny Kilo Gateway data collection - #11412

Merged
chrarnoldus merged 3 commits into
mainfrom
fix/kilo-gateway-data-collection
Jun 18, 2026
Merged

fix: deny Kilo Gateway data collection#11412
chrarnoldus merged 3 commits into
mainfrom
fix/kilo-gateway-data-collection

Conversation

@chrarnoldus

Copy link
Copy Markdown
Collaborator

Summary

  • Send provider.data_collection: \"deny\" on Kilo Gateway request bodies when hide_prompt_training_models is enabled.
  • Preserve existing provider routing fields and force the privacy preference after configured provider options are merged.
  • Reuse the Kilo Gateway's existing request wrapper so the parameter works across all supported AI SDK provider implementations without adding another fetch override.

Why

Hiding models that may train on prompts should also prevent eligible upstream providers from collecting request data. Kilo Gateway supports this through a non-standard top-level provider routing parameter.

Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
@chrarnoldus chrarnoldus self-assigned this Jun 18, 2026
Comment thread packages/kilo-gateway/src/provider.ts Outdated
@kilo-code-bot

kilo-code-bot Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
packages/kilo-gateway/src/responses.ts 52 Non-object provider value is silently replaced with {} when injecting data_collection.
Other Observations (not in diff)

No issues found outside the diff.

Files Reviewed (4 files in incremental review)
  • packages/kilo-gateway/src/provider.ts - no new issues (refactor: addDataCollection removed, now calls transformRequestBody)
  • packages/kilo-gateway/src/responses.ts - 1 carried-forward issue (non-object provider overwrite, previously at provider.ts:34)
  • packages/kilo-gateway/test/provider.test.ts - no issues (tests moved to responses.test.ts)
  • packages/kilo-gateway/test/responses.test.ts - no issues

Incremental review (commit 2c9e72c3bb2b20): This refactor consolidates addDataCollection and sanitizeResponsesBody into a single transformRequestBody, transforming the request body once instead of twice. The merge of the two paths is correct — when store === true the input is not stripped but data_collection is still injected; when neither path applies the body is returned unchanged. The carried-forward SUGGESTION previously flagged on provider.ts:34 (now-deleted addDataCollection) still applies at the new location responses.ts:52, where record(data.provider) ? data.provider : {} replaces a non-object provider (e.g. a string) with {} before adding data_collection. The original inline comments on provider.ts:34 are now stale since the function was removed; the behavior is otherwise unchanged. No memory leaks or resource-lifecycle concerns.

Fix these issues in Kilo Cloud

Previous Review Summary (commit 2c9e72c)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 2c9e72c)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
packages/kilo-gateway/src/provider.ts 34 Non-object provider value in request body is silently overwritten when injecting data_collection.
Other Observations (not in diff)

No issues found outside the diff.

Files Reviewed (5 files)
  • packages/kilo-gateway/src/provider.ts - 1 issue
  • packages/kilo-gateway/src/types.ts - no issues
  • packages/kilo-gateway/test/provider.test.ts - no issues
  • packages/opencode/src/kilocode/provider/provider.ts - no issues
  • packages/opencode/src/provider/provider.ts - no issues
  • packages/opencode/test/kilocode/kilo-loader-auth.test.ts - no issues

Notes:

  • hide_prompt_training_models already exists in Config.Info (packages/opencode/src/config/config.ts:230), so no cloud config schema mirror is needed for this PR.
  • Fork hygiene is good: the new patchKiloProviderPrivacy helper lives in the Kilo-owned src/kilocode/provider/provider.ts and is wired into the shared provider.ts behind a single kilocode_change marker.
  • The patchKiloProviderPrivacy call is correctly placed after the config providers merge loop (line 1493), ensuring the deny preference sticks even if config re-applies provider options. No memory leaks or resource-lifecycle concerns in the added code.

Fix these issues in Kilo Cloud


Reviewed by glm-5.2-20260616 · 229,288 tokens

Review guidance: REVIEW.md from base branch main

chrarnoldus and others added 2 commits June 18, 2026 10:45
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
@chrarnoldus
chrarnoldus merged commit b930a19 into main Jun 18, 2026
22 checks passed
@chrarnoldus
chrarnoldus deleted the fix/kilo-gateway-data-collection branch June 18, 2026 12:29
NJ-2020 pushed a commit to NJ-2020/kilocode that referenced this pull request Jul 4, 2026
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
…-collection

fix: deny Kilo Gateway data collection
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.

2 participants