Skip to content

v1.0.5-preview.1#19

Merged
CSCITech merged 8 commits into
mainfrom
cscitech
Jul 15, 2026
Merged

v1.0.5-preview.1#19
CSCITech merged 8 commits into
mainfrom
cscitech

Conversation

@CSCITech

Copy link
Copy Markdown
Contributor

⚠️ 提交说明 / PR Notice

Important

  • 请提供人工撰写的简洁摘要,避免直接粘贴未经整理的 AI 输出。

📝 变更描述 / Description

(简述:做了什么?为什么这样改能生效?请基于你对代码逻辑的理解来写,避免粘贴未经整理的内容)

🚀 变更类型 / Type of change

  • 🐛 Bug 修复 (Bug fix) - 请关联对应 Issue,避免将设计取舍、理解偏差或预期不一致直接归类为 bug
  • ✨ 新功能 (New feature) - 重大特性建议先通过 Issue 沟通
  • ⚡ 性能优化 / 重构 (Refactor)
  • 📝 文档更新 (Documentation)

🔗 关联任务 / Related Issue

  • Closes # (如有)

✅ 提交前检查项 / Checklist

  • 人工确认: 我已亲自整理并撰写此描述,没有直接粘贴未经处理的 AI 输出。
  • 非重复提交: 我已搜索现有的 IssuesPRs,确认不是重复提交。
  • Bug fix 说明: 若此 PR 标记为 Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。
  • 变更理解: 我已理解这些更改的工作原理及可能影响。
  • 范围聚焦: 本 PR 未包含任何与当前任务无关的代码改动。
  • 本地验证: 已在本地运行并通过测试或手动验证,维护者可以据此复核结果。
  • 安全合规: 代码中无敏感凭据,且符合项目代码规范。

📸 运行证明 / Proof of Work

(请在此粘贴截图、关键日志或测试报告,以证明变更生效)

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This change internationalizes accessibility text, updates responsive tables and header menus, extracts channel and pricing editor modules, adds dashboard and settings states, adjusts typography and layout styles, and expands locale translations.

Changes

Shared UI, localization, and responsive layout

