feat(claude): add cache_control and speed passthrough controls#4247
Conversation
WalkthroughThis pull request adds support for the Changes
Possibly related PRs
Poem
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ast-grep (0.42.1)web/src/components/table/channels/modals/EditChannelModal.jsx[] Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
docs/openapi/relay.json (1)
3284-3287: Prefer concrete schemas over empty object placeholders.The new object fields are currently too generic (
properties: {}), which weakens generated SDK typing and API docs quality.Proposed schema-tightening direction
- "cache_control": { - "type": "object", - "properties": {} - }, + "cache_control": { + "$ref": "#/components/schemas/ClaudeCacheControl" + }, - "context_management": { - "type": "object", - "properties": {} - }, + "context_management": { + "$ref": "#/components/schemas/ClaudeContextManagement" + }, - "mcp_servers": { - "type": "array", - "items": { - "type": "object", - "properties": {} - } - }, + "mcp_servers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ClaudeMcpServer" + } + },Also applies to: 3369-3398
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/openapi/relay.json` around lines 3284 - 3287, The OpenAPI schemas use empty object placeholders (e.g., the "cache_control" schema with "properties: {}" and other object schemas at the 3369-3398 range), which produces weak typings; replace those empty-object definitions with concrete property definitions (list the actual fields expected on cache_control, their types and required flags) or, if the structure is genuinely free-form, add "additionalProperties": { "type": "string" } or an explicit "additionalProperties": false to make intent clear; update the schema entries (referencing "cache_control" and the other object schema names in that range) so generated SDKs/docs get accurate types rather than empty objects.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@web/src/i18n/locales/ru.json`:
- Line 581: The Russian translation for the key "允许 speed 透传" uses "Разрешить
передачу speed" but should match adjacent entries' terminology by using
"сквозную передачу"; update the value to "Разрешить сквозную передачу speed" (or
the project-standard phrasing with "сквозную передачу") so the wording is
consistent across ru.json and the UI.
---
Nitpick comments:
In `@docs/openapi/relay.json`:
- Around line 3284-3287: The OpenAPI schemas use empty object placeholders
(e.g., the "cache_control" schema with "properties: {}" and other object schemas
at the 3369-3398 range), which produces weak typings; replace those empty-object
definitions with concrete property definitions (list the actual fields expected
on cache_control, their types and required flags) or, if the structure is
genuinely free-form, add "additionalProperties": { "type": "string" } or an
explicit "additionalProperties": false to make intent clear; update the schema
entries (referencing "cache_control" and the other object schema names in that
range) so generated SDKs/docs get accurate types rather than empty objects.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: e4144d66-9f5b-42c2-84e5-ec19be3bc2f3
📒 Files selected for processing (14)
docs/openapi/relay.jsondto/channel_settings.godto/claude.gorelay/common/override.gorelay/common/override_test.gorelay/common/relay_info.goweb/src/components/table/channels/modals/EditChannelModal.jsxweb/src/i18n/locales/en.jsonweb/src/i18n/locales/fr.jsonweb/src/i18n/locales/ja.jsonweb/src/i18n/locales/ru.jsonweb/src/i18n/locales/vi.jsonweb/src/i18n/locales/zh-CN.jsonweb/src/i18n/locales/zh-TW.json
| "允许 inference_geo 透传": "Разрешить передачу inference_geo", | ||
| "允许 safety_identifier 透传": "Разрешить сквозную передачу safety_identifier", | ||
| "允许 service_tier 透传": "Разрешить сквозную передачу service_tier", | ||
| "允许 speed 透传": "Разрешить передачу speed", |
There was a problem hiding this comment.
Use consistent “透传” wording in Russian translation.
Line 581 currently uses “передачу”, while adjacent entries use “сквозную передачу”. Aligning terminology will keep the UI consistent.
💡 Suggested wording update
- "允许 speed 透传": "Разрешить передачу speed",
+ "允许 speed 透传": "Разрешить сквозную передачу speed",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "允许 speed 透传": "Разрешить передачу speed", | |
| "允许 speed 透传": "Разрешить сквозную передачу speed", |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@web/src/i18n/locales/ru.json` at line 581, The Russian translation for the
key "允许 speed 透传" uses "Разрешить передачу speed" but should match adjacent
entries' terminology by using "сквозную передачу"; update the value to
"Разрешить сквозную передачу speed" (or the project-standard phrasing with
"сквозную передачу") so the wording is consistent across ru.json and the UI.
Important
📝 变更描述 / Description
claude原生请求体填补cache_control和speed,speed增加字段控制,默认过滤
🚀 变更类型 / Type of change
🔗 关联任务 / Related Issue
✅ 提交前检查项 / Checklist
Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。📸 运行证明 / Proof of Work
Summary by CodeRabbit
Release Notes