chore: update dependencies and TypeScript 7 toolchain - #1376
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (33)
📝 WalkthroughWalkthrough本次变更更新测试工具链和依赖版本,迁移 Vitest 配置至 Changes工具链与运行时维护
Estimated code review effort: 3 (Moderate) | ~30 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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: 4
🧹 Nitpick comments (1)
tests/fluent-emoji.mock.tsx (1)
22-22: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win移除
tests/fluent-emoji.mock.tsx的默认导出。
@lobehub/fluent-emoji使用命名导出的FluentEmoji;当前 mock 也已导出命名组件,export default FluentEmoji不需要也不符合项目的命名导出偏好。保留命名导出即可删除tests/fluent-emoji.mock.tsx:22。🤖 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 `@tests/fluent-emoji.mock.tsx` at line 22, Remove the default export from the FluentEmoji mock module and retain only the existing named FluentEmoji export, matching the package’s named-export usage and project convention.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 `@package.json`:
- Line 40: 更新 package.json 中的 cui 脚本:移除硬编码访问令牌,改为从环境变量读取;将主机默认设为
127.0.0.1,并仅通过环境变量允许显式覆盖主机地址,保留端口配置。
- Around line 51-150: Generate and commit the Bun lockfile for the dependencies
in package.json, then update the bun install commands in the CI workflows
test.yml, dev.yml, release.yml, pr-check.yml, and claude-ci-autofix.yml to use
frozen-lockfile mode. Ensure all CI jobs install exactly from the committed
lockfile.
In `@scripts/validate-migrations.mjs`:
- Around line 205-208: Update the empty-files branch in the migration validation
flow to report the missing migration files as an error and exit with a nonzero
status. Preserve the existing warning or message context, but do not allow
files.length === 0 to return success or skip journal validation.
- Around line 82-130: Update the CREATE TABLE and CREATE INDEX validation in the
migration checker to match all statements with optional IF NOT EXISTS clauses
and inspect each match directly. Remove the separate count-based gates and
*IfNotExistsRegex array comparisons, while preserving issue reporting only for
matches lacking IF NOT EXISTS.
---
Nitpick comments:
In `@tests/fluent-emoji.mock.tsx`:
- Line 22: Remove the default export from the FluentEmoji mock module and retain
only the existing named FluentEmoji export, matching the package’s named-export
usage and project convention.
🪄 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 Plus
Run ID: b8884304-9cad-4d49-98d7-135a6f1ae7c8
📒 Files selected for processing (33)
.github/workflows/test.ymlbiome.jsonpackage.jsonscripts/validate-migrations.mjssrc/app/v1/_lib/proxy/affinity/affinity-store.tssrc/components/ui/__tests__/map.test.tsxsrc/components/ui/map.tsxsrc/lib/model-vendor-icons.tsxsrc/lib/public-status/vendor-icon.tssrc/lib/session-manager.tssrc/lib/session-tracker.tstests/README.mdtests/configs/codex-session-id-completer.config.mtstests/configs/e2e.config.mtstests/configs/include-session-id-in-errors.config.mtstests/configs/integration.config.mtstests/configs/logs-sessionid-time-filter.config.mtstests/configs/my-usage.config.mtstests/configs/provider-batch-ledger-postgres.config.mtstests/configs/proxy-guard-pipeline.config.mtstests/configs/public-status.integration.config.mtstests/configs/quota.config.mtstests/configs/session-binding.config.mtstests/configs/thinking-effort-conflict-rectifier.config.mtstests/configs/thinking-signature-rectifier.config.mtstests/configs/usage-logs-sessionid-search.config.mtstests/configs/v1.config.mtstests/e2e/responses-ws-codex-cli-transport.test.tstests/fluent-emoji.mock.tsxtests/tsconfig.provider-batch-ledger.jsontests/unit/lib/session-manager-terminate-provider-sessions.test.tstests/vitest.base.mtsvitest.config.mts
| "openapi:generate": "bun scripts/generate-v1-types.ts", | ||
| "openapi:check": "bun scripts/generate-v1-types.ts --check", | ||
| "openapi:lint": "bun scripts/lint-openapi.ts", | ||
| "cui": "npx cui-server --host 0.0.0.0 --port 30000 --token a7564bc8882aa9a2d25d8b4ea6ea1e2e", |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
不要公开固定的 CUI 访问令牌。
Line 40 将服务绑定到 0.0.0.0,并在仓库中公开令牌。能够访问该端口的任意客户端都可以使用此令牌。
从环境变量读取令牌。默认绑定到 127.0.0.1。仅在明确需要远程访问时允许覆盖主机地址。
🤖 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 `@package.json` at line 40, 更新 package.json 中的 cui
脚本:移除硬编码访问令牌,改为从环境变量读取;将主机默认设为 127.0.0.1,并仅通过环境变量允许显式覆盖主机地址,保留端口配置。
| "dependencies": { | ||
| "@bull-board/api": "^7", | ||
| "@bull-board/express": "^7", | ||
| "@bull-board/api": "^8.5.0", | ||
| "@bull-board/express": "^8.5.0", | ||
| "@dnd-kit/core": "^6.3.1", | ||
| "@dnd-kit/sortable": "^10.0.0", | ||
| "@dnd-kit/utilities": "^3.2.2", | ||
| "@hono/swagger-ui": "^0.6", | ||
| "@hono/zod-openapi": "^1", | ||
| "@hookform/resolvers": "^5", | ||
| "@iarna/toml": "^2", | ||
| "@langfuse/client": "^5", | ||
| "@langfuse/otel": "^5", | ||
| "@langfuse/tracing": "^5", | ||
| "@lobehub/icons": "^2", | ||
| "@opentelemetry/sdk-node": "^0.217", | ||
| "@radix-ui/react-alert-dialog": "^1", | ||
| "@radix-ui/react-avatar": "^1", | ||
| "@radix-ui/react-checkbox": "^1", | ||
| "@radix-ui/react-collapsible": "^1", | ||
| "@radix-ui/react-dialog": "^1", | ||
| "@radix-ui/react-dropdown-menu": "^2", | ||
| "@radix-ui/react-label": "^2", | ||
| "@radix-ui/react-popover": "^1", | ||
| "@radix-ui/react-progress": "^1", | ||
| "@radix-ui/react-scroll-area": "^1", | ||
| "@radix-ui/react-select": "^2", | ||
| "@radix-ui/react-slider": "^1", | ||
| "@radix-ui/react-slot": "^1", | ||
| "@radix-ui/react-switch": "^1", | ||
| "@radix-ui/react-tabs": "^1", | ||
| "@radix-ui/react-tooltip": "^1", | ||
| "@scalar/hono-api-reference": "^0.10", | ||
| "@tanstack/react-query": "^5", | ||
| "@tanstack/react-virtual": "^3", | ||
| "@tanstack/virtual-core": "^3", | ||
| "agentation": "^3", | ||
| "antd": "~6.3", | ||
| "bull": "^4", | ||
| "class-variance-authority": "^0.7", | ||
| "clsx": "^2", | ||
| "cmdk": "^1", | ||
| "date-fns": "4.1.0", | ||
| "date-fns-tz": "^3", | ||
| "decimal.js-light": "^2", | ||
| "dotenv": "^17", | ||
| "drizzle-orm": "^0.45", | ||
| "fetch-socks": "^1", | ||
| "fflate": "^0.8.2", | ||
| "framer-motion": "^12", | ||
| "hono": "^4", | ||
| "html2canvas": "^1", | ||
| "ioredis": "^5", | ||
| "jspdf": "^4", | ||
| "lucide-react": "^1.8.0", | ||
| "maplibre-gl": "^5.23.0", | ||
| "next": "^16", | ||
| "next-intl": "^4", | ||
| "next-themes": "^0.4", | ||
| "pino": "^10", | ||
| "pino-pretty": "^13", | ||
| "postgres": "^3", | ||
| "react": "^19", | ||
| "react-day-picker": "^10", | ||
| "react-dom": "^19", | ||
| "react-hook-form": "^7", | ||
| "react-syntax-highlighter": "^16", | ||
| "recharts": "^3", | ||
| "safe-regex": "^2", | ||
| "@hono/swagger-ui": "^0.6.1", | ||
| "@hono/zod-openapi": "^1.5.1", | ||
| "@hookform/resolvers": "^5.6.0", | ||
| "@iarna/toml": "^2.2.5", | ||
| "@langfuse/client": "^5.10.0", | ||
| "@langfuse/otel": "^5.10.0", | ||
| "@langfuse/tracing": "^5.10.0", | ||
| "@lobehub/icons": "^5.15.0", | ||
| "@opentelemetry/sdk-node": "^0.221.0", | ||
| "@radix-ui/react-alert-dialog": "^1.1.23", | ||
| "@radix-ui/react-avatar": "^1.2.6", | ||
| "@radix-ui/react-checkbox": "^1.3.11", | ||
| "@radix-ui/react-collapsible": "^1.1.20", | ||
| "@radix-ui/react-dialog": "^1.1.23", | ||
| "@radix-ui/react-dropdown-menu": "^2.1.24", | ||
| "@radix-ui/react-label": "^2.1.15", | ||
| "@radix-ui/react-popover": "^1.1.23", | ||
| "@radix-ui/react-progress": "^1.1.16", | ||
| "@radix-ui/react-scroll-area": "^1.2.18", | ||
| "@radix-ui/react-select": "^2.3.7", | ||
| "@radix-ui/react-slider": "^1.4.7", | ||
| "@radix-ui/react-slot": "^1.3.3", | ||
| "@radix-ui/react-switch": "^1.3.7", | ||
| "@radix-ui/react-tabs": "^1.1.21", | ||
| "@radix-ui/react-tooltip": "^1.2.16", | ||
| "@scalar/hono-api-reference": "^0.11.12", | ||
| "@tanstack/react-query": "^5.101.4", | ||
| "@tanstack/react-virtual": "^3.14.9", | ||
| "@tanstack/virtual-core": "^3.17.7", | ||
| "agentation": "^3.0.2", | ||
| "antd": "~6.5.3", | ||
| "bull": "^4.16.5", | ||
| "class-variance-authority": "^0.7.1", | ||
| "clsx": "^2.1.1", | ||
| "cmdk": "^1.1.1", | ||
| "date-fns": "4.4.0", | ||
| "date-fns-tz": "^3.2.0", | ||
| "decimal.js-light": "^2.5.1", | ||
| "dotenv": "^17.4.2", | ||
| "drizzle-orm": "^0.45.2", | ||
| "fetch-socks": "^1.3.3", | ||
| "fflate": "^0.8.3", | ||
| "framer-motion": "^12.43.0", | ||
| "hono": "^4.12.33", | ||
| "html2canvas": "^1.4.1", | ||
| "ioredis": "^6.0.0", | ||
| "jspdf": "^4.2.1", | ||
| "lucide-react": "^1.28.0", | ||
| "maplibre-gl": "^6.1.0", | ||
| "next": "^16.2.12", | ||
| "next-intl": "^4.13.4", | ||
| "next-themes": "^0.4.6", | ||
| "pino": "^10.3.1", | ||
| "pino-pretty": "^13.1.3", | ||
| "postgres": "^3.4.9", | ||
| "react": "^19.2.8", | ||
| "react-day-picker": "^10.0.1", | ||
| "react-dom": "^19.2.8", | ||
| "react-hook-form": "^7.84.0", | ||
| "react-syntax-highlighter": "^16.1.1", | ||
| "recharts": "^3.10.1", | ||
| "safe-regex": "^2.1.1", | ||
| "server-only": "^0.0.1", | ||
| "sonner": "^2", | ||
| "tailwind-merge": "^3", | ||
| "timeago.js": "^4", | ||
| "tw-animate-css": "^1", | ||
| "undici": "^7", | ||
| "vaul": "^1", | ||
| "ws": "^8", | ||
| "zod": "^4" | ||
| "sonner": "^2.0.7", | ||
| "tailwind-merge": "^3.6.0", | ||
| "timeago.js": "^4.0.2", | ||
| "tw-animate-css": "^1.4.0", | ||
| "undici": "^8.9.0", | ||
| "vaul": "^1.1.2", | ||
| "ws": "^8.21.1", | ||
| "zod": "^4.4.3" | ||
| }, | ||
| "devDependencies": { | ||
| "@biomejs/biome": "^2", | ||
| "@tailwindcss/postcss": "^4.2.0", | ||
| "@biomejs/biome": "^2.5.6", | ||
| "@tailwindcss/postcss": "^4.3.3", | ||
| "@types/geojson": "^7946.0.16", | ||
| "@types/ioredis": "^5", | ||
| "@types/node": "^25", | ||
| "@types/pg": "^8", | ||
| "@types/react": "^19", | ||
| "@types/react-dom": "^19", | ||
| "@types/react-syntax-highlighter": "^15", | ||
| "@types/ws": "^8", | ||
| "@typescript/native-preview": "7.0.0-dev.20260512.1", | ||
| "@vitest/coverage-v8": "^4", | ||
| "@vitest/ui": "^4", | ||
| "bun-types": "^1", | ||
| "drizzle-kit": "^0.31", | ||
| "happy-dom": "^20", | ||
| "@types/ioredis": "^5.0.0", | ||
| "@types/node": "^26.1.2", | ||
| "@types/pg": "^8.20.3", | ||
| "@types/react": "^19.2.18", | ||
| "@types/react-dom": "^19.2.4", | ||
| "@types/react-syntax-highlighter": "^15.5.13", | ||
| "@types/ws": "^8.18.1", | ||
| "@typescript/native-preview": "7.0.0-dev.20260707.2", | ||
| "@vitest/coverage-v8": "^4.1.10", | ||
| "@vitest/ui": "^4.1.10", | ||
| "bun-types": "^1.3.14", | ||
| "drizzle-kit": "^0.31.10", | ||
| "happy-dom": "^20.11.1", | ||
| "openapi-typescript": "^7.13.0", | ||
| "tailwindcss": "^4", | ||
| "typescript": "^6", | ||
| "vitest": "^4" | ||
| "tailwindcss": "^4.3.3", | ||
| "typescript": "6.0.2", | ||
| "typescript-7": "npm:typescript@7.0.2", | ||
| "vitest": "^4.1.10" |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Tracked Bun lockfiles:"
git ls-files | rg '(^|/)(bun\.lock|bun\.lockb)$' || true
echo "Bun install commands in workflows and package scripts:"
rg -n -C 2 'bun install|frozen-lockfile' .github package.jsonRepository: ding113/claude-code-hub
Length of output: 2914
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo ".github workflow files:"
git ls-files .github/workflows | sort
echo "All tracked lockfiles:"
git ls-files | rg '(^|/)(package-lock\.json|yarn\.lock|pnpm-lock\.yaml|bun\.lock|bun\.lockb|Gemfile\.lock|poetry\.lock|uv\.lock)$' || true
echo "Bun lockfile-related comments:"
rg -n -C 1 'lockfile|Bun lock|bun\.lock|No lockfile|frozen-lockfile|frozen' .github package.json || true
echo "package scripts around install/lint/test/typecheck:"
python3 - <<'PY'
import pathlib, json
p=pathlib.Path('package.json')
data=json.loads(p.read_text())
for k,v in data.get('scripts',{}).items():
if any(s in k or any(x in str(v).lower() for x in ['install','typecheck','test','lint','format']) for s in ['install','script']):
print(f"{k}: {v}")
PY
echo "Top workflow install entries with surrounding context:"
for f in .github/workflows/*.yml .github/workflows/*.yaml; do
[ -e "$f" ] || continue
echo "--- $f"
rg -n -C 3 'bun (install|update)|bun add|bunx|setup-bun|frozen-lockfile' "$f" || true
doneRepository: ding113/claude-code-hub
Length of output: 13662
提交 Bun lockfile,并将 CI 安装改为冻结模式。
package.json 大量依赖使用版本范围,但仓库未提交 bun.lock/bun.lockb,当前 .github/workflows/test.yml、dev.yml、release.yml、pr-check.yml、claude-ci-autofix.yml 均执行 bun install。生成并提交 bun.lock;没有冻结 lockfile 时 CI 会解析不同的依赖树,验证结果无法稳定复现。提交 lockfile 后将这些 CI 安装命令改为冻结模式。
🤖 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 `@package.json` around lines 51 - 150, Generate and commit the Bun lockfile for
the dependencies in package.json, then update the bun install commands in the CI
workflows test.yml, dev.yml, release.yml, pr-check.yml, and
claude-ci-autofix.yml to use frozen-lockfile mode. Ensure all CI jobs install
exactly from the committed lockfile.
There was a problem hiding this comment.
Caution
Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
Actionable comments posted: 4
🧹 Nitpick comments (1)
tests/fluent-emoji.mock.tsx (1)
22-22: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win移除
tests/fluent-emoji.mock.tsx的默认导出。
@lobehub/fluent-emoji使用命名导出的FluentEmoji;当前 mock 也已导出命名组件,export default FluentEmoji不需要也不符合项目的命名导出偏好。保留命名导出即可删除tests/fluent-emoji.mock.tsx:22。🤖 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 `@tests/fluent-emoji.mock.tsx` at line 22, Remove the default export from the FluentEmoji mock module and retain only the existing named FluentEmoji export, matching the package’s named-export usage and project convention.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 `@package.json`:
- Line 40: 更新 package.json 中的 cui 脚本:移除硬编码访问令牌,改为从环境变量读取;将主机默认设为
127.0.0.1,并仅通过环境变量允许显式覆盖主机地址,保留端口配置。
- Around line 51-150: Generate and commit the Bun lockfile for the dependencies
in package.json, then update the bun install commands in the CI workflows
test.yml, dev.yml, release.yml, pr-check.yml, and claude-ci-autofix.yml to use
frozen-lockfile mode. Ensure all CI jobs install exactly from the committed
lockfile.
In `@scripts/validate-migrations.mjs`:
- Around line 205-208: Update the empty-files branch in the migration validation
flow to report the missing migration files as an error and exit with a nonzero
status. Preserve the existing warning or message context, but do not allow
files.length === 0 to return success or skip journal validation.
- Around line 82-130: Update the CREATE TABLE and CREATE INDEX validation in the
migration checker to match all statements with optional IF NOT EXISTS clauses
and inspect each match directly. Remove the separate count-based gates and
*IfNotExistsRegex array comparisons, while preserving issue reporting only for
matches lacking IF NOT EXISTS.
---
Nitpick comments:
In `@tests/fluent-emoji.mock.tsx`:
- Line 22: Remove the default export from the FluentEmoji mock module and retain
only the existing named FluentEmoji export, matching the package’s named-export
usage and project convention.
🪄 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 Plus
Run ID: b8884304-9cad-4d49-98d7-135a6f1ae7c8
📒 Files selected for processing (33)
.github/workflows/test.ymlbiome.jsonpackage.jsonscripts/validate-migrations.mjssrc/app/v1/_lib/proxy/affinity/affinity-store.tssrc/components/ui/__tests__/map.test.tsxsrc/components/ui/map.tsxsrc/lib/model-vendor-icons.tsxsrc/lib/public-status/vendor-icon.tssrc/lib/session-manager.tssrc/lib/session-tracker.tstests/README.mdtests/configs/codex-session-id-completer.config.mtstests/configs/e2e.config.mtstests/configs/include-session-id-in-errors.config.mtstests/configs/integration.config.mtstests/configs/logs-sessionid-time-filter.config.mtstests/configs/my-usage.config.mtstests/configs/provider-batch-ledger-postgres.config.mtstests/configs/proxy-guard-pipeline.config.mtstests/configs/public-status.integration.config.mtstests/configs/quota.config.mtstests/configs/session-binding.config.mtstests/configs/thinking-effort-conflict-rectifier.config.mtstests/configs/thinking-signature-rectifier.config.mtstests/configs/usage-logs-sessionid-search.config.mtstests/configs/v1.config.mtstests/e2e/responses-ws-codex-cli-transport.test.tstests/fluent-emoji.mock.tsxtests/tsconfig.provider-batch-ledger.jsontests/unit/lib/session-manager-terminate-provider-sessions.test.tstests/vitest.base.mtsvitest.config.mts
🛑 Comments failed to post (2)
scripts/validate-migrations.mjs (2)
82-130: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
修复
CREATE语句的计数门控逻辑。
createTableRegex和createIndexRegex只匹配缺少IF NOT EXISTS的语句。对应的*IfNotExistsRegex只匹配合规语句。如果同一文件同时有一个合规语句和一个不合规语句,两个数组长度相同。
missingIfNotExistsTables或missingIfNotExistsIndexes会变为0,脚本会跳过不合规语句并以成功状态结束。直接遍历包含可选
IF NOT EXISTS的全部匹配项。不要使用两个数组的长度差作为门控条件。建议修复
- const createTableRegex = /CREATE\s+TABLE\s+"[^"]+"/gi; - const createTableIfNotExistsRegex = /CREATE\s+TABLE\s+IF\s+NOT\s+EXISTS\s+"[^"]+"/gi; + const createTableRegex = + /CREATE\s+TABLE\s+(?:IF\s+NOT\s+EXISTS\s+)?"[^"]+"/gi; const createTables = content.match(createTableRegex) || []; - const createTablesIfNotExists = content.match(createTableIfNotExistsRegex) || []; - - const missingIfNotExistsTables = createTables.length - createTablesIfNotExists.length; - - if (missingIfNotExistsTables > 0) { - createTables.forEach((match) => { + createTables.forEach((match) => { if (!/IF\s+NOT\s+EXISTS/i.test(match)) { // ... } - }); - } + }); - const createIndexRegex = /CREATE\s+(?:UNIQUE\s+)?INDEX\s+"[^"]+"/gi; - const createIndexIfNotExistsRegex = - /CREATE\s+(?:UNIQUE\s+)?INDEX\s+IF\s+NOT\s+EXISTS\s+"[^"]+"/gi; + const createIndexRegex = + /CREATE\s+(?:UNIQUE\s+)?INDEX\s+(?:IF\s+NOT\s+EXISTS\s+)?"[^"]+"/gi; const createIndexes = content.match(createIndexRegex) || []; - const createIndexesIfNotExists = content.match(createIndexIfNotExistsRegex) || []; - - const missingIfNotExistsIndexes = createIndexes.length - createIndexesIfNotExists.length; - - if (missingIfNotExistsIndexes > 0) { - createIndexes.forEach((match) => { + createIndexes.forEach((match) => { if (!/IF\s+NOT\s+EXISTS/i.test(match)) { // ... } - }); - } + });📝 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.// 检查 CREATE TABLE 语句 const createTableRegex = /CREATE\s+TABLE\s+(?:IF\s+NOT\s+EXISTS\s+)?"[^"]+"/gi; const createTables = content.match(createTableRegex) || []; createTables.forEach((match) => { if (!/IF\s+NOT\s+EXISTS/i.test(match)) { const lineNumber = lines.findIndex((line) => line.includes(match.split('"')[1])) + 1; issues.push({ type: "CREATE TABLE", line: lineNumber, statement: match, suggestion: match.replace(/CREATE\s+TABLE\s+/i, "CREATE TABLE IF NOT EXISTS "), }); } }); // 检查 CREATE INDEX 语句 const createIndexRegex = /CREATE\s+(?:UNIQUE\s+)?INDEX\s+(?:IF\s+NOT\s+EXISTS\s+)?"[^"]+"/gi; const createIndexes = content.match(createIndexRegex) || []; createIndexes.forEach((match) => { if (!/IF\s+NOT\s+EXISTS/i.test(match)) { const lineNumber = lines.findIndex((line) => line.includes(match)) + 1; issues.push({ type: "CREATE INDEX", line: lineNumber, statement: match, suggestion: match.replace( /CREATE\s+(UNIQUE\s+)?INDEX\s+/i, "CREATE $1INDEX IF NOT EXISTS " ), }); } });🤖 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 `@scripts/validate-migrations.mjs` around lines 82 - 130, Update the CREATE TABLE and CREATE INDEX validation in the migration checker to match all statements with optional IF NOT EXISTS clauses and inspect each match directly. Remove the separate count-based gates and *IfNotExistsRegex array comparisons, while preserving issue reporting only for matches lacking IF NOT EXISTS.
205-208: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
空迁移集必须使校验失败。
EXEMPT_FILES表明此仓库应包含已编号的历史迁移。当前代码在没有发现任何 SQL 文件时返回状态码0,并跳过 journal 校验。如果迁移文件被删除或文件名不再匹配过滤规则,CI 会错误通过。对此仓库,将该状态报告为错误并以非零状态退出。
🤖 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 `@scripts/validate-migrations.mjs` around lines 205 - 208, Update the empty-files branch in the migration validation flow to report the missing migration files as an error and exit with a nonzero status. Preserve the existing warning or message context, but do not allow files.length === 0 to return success or skip journal validation.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e9228ba117
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| import { availableParallelism } from "node:os"; | ||
| import { defineConfig } from "vitest/config"; | ||
| import { parsePositiveInt, parseWorkerLimit, sharedResolve } from "./tests/vitest.base"; | ||
| import { parsePositiveInt, parseWorkerLimit, sharedResolve } from "./tests/vitest.base.mts"; |
There was a problem hiding this comment.
Include the renamed Vitest config in typechecking
After converting this file to .mts, bun run typecheck no longer checks it because tsconfig.json still includes only the root pattern *.config.ts. Consequently, invalid Vitest option types or incompatible helper calls in this config can pass the required pre-commit typecheck, while the bundled config loader strips the types rather than validating them; add *.config.mts to the TypeScript include list.
AGENTS.md reference: AGENTS.md:L15-L21
Useful? React with 👍 / 👎.
🧪 测试结果
总体结果: ✅ 所有测试通过 |
| "tailwind-merge": "^3.6.0", | ||
| "timeago.js": "^4.0.2", | ||
| "tw-animate-css": "^1.4.0", | ||
| "undici": "^8.9.0", |
There was a problem hiding this comment.
[CRITICAL] [LOGIC-BUG] undici 8 breaks the production build\n\nWhy this is a problem: src/app/v1/_lib/proxy/forwarder.ts:5, src/app/v1/_lib/models/available-models.ts:2, and src/app/v1/_lib/gemini/auth.ts:1 import undici on the /v1 and /v1beta route graph. After this bump, both Docker Build Test and dev-build-deploy fail during bun run build with TypeError: ... markAsUncloneable is not a function while collecting page data for /v1/[...route] and /v1beta/[...route]. That makes the PR non-deployable. It also violates the exact project requirement: Before committing, always run: bun run build # Production build.\n\nSuggested fix:\njson\n"undici": "^7"\n\nIf you need 8.x, please pin a Bun-compatible version only after verifying bun run build succeeds in CI and locally.\n\nConfidence: 100/100
There was a problem hiding this comment.
Code Review Summary
This dependency/toolchain upgrade introduces a production-blocking compatibility regression: both Docker build workflows fail during bun run build while loading the /v1 and /v1beta route graphs. The focused unit, integration, API, and quality checks pass, but the failed production builds mean the PR is not deployable until the undici runtime compatibility issue is resolved.
PR Size: XL
- Lines changed: 346 (199 additions + 147 deletions)
- Files changed: 33
- Split suggestion: Separate the dependency-version updates from the Vitest/configuration migration and from the source compatibility fixes. This would make the failing runtime dependency change independently bisectable.
Issues Found
| Category | Critical | High | Medium | Low |
|---|---|---|---|---|
| Logic/Bugs | 1 | 0 | 0 | 0 |
| Security | 0 | 0 | 0 | 0 |
| Error Handling | 0 | 0 | 0 | 0 |
| Types | 0 | 0 | 0 | 0 |
| Comments/Docs | 0 | 0 | 0 | 0 |
| Tests | 0 | 0 | 0 | 0 |
| Simplification | 0 | 0 | 0 | 0 |
Critical Issues (Must Fix)
- 100/100 —
package.json:124: Upgradingundicito^8.9.0causesDocker Build Testanddev-build-deployto fail inbun run buildwithTypeError: ... markAsUncloneable is not a functionduring page-data collection for/v1/[...route]and/v1beta/[...route]. Restore the Bun-compatibleundici7.x line or use a verified compatible 8.x release.
High Priority Issues (Should Fix)
- None.
Review Coverage
- Logic and correctness
- Security (OWASP Top 10)
- Error handling
- Type safety
- Documentation accuracy
- Test coverage
- Code clarity
Automated review by Codex AI
There was a problem hiding this comment.
Review complete for PR #1376.
- Applied the
size/XLlabel. - Posted one validated inline Critical comment at
package.json:124: upgradingundicito^8.9.0causes both Docker build workflows to fail withTypeError: ... markAsUncloneable is not a functionwhile collecting/v1and/v1betaroute data. - Suggested restoring
undicito the compatible^7line, or pinning a verified Bun-compatible 8.x release. - Posted the mandatory review summary with the
XLsplit recommendation: separate dependency updates, Vitest/config migration, and source compatibility fixes. - Validation: unit, integration, API, code-quality, and type checks passed;
Docker Build Testanddev-build-deployfailed. - No repository files were modified.
变更摘要
@typescript/native-preview升级到最新 TS7 native preview, 并安装稳定版typescript@7.0.2alias 用于独立兼容性验证.typescript@6.0.2compiler API 包. TypeScript 7.0 不提供 JavaScript compiler API, 而最新版openapi-typescript@7.13.0仍依赖旧 compiler API; 直接替换会破坏 OpenAPI 生成工具链.兼容性修复
@lobehub/icons5 中移除的Stepfun.ColorAPI..mts, 使用configLoader=bundle, 消除 native config loader warning.@lobehub/fluent-emoji的 ESM directory import 增加测试环境 inline/noExternal 配置和轻量 mock..mjs, 消除 NodeMODULE_TYPELESS_PACKAGE_JSONwarning.验证
bun run lintbun run lint:fixbun run format:checkbun run typecheck./node_modules/typescript-7/bin/tsc -p tsconfig.json --noEmitbun run openapi:checkbun run openapi:lintbun run validate:migrationsbun run test:coverage:quota: 11 files / 235 tests passed, coverage thresholds passedbun run build: Next.js production build passed, 187 static pages generatedbun run test: 843 files passed, 2 skipped; 8172 tests passed, 13 skippedgit diff --check已知非阻塞输出
node:crypto和node:net. 构建成功, 且这些路径涉及既有 Node runtime contract, 本 PR 未做高风险运行时重构.其他说明
仓库明确忽略
bun.lock/bun.lockb, CI 也采用无 lockfile 安装策略, 因此本 PR 不提交本地生成的 Bun lockfile.Greptile Summary
This PR updates the application and development dependencies, introduces side-by-side TypeScript 6/7 tooling, and applies compatibility changes for the upgraded packages.
Confidence Score: 5/5
The PR appears safe to merge based on the reviewed dependency adaptations, configuration migrations, and available compatibility evidence.
No concrete changed-code path was found that causes a build, runtime, data-integrity, or security failure; the Redis changes preserve protocol behavior and the test configuration migration is internally consistent.
Important Files Changed
Reviews (1): Last reviewed commit: "chore: update dependencies and TypeScrip..." | Re-trigger Greptile