Layer / File(s) Summary
Accessibility and responsive components
web/default/src/components/*, web/default/src/components/data-table/*
Shared controls and tables now use translated labels, container-based narrow detection, mobile selection/actions layouts, and column metadata classes.
Header tools and navigation
web/default/src/components/layout/components/*
Language and theme menus are extracted, compact header tool menus are added, and desktop/mobile navigation rendering is updated.
Locale and typography updates
web/default/src/i18n/locales/*, web/default/src/styles/*
Accessibility translations and broader locale updates accompany neutralized letter spacing and responsive homepage layout rules.

Channel and pricing editors

Layer / File(s) Summary
Channel editor state and navigation
web/default/src/features/channels/components/drawers/*
Navigation types, section-status helpers, advanced-settings detection, persistence, and formatting utilities are extracted into reusable modules.
Parameter override editors
web/default/src/features/channels/components/dialogs/param-override-*
Return-error, prune-object, and sync-field editors are moved into specialized components with shared draft types and utilities.
Tiered pricing support
web/default/src/features/system-settings/models/tiered-pricing-*
Draft numeric input, pricing utilities, presets, cost estimation, and prompt-copy support are separated from the main editor.

Dashboard and settings behavior

Layer / File(s) Summary
Dashboard operations status
web/default/src/features/dashboard/components/overview/*, web/default/src/features/dashboard/index.tsx
Dashboard query normalization, operational metrics, unavailable states, retry actions, and loading/error presentation are added.
Settings form and page states
web/default/src/features/system-settings/components/*, web/default/src/features/system-settings/models/model-pricing-sheet.tsx
Switch fields gain descriptions, disabled reasons, and validation semantics; settings pages gain skeleton and retryable error states.

Relay usage accounting

Layer / File(s) Summary
Claude output-token preservation
relay/channel/claude/*
Zero-valued output usage is backfilled from completion tokens, with tests covering upstream preservation and billing usage.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

Poem

I’m a rabbit with labels in a multilingual hat,
I hop through the tables and tidy up that.
Menus fold neatly, editors bloom bright,
Dashboards retry through errors at night.

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (1 warning, 2 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 5.19% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is just a version tag and does not describe the actual code changes, so it is too generic to assess as a meaningful summary. Replace it with a short sentence naming the main change, such as the affected feature or bug fix.
Description check ❓ Inconclusive The description is a PR template with placeholders, but it does not describe any concrete changes, so it is too vague to evaluate meaningfully. Write a concise human summary of what changed, why it changed, and how it was validated.
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cscitech

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 14

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
web/default/src/features/models/components/dialogs/prefill-group-management-dialog.tsx (1)

332-345: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Translate the desktop action labels as well.

Lines 332-345 localize only the mobile buttons; the desktop buttons at Lines 480-493 still render hardcoded Edit group and Delete group. Screen-reader labels therefore remain English on desktop.

Proposed fix
-                                        <span className='sr-only'>
-                                          Edit group
-                                        </span>
+                                        <span className='sr-only'>
+                                          {t('Edit group')}
+                                        </span>
...
-                                        <span className='sr-only'>
-                                          Delete group
-                                        </span>
+                                        <span className='sr-only'>
+                                          {t('Delete group')}
+                                        </span>

As per coding guidelines, React 组件中应使用 useTranslation() 取得 t,并通过 t() 渲染用户可见文本;子组件也应自行使用 useTranslation() 保持独立性。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@web/default/src/features/models/components/dialogs/prefill-group-management-dialog.tsx`
around lines 332 - 345, Update the desktop action buttons in the group
management dialog to use translated screen-reader labels for both edit and
delete actions, matching the existing mobile buttons. Use the component’s
useTranslation() t function and replace the hardcoded English text near the
desktop edit/delete handlers without changing the button behavior.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@web/default/src/components/data-table/data-table-page.tsx`:
- Around line 254-279: Update useNarrowTableContainer so isNarrow is not
initialized from window.innerWidth; initialize it to false and retain the
existing container measurement in the effect, ensuring the first render does not
infer layout from viewport width.

In `@web/default/src/components/layout/components/public-header.tsx`:
- Line 371: Update the public header’s mobile menu state/effect so mobileOpen is
cleared when the viewport crosses into the lg breakpoint, or ensure body scroll
locking is gated by the current viewport width. Preserve mobile menu behavior
below lg while preventing a hidden desktop overlay from keeping page scrolling
locked.

In `@web/default/src/components/ui/command.tsx`:
- Line 201: Update the class string in the command item styling to replace the
invalid Tailwind utility “text-xsst” with “text-xs”, preserving all other
classes unchanged.

In `@web/default/src/components/ui/context-menu.tsx`:
- Around line 267-273: Replace the invalid text-xsst class with the valid
text-xs utility in ContextMenuShortcut, and apply the same correction to the
corresponding shortcut styles in command.tsx, dropdown-menu.tsx, and
menubar.tsx.

In `@web/default/src/components/ui/dropdown-menu.tsx`:
- Line 283: Replace the invalid text-xsst utility with text-xs tracking-widest
in DropdownMenuShortcut’s base className in
web/default/src/components/ui/dropdown-menu.tsx:283-283 and in the
MenubarShortcut className override in
web/default/src/components/ui/menubar.tsx:235-235.

In
`@web/default/src/features/channels/components/dialogs/ollama-models-dialog.tsx`:
- Around line 106-115: Update resetDialogState to also reset deleteOpen,
deleteTarget, and isDeleting when the dialog closes. Ensure the close path
clears the prior delete confirmation and target before reopening, while
preserving the existing model, search, pull, and abort cleanup.
- Around line 177-189: Update the useEffect flow around fetchOllamaModels so
each model-fetch run is invalidated when the dialog closes, channelId/currentRow
changes, or the effect cleans up. Abort the underlying request when supported,
and ensure stale responses cannot commit models or selected state; only the
latest active run may update the UI.

In
`@web/default/src/features/channels/components/dialogs/param-override-specialized-editors.tsx`:
- Around line 142-158: Associate every label in the specialized editor
components with its corresponding form control, including the visible Error
Message field and the other referenced editor fields. Add matching unique
id/htmlFor pairs or wrap each control inside its label, ensuring all input,
textarea, and select controls have an accessible label without changing their
existing behavior.
- Around line 644-687: The sync target editor currently loses the selected type
when the key is empty because both handlers immediately rebuild the spec through
buildSyncTargetSpec. Preserve the selected type separately in the editor state,
update it in the type Select handler, and only call buildSyncTargetSpec from the
key handler once the key is non-empty, so choosing a type before entering a key
remains intact.

In
`@web/default/src/features/dashboard/components/overview/overview-dashboard.tsx`:
- Around line 294-298: Replace the nested ternary branches in the overview
dashboard, including StatusIcon and the listed status-item computations, with
if-else logic or a shared helper that evaluates unavailable before completed
before the default state. Reuse the helper for paired value/state outputs such
as operationsStatusItems to avoid duplicating the same three-way condition,
while preserving each branch’s existing results.

In
`@web/default/src/features/dashboard/components/overview/overview-query-utils.test.ts`:
- Line 19: Add Bun type support for the test build used by
overview-query-utils.test.ts, updating the relevant web/default TypeScript
configuration and dependency declarations so the bun:test import resolves during
tsc -b; alternatively, migrate the test to the repository’s configured runner
while preserving its existing behavior.

In `@web/default/src/features/system-settings/models/tiered-pricing-utils.ts`:
- Around line 28-42: Update formatTokenHint to accept the established
translation function t and use it for the rendered token hint text, including
the singular text and M/K suffix labels. Update every call site to pass t while
preserving the existing empty-value and numeric formatting behavior.

In `@web/default/src/i18n/locales/ja.json`:
- Line 49: Replace the English value for "{{count}} tiered billing models
enabled" with a proper Japanese translation in
web/default/src/i18n/locales/ja.json at lines 49-49 and a proper Russian
translation in web/default/src/i18n/locales/ru.json at lines 49-49, preserving
the {{count}} interpolation placeholder.
- Line 2742: Update the Japanese translation for the “Model pull failed:
{{msg}}” key to preserve the `{{msg}}` interpolation placeholder instead of the
literal `__ PH_0 __` token, matching the expected i18next interpolation
behavior.

---

Outside diff comments:
In
`@web/default/src/features/models/components/dialogs/prefill-group-management-dialog.tsx`:
- Around line 332-345: Update the desktop action buttons in the group management
dialog to use translated screen-reader labels for both edit and delete actions,
matching the existing mobile buttons. Use the component’s useTranslation() t
function and replace the hardcoded English text near the desktop edit/delete
handlers without changing the button behavior.
🪄 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: ASSERTIVE

Plan: Pro Plus

Run ID: fd5f2da5-f904-48ef-b409-a5e186db615e

📥 Commits

Reviewing files that changed from the base of the PR and between 6fb911f and b41523d.

📒 Files selected for processing (84)
  • web/default/src/components/ai-elements/conversation.tsx
  • web/default/src/components/ai-elements/tool.tsx
  • web/default/src/components/config-drawer.tsx
  • web/default/src/components/data-table/bulk-actions.tsx
  • web/default/src/components/data-table/data-table-page.tsx
  • web/default/src/components/data-table/mobile-card-list.tsx
  • web/default/src/components/data-table/pagination.tsx
  • web/default/src/components/datetime-picker.tsx
  • web/default/src/components/json-editor.tsx
  • web/default/src/components/language-switcher.tsx
  • web/default/src/components/layout/components/app-header.tsx
  • web/default/src/components/layout/components/footer.tsx
  • web/default/src/components/layout/components/header-tools-menu.tsx
  • web/default/src/components/layout/components/nav-group.tsx
  • web/default/src/components/layout/components/public-header.tsx
  • web/default/src/components/layout/components/section-page-layout.tsx
  • web/default/src/components/layout/components/top-nav.tsx
  • web/default/src/components/password-input.tsx
  • web/default/src/components/tag-input.tsx
  • web/default/src/components/theme-switch.tsx
  • web/default/src/components/ui/breadcrumb.tsx
  • web/default/src/components/ui/carousel.tsx
  • web/default/src/components/ui/command.tsx
  • web/default/src/components/ui/context-menu.tsx
  • web/default/src/components/ui/dialog.tsx
  • web/default/src/components/ui/dropdown-menu.tsx
  • web/default/src/components/ui/empty.tsx
  • web/default/src/components/ui/markdown.tsx
  • web/default/src/components/ui/menubar.tsx
  • web/default/src/components/ui/pagination.tsx
  • web/default/src/components/ui/sheet.tsx
  • web/default/src/components/ui/sidebar.tsx
  • web/default/src/components/ui/spinner.tsx
  • web/default/src/components/ui/titled-card.tsx
  • web/default/src/features/channels/components/channels-columns.tsx
  • web/default/src/features/channels/components/dialogs/codex-usage-dialog.tsx
  • web/default/src/features/channels/components/dialogs/ollama-models-dialog.tsx
  • web/default/src/features/channels/components/dialogs/param-override-editor-dialog.tsx
  • web/default/src/features/channels/components/dialogs/param-override-specialized-editors.tsx
  • web/default/src/features/channels/components/drawers/channel-editor-navigation.tsx
  • web/default/src/features/channels/components/drawers/channel-editor-state.ts
  • web/default/src/features/channels/components/drawers/channel-mutate-drawer.tsx
  • web/default/src/features/channels/components/numeric-spinner-input.tsx
  • web/default/src/features/dashboard/components/models/log-stat-cards.tsx
  • web/default/src/features/dashboard/components/overview/overview-dashboard.tsx
  • web/default/src/features/dashboard/components/overview/overview-query-utils.test.ts
  • web/default/src/features/dashboard/components/overview/overview-query-utils.ts
  • web/default/src/features/dashboard/components/overview/summary-cards.tsx
  • web/default/src/features/dashboard/components/overview/uptime-panel.tsx
  • web/default/src/features/dashboard/components/ui/stat-card.tsx
  • web/default/src/features/dashboard/index.tsx
  • web/default/src/features/home/components/sections/hero.tsx
  • web/default/src/features/keys/components/api-keys-columns.tsx
  • web/default/src/features/models/components/dialogs/prefill-group-management-dialog.tsx
  • web/default/src/features/models/components/dialogs/upstream-conflict-dialog.tsx
  • web/default/src/features/models/components/models-columns.tsx
  • web/default/src/features/playground/api.ts
  • web/default/src/features/playground/lib/playground-option-utils.test.ts
  • web/default/src/features/playground/lib/playground-option-utils.ts
  • web/default/src/features/pricing/components/model-details-uptime-sparkline.tsx
  • web/default/src/features/system-settings/components/settings-form-layout.tsx
  • web/default/src/features/system-settings/components/settings-page.tsx
  • web/default/src/features/system-settings/models/channel-selector-dialog.tsx
  • web/default/src/features/system-settings/models/model-pricing-sheet.tsx
  • web/default/src/features/system-settings/models/tiered-pricing-editor.tsx
  • web/default/src/features/system-settings/models/tiered-pricing-fields.tsx
  • web/default/src/features/system-settings/models/tiered-pricing-support.tsx
  • web/default/src/features/system-settings/models/tiered-pricing-utils.ts
  • web/default/src/features/users/components/users-columns.tsx
  • web/default/src/i18n/locales/_reports/_sync-report.json
  • web/default/src/i18n/locales/_reports/fr.untranslated.json
  • web/default/src/i18n/locales/_reports/ja.untranslated.json
  • web/default/src/i18n/locales/_reports/ru.untranslated.json
  • web/default/src/i18n/locales/_reports/vi.untranslated.json
  • web/default/src/i18n/locales/en.json
  • web/default/src/i18n/locales/fr.json
  • web/default/src/i18n/locales/ja.json
  • web/default/src/i18n/locales/ru.json
  • web/default/src/i18n/locales/vi.json
  • web/default/src/i18n/locales/zh.json
  • web/default/src/main.tsx
  • web/default/src/styles/index.css
  • web/default/src/styles/theme-presets.css
  • web/default/src/tanstack-table.d.ts
💤 Files with no reviewable changes (5)
  • web/default/src/i18n/locales/_reports/ru.untranslated.json
  • web/default/src/i18n/locales/_reports/ja.untranslated.json
  • web/default/src/i18n/locales/_reports/vi.untranslated.json
  • web/default/src/i18n/locales/_reports/fr.untranslated.json
  • web/default/src/main.tsx
📜 Review details
⚠️ CI failures not shown inline (2)

GitHub Actions: CI / 1_Frontend checks.txt: v1.0.5-preview.1

Conclusion: failure

View job details

##[group]Run bun run typecheck
 �[36;1mbun run typecheck�[0m
 shell: /usr/bin/bash -e {0}
 ##[endgroup]
 $ tsc -b
 src/features/dashboard/components/overview/overview-query-utils.test.ts(19,40): error TS2307: Cannot find module 'bun:test' or its corresponding type declarations.
 ##[error]Process completed with exit code 2.

GitHub Actions: CI / Frontend checks: v1.0.5-preview.1

Conclusion: failure

View job details

##[group]Run bun run typecheck
 �[36;1mbun run typecheck�[0m
 shell: /usr/bin/bash -e {0}
 ##[endgroup]
 $ tsc -b
 src/features/dashboard/components/overview/overview-query-utils.test.ts(19,40): error TS2307: Cannot find module 'bun:test' or its corresponding type declarations.
 ##[error]Process completed with exit code 2.
🧰 Additional context used
📓 Path-based instructions (5)
web/default/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (web/default/AGENTS.md)

web/default/src/**/*.{ts,tsx}: 前端页面文本与组件内文案必须支持 i18n:React 组件中应使用 useTranslation() 取得 t,并通过 t() 渲染用户可见文本;子组件也应自行使用 useTranslation() 保持独立性。
禁止使用两层及以上嵌套三元表达式;复杂逻辑应改用 if-else、提前返回或抽取函数。
控制函数圈复杂度,复杂逻辑应拆成更小的函数;变量与函数命名应有意义并遵循驼峰等常规命名约定。
TypeScript 代码应避免使用 any,优先使用具体类型或 unknown;参数与返回值应显式标注类型;仅类型用途的导入应使用 import type
修改 TypeScript 或 TSX 代码后必须执行类型检查,并修复所有类型错误,不得遗留。
对象非必要不要解构,尤其是组件 props;优先直接使用 props.xxx 以保持代码清晰。
组件应使用函数式组件与 Hooks,遵循单一职责;组件 props 必须有明确类型(接口或类型别名)。
单文件超过约 200 行时应考虑拆分子组件或抽取自定义 Hooks;类型定义可与组件同文件或放在同模块的 types 中。
在 React 中应合理使用 useMemouseCallbackReact.memo,避免在渲染路径中创建新对象或数组;必要时进行代码分割与动态 import
React Query 的数据获取应使用 useQuery、变更应使用 useMutation;每个查询需配置唯一 queryKey,并在成功后对相关查询执行 invalidateQueries;服务端错误应统一交给 handleServerError
Axios 请求应使用项目统一的 api 实例;GET 请求默认去重,特殊请求可显式关闭;认证与通用错误应在拦截器中统一处理。
服务端错误应统一使用 handleServerError,展示层应使用 toast.error 等统一方式;文案需走 i18n;路由级错误应由 errorComponent 承接;表单错误应通过 form.setError 等方式映射到字段。
样式应以 Tailwind 工具类为主,动态类名使用 cn() 合并;非动态场景避免内联样式;响应式采用移动优先与 Tailwind 断点,主题与暗色模式通过 CSS 变量与 dark: 处理。
应使用语义化 HTML、正确关联 label 与输入、保证键盘可操作与合理焦点顺序;必要时添加 ARIA 属性,装饰性图标应使用 aria-hidden="true"
认证与权限应在路由与接口层校验;前后端都应做数据校验(如 Zod);敏感信息不得落前端存储;避免使用 dangerouslySetInnerHTML;跨域与 Cookie 需配合 withCredentials 并按后端要求处理 CSRF。
组件测试应使用 React Testing Library,关注交互与行为,避免测试实现细节;关键流程可补充集成与 E2E 测试。
环境变量应通过 .env 读取,并使用 VITE_ 前缀;代码中不得硬编码密钥。

