Skip to content

feat(ai-gateway): sanitize custom LLM JSON refs - #5130

Merged
chrarnoldus merged 1 commit into
mainfrom
maddening-llama
Aug 7, 2026
Merged

chrarnoldus merged 1 commit into
mainfrom
maddening-llama

Conversation

@chrarnoldus

Copy link
Copy Markdown
Contributor

Summary

  • add an optional sanitize_ref_fields custom LLM upstream setting
  • recursively rename $ref keys to _ref in valid JSON Chat Completions tool results
  • preserve invalid/non-matching JSON and leave Messages/Responses requests unchanged

Testing

  • pnpm --filter web exec jest src/lib/ai-gateway/experiments/build-direct-provider.test.ts --runInBand
  • pnpm --filter web run typecheck
  • pnpm --filter web run lint
  • pnpm --filter @kilocode/db run typecheck
  • pnpm --filter @kilocode/db run lint
  • pnpm format
  • git diff --check

@chrarnoldus chrarnoldus self-assigned this Aug 7, 2026
@kilo-code-bot

kilo-code-bot Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • apps/web/src/lib/ai-gateway/experiments/build-direct-provider.ts
  • apps/web/src/lib/ai-gateway/experiments/build-direct-provider.test.ts
  • packages/db/src/schema-types.ts

Reviewed by kimi-k3 · Input: 52.1K · Output: 10.6K · Cached: 534.9K

Review guidance: REVIEW.md from base branch main

@chrarnoldus
chrarnoldus merged commit 36cb38b into main Aug 7, 2026
42 of 44 checks passed
@chrarnoldus
chrarnoldus deleted the maddening-llama branch August 7, 2026 12:01
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