Files:

  • web/default/src/components/data-table/pagination.tsx
  • web/default/src/features/home/components/sections/hero.tsx
  • web/default/src/features/dashboard/components/overview/overview-query-utils.ts
  • web/default/src/features/system-settings/models/channel-selector-dialog.tsx
  • web/default/src/features/dashboard/components/overview/uptime-panel.tsx
  • web/default/src/features/playground/lib/playground-option-utils.test.ts
  • web/default/src/components/ui/dropdown-menu.tsx
  • web/default/src/components/ui/empty.tsx
  • web/default/src/tanstack-table.d.ts
  • web/default/src/components/password-input.tsx
  • web/default/src/components/ui/spinner.tsx
  • web/default/src/features/playground/lib/playground-option-utils.ts
  • web/default/src/features/users/components/users-columns.tsx
  • web/default/src/components/ui/titled-card.tsx
  • web/default/src/components/layout/components/section-page-layout.tsx
  • web/default/src/features/playground/api.ts
  • web/default/src/components/ui/context-menu.tsx
  • web/default/src/components/ui/menubar.tsx
  • web/default/src/features/channels/components/dialogs/codex-usage-dialog.tsx
  • web/default/src/components/json-editor.tsx
  • web/default/src/components/ai-elements/conversation.tsx
  • web/default/src/components/layout/components/header-tools-menu.tsx
  • web/default/src/features/dashboard/components/ui/stat-card.tsx
  • web/default/src/components/ui/dialog.tsx
  • web/default/src/components/layout/components/nav-group.tsx
  • web/default/src/features/system-settings/models/tiered-pricing-fields.tsx
  • web/default/src/features/channels/components/numeric-spinner-input.tsx
  • web/default/src/components/datetime-picker.tsx
  • web/default/src/components/data-table/bulk-actions.tsx
  • web/default/src/features/dashboard/components/overview/summary-cards.tsx
  • web/default/src/components/ui/sheet.tsx
  • web/default/src/components/layout/components/footer.tsx
  • web/default/src/features/models/components/dialogs/upstream-conflict-dialog.tsx
  • web/default/src/features/dashboard/components/models/log-stat-cards.tsx
  • web/default/src/features/channels/components/channels-columns.tsx
  • web/default/src/components/theme-switch.tsx
  • web/default/src/components/ui/carousel.tsx
  • web/default/src/components/ui/command.tsx
  • web/default/src/components/ui/breadcrumb.tsx
  • web/default/src/components/ai-elements/tool.tsx
  • web/default/src/features/keys/components/api-keys-columns.tsx
  • web/default/src/components/layout/components/app-header.tsx
  • web/default/src/features/channels/components/drawers/channel-editor-navigation.tsx
  • web/default/src/components/layout/components/public-header.tsx
  • web/default/src/features/system-settings/models/tiered-pricing-utils.ts
  • web/default/src/components/layout/components/top-nav.tsx
  • web/default/src/features/models/components/models-columns.tsx
  • web/default/src/components/language-switcher.tsx
  • web/default/src/features/system-settings/models/model-pricing-sheet.tsx
  • web/default/src/features/system-settings/components/settings-page.tsx
  • web/default/src/components/ui/sidebar.tsx
  • web/default/src/features/models/components/dialogs/prefill-group-management-dialog.tsx
  • web/default/src/features/pricing/components/model-details-uptime-sparkline.tsx
  • web/default/src/features/dashboard/components/overview/overview-query-utils.test.ts
  • web/default/src/features/system-settings/models/tiered-pricing-support.tsx
  • web/default/src/components/config-drawer.tsx
  • web/default/src/features/channels/components/dialogs/param-override-specialized-editors.tsx
  • web/default/src/features/dashboard/index.tsx
  • web/default/src/components/ui/pagination.tsx
  • web/default/src/components/data-table/mobile-card-list.tsx
  • web/default/src/features/channels/components/dialogs/ollama-models-dialog.tsx
  • web/default/src/components/data-table/data-table-page.tsx
  • web/default/src/features/channels/components/drawers/channel-editor-state.ts
  • web/default/src/features/system-settings/components/settings-form-layout.tsx
  • web/default/src/components/ui/markdown.tsx
  • web/default/src/features/channels/components/drawers/channel-mutate-drawer.tsx
  • web/default/src/features/system-settings/models/tiered-pricing-editor.tsx
  • web/default/src/features/channels/components/dialogs/param-override-editor-dialog.tsx
  • web/default/src/features/dashboard/components/overview/overview-dashboard.tsx
  • web/default/src/components/tag-input.tsx
web/default/src/features/**

📄 CodeRabbit inference engine (web/default/AGENTS.md)

功能模块应放在 src/features/<feature>/,并按需包含 components/lib/hooks/api.tstypes.tsconstants.ts 等;通用组件应放在 src/components/,通用工具与类型应放在 src/lib/

Files:

  • web/default/src/features/home/components/sections/hero.tsx
  • web/default/src/features/dashboard/components/overview/overview-query-utils.ts
  • web/default/src/features/system-settings/models/channel-selector-dialog.tsx
  • web/default/src/features/dashboard/components/overview/uptime-panel.tsx
  • web/default/src/features/playground/lib/playground-option-utils.test.ts
  • web/default/src/features/playground/lib/playground-option-utils.ts
  • web/default/src/features/users/components/users-columns.tsx
  • web/default/src/features/playground/api.ts
  • web/default/src/features/channels/components/dialogs/codex-usage-dialog.tsx
  • web/default/src/features/dashboard/components/ui/stat-card.tsx
  • web/default/src/features/system-settings/models/tiered-pricing-fields.tsx
  • web/default/src/features/channels/components/numeric-spinner-input.tsx
  • web/default/src/features/dashboard/components/overview/summary-cards.tsx
  • web/default/src/features/models/components/dialogs/upstream-conflict-dialog.tsx
  • web/default/src/features/dashboard/components/models/log-stat-cards.tsx
  • web/default/src/features/channels/components/channels-columns.tsx
  • web/default/src/features/keys/components/api-keys-columns.tsx
  • web/default/src/features/channels/components/drawers/channel-editor-navigation.tsx
  • web/default/src/features/system-settings/models/tiered-pricing-utils.ts
  • web/default/src/features/models/components/models-columns.tsx
  • web/default/src/features/system-settings/models/model-pricing-sheet.tsx
  • web/default/src/features/system-settings/components/settings-page.tsx
  • web/default/src/features/models/components/dialogs/prefill-group-management-dialog.tsx
  • web/default/src/features/pricing/components/model-details-uptime-sparkline.tsx
  • web/default/src/features/dashboard/components/overview/overview-query-utils.test.ts
  • web/default/src/features/system-settings/models/tiered-pricing-support.tsx
  • web/default/src/features/channels/components/dialogs/param-override-specialized-editors.tsx
  • web/default/src/features/dashboard/index.tsx
  • web/default/src/features/channels/components/dialogs/ollama-models-dialog.tsx
  • web/default/src/features/channels/components/drawers/channel-editor-state.ts
  • web/default/src/features/system-settings/components/settings-form-layout.tsx
  • web/default/src/features/channels/components/drawers/channel-mutate-drawer.tsx
  • web/default/src/features/system-settings/models/tiered-pricing-editor.tsx
  • web/default/src/features/channels/components/dialogs/param-override-editor-dialog.tsx
  • web/default/src/features/dashboard/components/overview/overview-dashboard.tsx
web/default/src/features/**/lib/**/*.ts

📄 CodeRabbit inference engine (web/default/AGENTS.md)

表单应使用 React Hook Form + Zod:在功能模块的 lib/ 下定义 schema,并用 z.infer 导出表单类型;useForm 应配合 @hookform/resolvers/zod 进行校验。

Files:

  • web/default/src/features/playground/lib/playground-option-utils.test.ts
  • web/default/src/features/playground/lib/playground-option-utils.ts
web/default/src/**/*.test.ts

📄 CodeRabbit inference engine (web/default/AGENTS.md)

工具函数与纯逻辑应优先编写单元测试;测试文件应命名为 *.test.ts

Files:

  • web/default/src/features/playground/lib/playground-option-utils.test.ts
  • web/default/src/features/dashboard/components/overview/overview-query-utils.test.ts
web/default/src/styles/**/*

📄 CodeRabbit inference engine (web/default/AGENTS.md)

自定义样式应集中在 src/styles/,组件内尽量少写自定义 CSS。

Files:

  • web/default/src/styles/theme-presets.css
  • web/default/src/styles/index.css
🪛 GitHub Actions: CI / 1_Frontend checks.txt
web/default/src/features/dashboard/components/overview/overview-query-utils.test.ts

[error] 19-19: tsc build failed (TS2307): Cannot find module 'bun:test' or its corresponding type declarations.

🪛 GitHub Actions: CI / Frontend checks
web/default/src/features/dashboard/components/overview/overview-query-utils.test.ts

[error] 19-19: TypeScript (tsc -b) failed with TS2307: Cannot find module 'bun:test' or its corresponding type declarations.

🪛 OpenGrep (1.25.0)
web/default/src/components/ui/markdown.tsx

[ERROR] 178-179: Dynamic command passed to child_process.exec/execSync. Use child_process.execFile or spawn with an argument array instead.

(coderabbit.command-injection.exec-js)


[ERROR] 387-389: Dynamic command passed to child_process.exec/execSync. Use child_process.execFile or spawn with an argument array instead.

(coderabbit.command-injection.exec-js)


[ERROR] 390-392: Dynamic command passed to child_process.exec/execSync. Use child_process.execFile or spawn with an argument array instead.

(coderabbit.command-injection.exec-js)


[ERROR] 521-523: Dynamic command passed to child_process.exec/execSync. Use child_process.execFile or spawn with an argument array instead.

(coderabbit.command-injection.exec-js)

🔇 Additional comments (79)
web/default/src/components/data-table/pagination.tsx (1)

135-137: LGTM!

web/default/src/features/home/components/sections/hero.tsx (1)

231-231: LGTM!

web/default/src/features/models/components/models-columns.tsx (1)

80-94: LGTM!

Also applies to: 134-141, 153-153

web/default/src/components/language-switcher.tsx (1)

33-91: LGTM!

web/default/src/features/system-settings/components/settings-page.tsx (1)

22-23: LGTM!

Also applies to: 93-115, 135-135, 154-166

web/default/src/styles/index.css (1)

503-503: LGTM!

Also applies to: 801-801, 956-957, 1539-1539, 1597-1597, 1631-1631, 1699-1699, 1738-1738, 1948-1951

web/default/src/features/pricing/components/model-details-uptime-sparkline.tsx (2)

98-100: LGTM!


54-56: 🎯 Functional Correctness

bg-success/bg-warning are defined in the themeweb/default/src/styles/theme.css exposes --color-success and --color-warning, so these utilities are available.

			> Likely an incorrect or invalid review comment.
web/default/src/features/dashboard/components/overview/overview-query-utils.ts (1)

26-33: LGTM!

web/default/src/features/dashboard/components/overview/uptime-panel.tsx (1)

129-129: LGTM!

web/default/src/i18n/locales/en.json (1)

26-26: LGTM!

Also applies to: 42-55, 67-67, 111-111, 668-668, 710-710, 730-730, 1298-1298, 1356-1356, 1558-1558, 1596-1596, 1723-1723, 2129-2129, 2328-2328, 2796-2796, 2885-2885, 3246-3246, 3417-3417, 3625-3631, 3773-3773, 4039-4039, 4079-4079, 4650-4652

web/default/src/features/dashboard/components/overview/overview-dashboard.tsx (2)

126-188: LGTM!


560-829: LGTM!

Also applies to: 880-885, 893-896

web/default/src/i18n/locales/vi.json (1)

26-123: LGTM!

Also applies to: 123-320, 321-730, 731-2130, 2130-3049, 3049-4039, 4039-4952, 4952-5050

web/default/src/i18n/locales/zh.json (1)

26-26: LGTM!

Also applies to: 42-55, 67-67, 111-111, 668-668, 710-710, 730-730, 1298-1298, 1356-1356, 1558-1558, 1596-1596, 1708-1723, 2128-2129, 2328-2328, 2796-2796, 2885-2885, 3246-3246, 3395-3417, 3501-3501, 3625-3631, 3773-3773, 4039-4039, 4079-4079, 4650-4652

web/default/src/i18n/locales/fr.json (2)

49-49: 🎯 Functional Correctness | ⚡ Quick win

Untranslated strings left in English within fr.json.

Several changed entries keep the English source text as the French value instead of translating it, while the equivalent Chinese entries in zh.json are properly localized:

  • Line 49: "{{count}} tiered billing models enabled""{{count}} tiered billing models enabled".
  • Lines 311-313, 318: "AI model asset governance", "AI model governance · AgentOps", "AI model governance · AgentOps · Application infrastructure", "AI Models · Agents governance" — all copied verbatim from English, unlike neighboring keys that are translated.
  • Line 2438: "Keep governance ready""Keep governance ready".

These will render raw English in the French UI.

🌐 Suggested translations
-    "{{count}} tiered billing models enabled": "{{count}} tiered billing models enabled",
+    "{{count}} tiered billing models enabled": "{{count}} modèles de facturation par paliers activés",
-    "AI model asset governance": "AI model asset governance",
-    "AI model governance · AgentOps": "AI model governance · AgentOps",
-    "AI model governance · AgentOps · Application infrastructure": "AI model governance · AgentOps · Application infrastructure",
+    "AI model asset governance": "Gouvernance des actifs de modèles d'IA",
+    "AI model governance · AgentOps": "Gouvernance des modèles d'IA · AgentOps",
+    "AI model governance · AgentOps · Application infrastructure": "Gouvernance des modèles d'IA · AgentOps · Infrastructure applicative",
-    "AI Models · Agents governance": "AI Models · Agents governance",
+    "AI Models · Agents governance": "Gouvernance des modèles d'IA · Agents",
-    "Keep governance ready": "Keep governance ready",
+    "Keep governance ready": "Maintenir la gouvernance prête",

Also applies to: 311-313, 318-318, 2438-2438


42-48: LGTM!

Also applies to: 55-55, 67-67, 111-111, 122-122, 182-182, 280-281, 309-310, 314-317, 319-320, 600-600, 668-668, 710-710, 720-730, 821-821, 1165-1165, 1183-1183, 1209-1209, 1298-1298, 1356-1356, 1390-1390, 1558-1558, 1596-1596, 1708-1723, 1789-1793, 1903-1903, 2068-2069, 2129-2129, 2138-2141, 2328-2328, 2346-2346, 2405-2406, 2437-2437, 2439-2442, 2579-2579, 2592-2592, 2625-2625, 2697-2703, 2739-2741, 2796-2796, 2885-2885, 3049-3049, 3086-3086, 3182-3182, 3246-3246, 3417-3417, 3501-3501, 3529-3529, 3625-3631, 3668-3668, 3773-3773, 3914-3914, 3930-3930, 3943-3943, 4034-4039, 4079-4079, 4307-4312, 4483-4483, 4650-4652, 4662-4662, 4681-4681, 4824-4825, 4858-4858, 4897-4901, 4943-4952, 5034-5034, 5048-5049

web/default/src/features/system-settings/models/channel-selector-dialog.tsx (1)

146-153: LGTM!

web/default/src/features/channels/components/dialogs/codex-usage-dialog.tsx (1)

242-245: LGTM!

web/default/src/components/ui/dialog.tsx (1)

23-23: LGTM!

Also applies to: 67-68, 93-93

web/default/src/features/models/components/dialogs/upstream-conflict-dialog.tsx (1)

217-226: LGTM!

Also applies to: 301-314, 349-349

web/default/src/components/layout/components/public-header.tsx (1)

45-45: LGTM!

Also applies to: 195-203, 225-231, 312-330, 382-382

web/default/src/features/models/components/dialogs/prefill-group-management-dialog.tsx (1)

349-350: LGTM!

Also applies to: 467-470

web/default/src/features/channels/components/dialogs/ollama-models-dialog.tsx (1)

532-534: LGTM!

web/default/src/features/playground/lib/playground-option-utils.test.ts (1)

24-24: LGTM!

Also applies to: 76-81

web/default/src/features/playground/lib/playground-option-utils.ts (1)

21-23: LGTM!

web/default/src/components/layout/components/section-page-layout.tsx (1)

86-86: LGTM!

web/default/src/features/dashboard/components/ui/stat-card.tsx (1)

230-230: LGTM!

Also applies to: 239-239

web/default/src/features/dashboard/components/overview/summary-cards.tsx (1)

244-248: LGTM!

Also applies to: 294-294

web/default/src/features/dashboard/components/models/log-stat-cards.tsx (1)

125-125: LGTM!

Also applies to: 137-137, 146-146

web/default/src/features/dashboard/index.tsx (1)

20-21: LGTM!

Also applies to: 248-248, 306-306

web/default/src/features/playground/api.ts (1)

44-49: 🩺 Stability & Availability

Incorrect target for the undefined-group crash overview-dashboard.tsx calls web/default/src/lib/api.ts#getUserModels, not this helper. getModelQueryGroup() is only reached from usePlaygroundOptions() with a string currentGroup, so the undefined path here doesn’t apply.

			> Likely an incorrect or invalid review comment.
web/default/src/components/ui/empty.tsx (1)

79-79: LGTM!

web/default/src/tanstack-table.d.ts (1)

32-35: LGTM!

web/default/src/components/password-input.tsx (1)

21-21: LGTM!

Also applies to: 39-39, 57-57

web/default/src/components/ui/spinner.tsx (1)

21-21: LGTM!

Also applies to: 32-39

web/default/src/components/data-table/mobile-card-list.tsx (3)

127-129: LGTM!

Also applies to: 147-163, 186-187


196-198: LGTM!

Also applies to: 207-216, 242-243


314-314: LGTM!

web/default/src/components/data-table/data-table-page.tsx (2)

107-108: LGTM!

Also applies to: 228-238


347-347: LGTM!

Also applies to: 413-416

web/default/src/features/users/components/users-columns.tsx (1)

61-69: LGTM!

web/default/src/components/ui/titled-card.tsx (1)

74-74: LGTM!

web/default/src/components/ai-elements/conversation.tsx (1)

101-119: LGTM!

web/default/src/components/layout/components/header-tools-menu.tsx (1)

1-157: LGTM!

web/default/src/components/theme-switch.tsx (1)

28-67: LGTM!

Also applies to: 86-86

web/default/src/styles/theme-presets.css (1)

660-668: LGTM!

web/default/src/components/tag-input.tsx (1)

89-89: LGTM!

web/default/src/components/json-editor.tsx (2)

90-98: LGTM!


256-266: LGTM!

web/default/src/features/channels/components/drawers/channel-editor-navigation.tsx (1)

92-217: LGTM!

web/default/src/components/ui/pagination.tsx (1)

30-42: LGTM!

Also applies to: 90-155

web/default/src/features/channels/components/drawers/channel-editor-state.ts (1)

115-201: LGTM!

web/default/src/components/ui/markdown.tsx (1)

175-190: LGTM!

Also applies to: 769-805

web/default/src/features/channels/components/drawers/channel-mutate-drawer.tsx (1)

19-19: LGTM!

Also applies to: 170-197, 2923-2923

web/default/src/features/channels/components/dialogs/param-override-editor-dialog.tsx (1)

66-73: LGTM!

Also applies to: 1091-1128

web/default/src/components/layout/components/nav-group.tsx (1)

67-67: LGTM!

web/default/src/components/data-table/bulk-actions.tsx (2)

172-183: LGTM!


67-78: 🎯 Functional Correctness | ⚡ Quick win

Verify locale files supply plural forms for the new count-interpolated strings. All four new/changed t() calls pass count as an interpolation value; i18next's plural resolution requires _one/_other (and additional CLDR forms like _few/_many for Russian) suffixed keys per locale, or every count will render the same string.

  • web/default/src/components/data-table/bulk-actions.tsx#L67-L78: confirm en.json/ru.json/etc. define plural-suffixed keys for '{{count}} {{entity}} selected. Bulk actions toolbar is available.'.
  • web/default/src/components/data-table/bulk-actions.tsx#L165-L169: confirm plural forms exist for 'Bulk actions for {{count}} selected {{entity}}'.
  • web/default/src/components/data-table/bulk-actions.tsx#L220-L220: confirm plural forms exist for '{{count}} selected'.
  • web/default/src/features/system-settings/models/model-pricing-sheet.tsx#L970-L976: confirm plural forms exist for '{{count}} selected targets available for bulk copy.'.

Source: Coding guidelines

web/default/src/components/ui/sheet.tsx (1)

25-25: LGTM!

Also applies to: 68-69, 108-108

web/default/src/components/layout/components/footer.tsx (1)

263-269: LGTM!

Also applies to: 283-283

web/default/src/features/system-settings/models/model-pricing-sheet.tsx (1)

845-851: LGTM!

Also applies to: 1019-1036

web/default/src/components/ui/sidebar.tsx (1)

27-27: LGTM!

Also applies to: 185-185, 220-223, 282-282, 299-316

web/default/src/components/config-drawer.tsx (1)

67-77: LGTM!

Also applies to: 94-109, 148-164, 181-198

web/default/src/features/system-settings/components/settings-form-layout.tsx (1)

19-27: LGTM!

Also applies to: 44-52, 112-176

web/default/src/i18n/locales/_reports/_sync-report.json (1)

14-32: LGTM!

web/default/src/features/system-settings/models/tiered-pricing-fields.tsx (1)

55-116: LGTM!

web/default/src/features/channels/components/numeric-spinner-input.tsx (1)

46-46: LGTM!

Also applies to: 139-139, 181-181

web/default/src/components/datetime-picker.tsx (1)

66-67: LGTM!

Also applies to: 156-156

web/default/src/features/channels/components/channels-columns.tsx (1)

435-435: LGTM!

Also applies to: 450-450, 850-852

web/default/src/features/system-settings/models/tiered-pricing-support.tsx (1)

252-567: LGTM!

web/default/src/features/system-settings/models/tiered-pricing-editor.tsx (1)

81-92: LGTM!

Also applies to: 193-193, 291-294

web/default/src/features/system-settings/models/tiered-pricing-utils.ts (1)

20-26: 🎯 Functional Correctness

Remove the conversion concern
Both helpers are plain numeric normalization, and the tiered-pricing flow uses the same unit-cost values directly; no scaling factor is involved here.

			> Likely an incorrect or invalid review comment.
web/default/src/components/ui/carousel.tsx (1)

27-27: LGTM!

Also applies to: 196-221, 227-252

web/default/src/components/ui/breadcrumb.tsx (1)

27-41: LGTM!

Also applies to: 121-136

web/default/src/components/ai-elements/tool.tsx (1)

138-138: LGTM!

Also applies to: 175-175

web/default/src/features/keys/components/api-keys-columns.tsx (1)

77-93: LGTM!

web/default/src/components/layout/components/app-header.tsx (1)

29-29: LGTM!

Also applies to: 124-128, 143-149

web/default/src/components/layout/components/top-nav.tsx (1)

22-28: LGTM!

Also applies to: 42-43, 62-104

Comment thread web/default/src/components/data-table/data-table-page.tsx
Comment thread web/default/src/components/layout/components/public-header.tsx
Comment thread web/default/src/components/ui/command.tsx Outdated
Comment on lines 267 to 273
<span
data-slot='context-menu-shortcut'
className={cn(
'text-muted-foreground group-focus/context-menu-item:text-accent-foreground ml-auto text-xs tracking-widest',
'text-muted-foreground group-focus/context-menu-item:text-accent-foreground text-xsst ml-auto',
className
)}
{...props}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for any custom `@utility` definition matching text-xsst
rg -n 'text-xsst' --type css
rg -n '`@utility`\s+text-xsst' web/default/src/styles/

Repository: MAX-API-Next/MAX-API

Length of output: 213


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the affected component and search for any custom utility or matching Tailwind config/theme definitions.
sed -n '250,285p' web/default/src/components/ui/context-menu.tsx

printf '\n--- search: text-xsst ---\n'
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' 'text-xsst' .

printf '\n--- search: `@utility` text-xsst ---\n'
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' '`@utility`\s+text-xsst' web/default/src

printf '\n--- search: text-xs / tracking-widest around context-menu ---\n'
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' 'tracking-widest|text-xs' web/default/src/components/ui/context-menu.tsx web/default/src

Repository: MAX-API-Next/MAX-API

Length of output: 1571


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Check whether the apparent token "xsst" is defined anywhere in Tailwind/theme config.
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' '\bxsst\b|fontSize|theme\s*:\s*\{' web/default .

Repository: MAX-API-Next/MAX-API

Length of output: 5000


Fix the invalid text-xsst utility in menu shortcut stylestext-xsst isn’t a Tailwind utility, so ContextMenuShortcut falls back to inherited sizing. Use text-xs here; the same typo also appears in command.tsx, dropdown-menu.tsx, and menubar.tsx.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/default/src/components/ui/context-menu.tsx` around lines 267 - 273,
Replace the invalid text-xsst class with the valid text-xs utility in
ContextMenuShortcut, and apply the same correction to the corresponding shortcut
styles in command.tsx, dropdown-menu.tsx, and menubar.tsx.

Source: Linters/SAST tools

data-slot='dropdown-menu-shortcut'
className={cn(
'text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground ml-auto text-xs tracking-widest',
'text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground text-xsst ml-auto',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

text-xsst typo breaks shortcut styling in both DropdownMenuShortcut and MenubarShortcut.

Both files replaced text-xs tracking-widest with text-xsst, which is not a valid Tailwind v4 utility. Tailwind silently ignores unknown classes, so the shortcut span loses both its text-xs font-size and tracking-widest letter-spacing. The st suffix appears to be a remnant of tracking-widest from an editing accident.

  • web/default/src/components/ui/dropdown-menu.tsx#L283-L283: Restore text-xs tracking-widest in the DropdownMenuShortcut base className.
  • web/default/src/components/ui/menubar.tsx#L235-L235: Restore text-xs tracking-widest in the MenubarShortcut className override.
🔧 Proposed fix for both files

dropdown-menu.tsx:

-        'text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground text-xsst ml-auto',
+        'text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground text-xs tracking-widest ml-auto',

menubar.tsx:

-        'text-muted-foreground group-focus/menubar-item:text-accent-foreground text-xsst ml-auto',
+        'text-muted-foreground group-focus/menubar-item:text-accent-foreground text-xs tracking-widest ml-auto',
📝 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.

Suggested change
'text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground text-xsst ml-auto',
'text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground text-xs tracking-widest ml-auto',
📍 Affects 2 files
  • web/default/src/components/ui/dropdown-menu.tsx#L283-L283 (this comment)
  • web/default/src/components/ui/menubar.tsx#L235-L235
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/default/src/components/ui/dropdown-menu.tsx` at line 283, Replace the
invalid text-xsst utility with text-xs tracking-widest in DropdownMenuShortcut’s
base className in web/default/src/components/ui/dropdown-menu.tsx:283-283 and in
the MenubarShortcut className override in
web/default/src/components/ui/menubar.tsx:235-235.

Comment thread web/default/src/features/dashboard/components/overview/overview-dashboard.tsx Outdated
Comment on lines +28 to +42
export function formatTokenHint(
value: number | string | null | undefined
): string {
if (value == null || value === '' || Number.isNaN(Number(value))) return ''

const tokenCount = Number(value)
if (tokenCount === 0) return '= 0'
if (tokenCount >= 1_000_000) {
return `= ${(tokenCount / 1_000_000).toLocaleString()}M tokens`
}
if (tokenCount >= 1_000) {
return `= ${(tokenCount / 1_000).toLocaleString()}K tokens`
}
return `= ${tokenCount.toLocaleString()} tokens`
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Localize the hint text.

formatTokenHint returns user-visible strings ("= … tokens", M/K suffixes) rendered in the editor, but they are hardcoded English. Accept a t function so the copy is translatable.

As per coding guidelines: 前端页面文本与组件内文案必须支持 i18n.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/default/src/features/system-settings/models/tiered-pricing-utils.ts`
around lines 28 - 42, Update formatTokenHint to accept the established
translation function t and use it for the rendered token hint text, including
the singular text and M/K suffix labels. Update every call site to pass t while
preserving the existing empty-value and numeric formatting behavior.

Source: Coding guidelines

Comment thread web/default/src/i18n/locales/ja.json Outdated
"{{count}} override": "{{count}} 個のオーバーライド",
"{{count}} selected": "{{count}}件選択",
"{{count}} selected targets available for bulk copy.": "一括コピーに使用できる対象が {{count}} 個選択されています。",
"{{count}} tiered billing models enabled": "{{count}} tiered billing models enabled",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Untranslated string: "{{count}} tiered billing models enabled" left in English in both locales.
Both files add this key but reuse the raw English text as the translated value instead of localizing it, so Japanese and Russian users will see English text in the middle of an otherwise localized UI. Same root cause (missing translation), needs a real translation supplied in each file.

  • web/default/src/i18n/locales/ja.json#L49: replace the value with an actual Japanese translation of "{{count}} tiered billing models enabled".
  • web/default/src/i18n/locales/ru.json#L49: replace the value with an actual Russian translation of "{{count}} tiered billing models enabled".
📍 Affects 2 files
  • web/default/src/i18n/locales/ja.json#L49-L49 (this comment)
  • web/default/src/i18n/locales/ru.json#L49-L49
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/default/src/i18n/locales/ja.json` at line 49, Replace the English value
for "{{count}} tiered billing models enabled" with a proper Japanese translation
in web/default/src/i18n/locales/ja.json at lines 49-49 and a proper Russian
translation in web/default/src/i18n/locales/ru.json at lines 49-49, preserving
the {{count}} interpolation placeholder.

Comment thread web/default/src/i18n/locales/ja.json Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
web/default/src/i18n/locales/vi.json (1)

4021-4021: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Untranslated strings left in English for new tiered-billing keys.

Several newly added Vietnamese entries copy the English source verbatim instead of translating it: "Save tiered billing": "Save tiered billing", "Tiered Billing": "Tiered Billing", "Tiered billing configuration saved": "Tiered billing configuration saved", "Tiered billing JSON": "Tiered billing JSON". Since these are part of this PR's changed lines, they should be properly localized rather than left as English fallbacks.

Also applies to: 4624-4626

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/default/src/i18n/locales/vi.json` at line 4021, Translate the new
tiered-billing Vietnamese locale values instead of leaving the English source
text unchanged. Update the entries for “Save tiered billing,” “Tiered Billing,”
“Tiered billing configuration saved,” and “Tiered billing JSON” in the locale
data, preserving their existing keys and valid JSON structure.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@web/default/src/i18n/locales/vi.json`:
- Line 4021: Translate the new tiered-billing Vietnamese locale values instead
of leaving the English source text unchanged. Update the entries for “Save
tiered billing,” “Tiered Billing,” “Tiered billing configuration saved,” and
“Tiered billing JSON” in the locale data, preserving their existing keys and
valid JSON structure.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ebc456e2-d8b9-467a-84d7-4a4be57e6ad6

📥 Commits

Reviewing files that changed from the base of the PR and between b41523d and 40cbba4.

📒 Files selected for processing (22)
  • web/default/src/components/data-table/data-table-page.tsx
  • web/default/src/components/layout/components/public-header.tsx
  • web/default/src/components/ui/command.tsx
  • web/default/src/components/ui/context-menu.tsx
  • web/default/src/components/ui/dropdown-menu.tsx
  • web/default/src/components/ui/menubar.tsx
  • web/default/src/features/channels/api.ts
  • web/default/src/features/channels/components/dialogs/ollama-models-dialog.tsx
  • web/default/src/features/channels/components/dialogs/param-override-specialized-editor-utils.test.ts
  • web/default/src/features/channels/components/dialogs/param-override-specialized-editor-utils.ts
  • web/default/src/features/channels/components/dialogs/param-override-specialized-editors.tsx
  • web/default/src/features/dashboard/components/overview/overview-dashboard.tsx
  • web/default/src/features/dashboard/components/overview/overview-query-utils.test.ts
  • web/default/src/features/system-settings/models/tiered-pricing-editor.tsx
  • web/default/src/features/system-settings/models/tiered-pricing-utils.test.ts
  • web/default/src/features/system-settings/models/tiered-pricing-utils.ts
  • web/default/src/i18n/locales/en.json
  • web/default/src/i18n/locales/fr.json
  • web/default/src/i18n/locales/ja.json
  • web/default/src/i18n/locales/ru.json
  • web/default/src/i18n/locales/vi.json
  • web/default/src/i18n/locales/zh.json
📜 Review details
🧰 Additional context used
📓 Path-based instructions (3)
web/default/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (web/default/AGENTS.md)

web/default/src/**/*.{ts,tsx}: 前端页面文本与组件内文案必须支持 i18n:React 组件中应使用 useTranslation() 取得 t,并通过 t() 渲染用户可见文本;子组件也应自行使用 useTranslation() 保持独立性。
禁止使用两层及以上嵌套三元表达式;复杂逻辑应改用 if-else、提前返回或抽取函数。
控制函数圈复杂度,复杂逻辑应拆成更小的函数;变量与函数命名应有意义并遵循驼峰等常规命名约定。
TypeScript 代码应避免使用 any,优先使用具体类型或 unknown;参数与返回值应显式标注类型;仅类型用途的导入应使用 import type
修改 TypeScript 或 TSX 代码后必须执行类型检查,并修复所有类型错误,不得遗留。
对象非必要不要解构,尤其是组件 props;优先直接使用 props.xxx 以保持代码清晰。
组件应使用函数式组件与 Hooks,遵循单一职责;组件 props 必须有明确类型(接口或类型别名)。
单文件超过约 200 行时应考虑拆分子组件或抽取自定义 Hooks;类型定义可与组件同文件或放在同模块的 types 中。
在 React 中应合理使用 useMemouseCallbackReact.memo,避免在渲染路径中创建新对象或数组;必要时进行代码分割与动态 import
React Query 的数据获取应使用 useQuery、变更应使用 useMutation;每个查询需配置唯一 queryKey,并在成功后对相关查询执行 invalidateQueries;服务端错误应统一交给 handleServerError
Axios 请求应使用项目统一的 api 实例;GET 请求默认去重,特殊请求可显式关闭;认证与通用错误应在拦截器中统一处理。
服务端错误应统一使用 handleServerError,展示层应使用 toast.error 等统一方式;文案需走 i18n;路由级错误应由 errorComponent 承接;表单错误应通过 form.setError 等方式映射到字段。
样式应以 Tailwind 工具类为主,动态类名使用 cn() 合并;非动态场景避免内联样式;响应式采用移动优先与 Tailwind 断点,主题与暗色模式通过 CSS 变量与 dark: 处理。
应使用语义化 HTML、正确关联 label 与输入、保证键盘可操作与合理焦点顺序;必要时添加 ARIA 属性,装饰性图标应使用 aria-hidden="true"
认证与权限应在路由与接口层校验;前后端都应做数据校验(如 Zod);敏感信息不得落前端存储;避免使用 dangerouslySetInnerHTML;跨域与 Cookie 需配合 withCredentials 并按后端要求处理 CSRF。
组件测试应使用 React Testing Library,关注交互与行为,避免测试实现细节;关键流程可补充集成与 E2E 测试。
环境变量应通过 .env 读取,并使用 VITE_ 前缀;代码中不得硬编码密钥。

Files:

  • web/default/src/features/dashboard/components/overview/overview-query-utils.test.ts
  • web/default/src/features/channels/components/dialogs/param-override-specialized-editor-utils.test.ts
  • web/default/src/components/ui/menubar.tsx
  • web/default/src/features/system-settings/models/tiered-pricing-utils.test.ts
  • web/default/src/components/ui/dropdown-menu.tsx
  • web/default/src/components/ui/command.tsx
  • web/default/src/components/ui/context-menu.tsx
  • web/default/src/features/channels/components/dialogs/param-override-specialized-editor-utils.ts
  • web/default/src/features/system-settings/models/tiered-pricing-utils.ts
  • web/default/src/features/channels/api.ts
  • web/default/src/components/layout/components/public-header.tsx
  • web/default/src/features/channels/components/dialogs/param-override-specialized-editors.tsx
  • web/default/src/features/channels/components/dialogs/ollama-models-dialog.tsx
  • web/default/src/components/data-table/data-table-page.tsx
  • web/default/src/features/dashboard/components/overview/overview-dashboard.tsx
  • web/default/src/features/system-settings/models/tiered-pricing-editor.tsx
web/default/src/features/**

📄 CodeRabbit inference engine (web/default/AGENTS.md)

功能模块应放在 src/features/<feature>/,并按需包含 components/lib/hooks/api.tstypes.tsconstants.ts 等;通用组件应放在 src/components/,通用工具与类型应放在 src/lib/

Files:

  • web/default/src/features/dashboard/components/overview/overview-query-utils.test.ts
  • web/default/src/features/channels/components/dialogs/param-override-specialized-editor-utils.test.ts
  • web/default/src/features/system-settings/models/tiered-pricing-utils.test.ts
  • web/default/src/features/channels/components/dialogs/param-override-specialized-editor-utils.ts
  • web/default/src/features/system-settings/models/tiered-pricing-utils.ts
  • web/default/src/features/channels/api.ts
  • web/default/src/features/channels/components/dialogs/param-override-specialized-editors.tsx
  • web/default/src/features/channels/components/dialogs/ollama-models-dialog.tsx
  • web/default/src/features/dashboard/components/overview/overview-dashboard.tsx
  • web/default/src/features/system-settings/models/tiered-pricing-editor.tsx
web/default/src/**/*.test.ts

📄 CodeRabbit inference engine (web/default/AGENTS.md)

工具函数与纯逻辑应优先编写单元测试;测试文件应命名为 *.test.ts

Files:

  • web/default/src/features/dashboard/components/overview/overview-query-utils.test.ts
  • web/default/src/features/channels/components/dialogs/param-override-specialized-editor-utils.test.ts
  • web/default/src/features/system-settings/models/tiered-pricing-utils.test.ts
🔇 Additional comments (31)
web/default/src/features/dashboard/components/overview/overview-query-utils.test.ts (1)

1-49: LGTM!

web/default/src/components/ui/menubar.tsx (1)

227-241: LGTM!

web/default/src/components/ui/dropdown-menu.tsx (1)

275-289: LGTM!

web/default/src/components/ui/command.tsx (1)

193-207: LGTM!

web/default/src/components/ui/context-menu.tsx (1)

262-276: LGTM!

web/default/src/i18n/locales/fr.json (1)

2-5238: LGTM!

web/default/src/i18n/locales/ja.json (2)

15-17: LGTM! Both previously-flagged issues (untranslated tiered-billing string, broken {{msg}} placeholder) are resolved in this diff.

Also applies to: 52-52, 2745-2745


1892-1892: 🎯 Functional Correctness | ⚡ Quick win

Pre-existing broken interpolation placeholders (__ PH_0 __) remain, but out of scope for this diff.

Lines 1892 (Failed to parse JSON file: {{name}}), 2624 (MAX API <noreply@example.com>), and 2892 (Parsed {{count}} service account file(s)) still contain the literal placeholder artifact __ PH_0 __ instead of the real interpolation token. These are not marked as changed in this PR, so likely pre-existing from an earlier migration, but they will keep rendering literal garbage text to Japanese users.

Also applies to: 2624-2624, 2892-2892

web/default/src/features/channels/components/dialogs/param-override-specialized-editor-utils.test.ts (1)

26-50: LGTM!

web/default/src/features/channels/components/dialogs/param-override-specialized-editor-utils.ts (1)

31-65: LGTM!

web/default/src/features/channels/api.ts (1)

216-225: LGTM!

Also applies to: 504-518

web/default/src/components/layout/components/public-header.tsx (2)

124-133: LGTM!


324-342: LGTM!

web/default/src/features/channels/components/dialogs/param-override-specialized-editors.tsx (2)

512-663: LGTM!


687-867: LGTM!

web/default/src/features/channels/components/dialogs/ollama-models-dialog.tsx (2)

108-138: LGTM!


149-234: LGTM!

web/default/src/components/data-table/data-table-page.tsx (1)

254-277: LGTM!

web/default/src/features/dashboard/components/overview/overview-dashboard.tsx (5)

126-148: LGTM!


309-319: LGTM!


420-458: LGTM!


710-753: LGTM!

Also applies to: 790-842


600-635: 🩺 Stability & Availability

Server-side failures already surface as query errors. getDashboardQueryData() throws when response.success is false, so these queries enter isError and the retry UI still engages; no change needed.

			> Likely an incorrect or invalid review comment.
web/default/src/features/system-settings/models/tiered-pricing-utils.ts (1)

29-48: Localization fix applied — resolves prior review comment.

formatTokenHint now accepts t: TFunction and routes all rendered strings through it, addressing the previously flagged hardcoded-English issue.

web/default/src/features/system-settings/models/tiered-pricing-utils.test.ts (1)

1-52: LGTM!

web/default/src/i18n/locales/en.json (1)

15-17: LGTM!

web/default/src/features/system-settings/models/tiered-pricing-editor.tsx (2)

122-200: LGTM!


1005-1247: LGTM!

web/default/src/i18n/locales/zh.json (1)

15-17: LGTM!

web/default/src/i18n/locales/ru.json (1)

15-17: LGTM!

Also applies to: 29-29, 45-58, 70-70, 114-114, 125-125, 185-185, 277-292, 308-323, 332-332, 603-603, 671-713, 723-733, 783-783, 824-824, 1103-1104, 1168-1186, 1212-1212, 1301-1301, 1359-1359, 1393-1393, 1561-1561, 1599-1599, 1711-1726, 1792-1796, 1906-1906, 2071-2072, 2132-2132, 2141-2144, 2331-2331, 2349-2349, 2360-2364, 2408-2409, 2440-2445, 2537-2537, 2582-2582, 2595-2595, 2628-2628, 2700-2706, 2717-2717, 2742-2751, 2797-2799, 2888-2888, 3052-3052, 3089-3089, 3122-3123, 3185-3186, 3249-3249, 3398-3420, 3504-3504, 3532-3532, 3572-3572, 3581-3587, 3623-3634, 3670-3671, 3776-3776, 3848-3848, 3917-3917, 3933-3933, 3946-3949, 4021-4021, 4037-4042, 4080-4082, 4310-4315, 4486-4486, 4624-4626, 4653-4665, 4684-4684, 4827-4828, 4861-4861, 4900-4904, 4946-4955, 5037-5037, 5051-5052

web/default/src/i18n/locales/vi.json (1)

15-17: LGTM!

Also applies to: 29-58, 70-70, 114-114, 125-185, 283-323, 603-603, 671-733, 824-824, 1168-1212, 1393-1393, 1561-1599, 1712-1796, 1906-1906, 2071-2144, 2331-2409, 2440-2595, 2628-2751, 2799-2799, 2888-2888, 3052-3089, 3185-3249, 3396-3532, 3628-3671, 3776-3776, 3917-3933, 3946-3946, 4037-4082, 4310-4315, 4486-4486, 4653-4665, 4684-4684, 4827-4904, 4946-5052

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
web/default/src/i18n/locales/vi.json (1)

312-323: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Translate the remaining English entries in these updated groups.

AI Models · Agents governance at Line 321 and Keep governance ready at Line 2441 remain in English while neighboring entries were localized. Translate both strings to avoid mixed-language UI.

Also applies to: 2440-2445

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/default/src/i18n/locales/vi.json` around lines 312 - 323, Translate the
remaining English locale values for the keys “AI Models · Agents governance” and
“Keep governance ready” in vi.json, using natural Vietnamese consistent with the
surrounding governance-related entries. Leave already localized neighboring
entries unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@web/default/src/i18n/locales/vi.json`:
- Around line 312-323: Translate the remaining English locale values for the
keys “AI Models · Agents governance” and “Keep governance ready” in vi.json,
using natural Vietnamese consistent with the surrounding governance-related
entries. Leave already localized neighboring entries unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e60f7eca-0089-485c-bebe-df6e8d97a0e1

📥 Commits

Reviewing files that changed from the base of the PR and between 40cbba4 and 6603944.

📒 Files selected for processing (7)
  • README.en.md
  • README.fr.md
  • README.ja.md
  • README.md
  • README.zh_CN.md
  • README.zh_TW.md
  • web/default/src/i18n/locales/vi.json
📜 Review details
🧰 Additional context used
🪛 LanguageTool
README.md

[uncategorized] ~742-~742: 您的意思是“关"于"”吗?
Context: ... 开发。现阶段,MAX API 主要在上述项目基础上持续增强 AI API 网关与治理能力、扩展功能并修复问题。商业使用本项目时,还须分别遵守 One API 的...

(YU7_YU8)

README.zh_CN.md

[uncategorized] ~735-~735: 您的意思是“关"于"”吗?
Context: ... 开发。现阶段,MAX API 主要在上述项目基础上持续增强 AI API 网关与治理能力、扩展功能并修复问题。商业使用本项目时,还须分别遵守 One API 的...

(YU7_YU8)

🔇 Additional comments (2)
web/default/src/i18n/locales/vi.json (1)

15-17: LGTM!

Also applies to: 29-29, 45-58, 70-70, 114-114, 125-125, 185-185, 283-284, 603-603, 671-671, 713-713, 723-733, 824-824, 1168-1168, 1186-1186, 1212-1212, 1301-1301, 1359-1359, 1393-1393, 1561-1561, 1599-1599, 1726-1726, 1792-1796, 1906-1906, 2071-2072, 2132-2132, 2141-2144, 2331-2331, 2349-2349, 2582-2582, 2595-2595, 2628-2628, 2700-2706, 2742-2744, 2799-2799, 2888-2888, 3052-3052, 3089-3089, 3185-3185, 3249-3249, 3420-3420, 3504-3504, 3532-3532, 3628-3634, 3671-3671, 3776-3776, 3917-3917, 3933-3933, 3946-3946, 4021-4021, 4037-4042, 4082-4082, 4310-4315, 4486-4486, 4624-4626, 4653-4655, 4665-4665, 4684-4684, 4827-4828, 4861-4861, 4900-4904, 4946-4955, 5037-5037, 5051-5052

README.en.md (1)

735-735: 🔒 Security & Privacy

The fallback line only covers the project’s temporary commercial license; the preceding paragraph already preserves both upstream license obligations, so the MIT obligation is not dropped here.

			> Likely an incorrect or invalid review comment.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@relay/channel/claude/message_delta_usage_patch_test.go`:
- Line 110: Add a separate subtest in the existing usage patch tests covering a
zero-valued OutputTokens field, using CompletionTokens as the source and
asserting the patched OutputTokens value. Keep the existing non-zero
preservation test unchanged and exercise buildMessageDeltaPatchUsage directly.

In `@relay/channel/claude/relay-claude.go`:
- Around line 698-700: Update patchClaudeMessageDeltaUsageData to serialize the
populated usage.OutputTokens value into data at usage.output_tokens, ensuring
clients receive the patched output token count when the provider omitted it.
🪄 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: ASSERTIVE

Plan: Pro Plus

Run ID: d429b80c-38fd-468c-a18f-2f80e75d521a

📥 Commits

Reviewing files that changed from the base of the PR and between da3cbad and 6ac9078.

📒 Files selected for processing (3)
  • relay/channel/claude/message_delta_usage_patch_test.go
  • relay/channel/claude/relay-claude.go
  • relay/channel/claude/relay_claude_test.go
📜 Review details
🧰 Additional context used
📓 Path-based instructions (2)
**/*.go

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.go: In Go business code, all JSON marshal/unmarshal operations must use the wrapper functions in common/json.go (common.Marshal, common.Unmarshal, common.UnmarshalJsonStr, common.DecodeJson, common.GetJsonType) and must not directly call encoding/json for actual encode/decode work.
All database code must be compatible with SQLite, MySQL 5.7.8+, and PostgreSQL 9.6+; prefer GORM abstractions over raw SQL, avoid direct AUTO_INCREMENT/SERIAL, use commonGroupCol/commonKeyCol and commonTrueVal/commonFalseVal for DB-specific SQL, branch with common.UsingPostgreSQL/common.UsingSQLite/common.UsingMySQL, avoid unsupported DB-specific functions/operators without fallback, and make migrations work across all three databases.
When implementing a new relay channel, confirm whether the provider supports StreamOptions; if it does, add that channel to streamSupportedChannels.
For request structs parsed from client JSON and re-marshaled to upstream providers, optional scalar fields must use pointer types with omitempty so explicit zero/false values are preserved instead of dropped.
When working on tiered/dynamic billing expression code, read pkg/billingexpr/expr.md first and follow its documented expression language, architecture, token normalization, quota conversion, and versioning patterns.

**/*.go: All JSON marshal/unmarshal operations in Go business code must use the wrapper functions in common/json.go (common.Marshal, common.Unmarshal, common.UnmarshalJsonStr, common.DecodeJson, common.GetJsonType) instead of directly importing or calling encoding/json for actual marshal/unmarshal work.
All database code in Go must remain compatible with SQLite, MySQL >= 5.7.8, and PostgreSQL >= 9.6; prefer GORM abstractions, avoid raw SQL unless necessary, use the shared DB helper variables for reserved words and boolean literals, branch with the common.UsingPostgreSQL / common.UsingSQLite / common.UsingMySQL flags when need...

Files:

  • relay/channel/claude/relay-claude.go
  • relay/channel/claude/message_delta_usage_patch_test.go
  • relay/channel/claude/relay_claude_test.go
relay/channel/**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

When implementing a new channel, confirm whether the provider supports StreamOptions; if it does, add the channel to streamSupportedChannels.

Files:

  • relay/channel/claude/relay-claude.go
  • relay/channel/claude/message_delta_usage_patch_test.go
  • relay/channel/claude/relay_claude_test.go
🔇 Additional comments (1)
relay/channel/claude/relay_claude_test.go (1)

158-191: LGTM!

Comment thread relay/channel/claude/message_delta_usage_patch_test.go
Comment thread relay/channel/claude/relay-claude.go
@CSCITech
CSCITech merged commit 5c88bc9 into main Jul 15, 2026
3 checks passed
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.

1 participant