Skip to content

chore: update dependencies and TypeScript 7 toolchain - #1376

Merged
ding113 merged 1 commit into
devfrom
chore/typescript-7-latest-deps
Aug 1, 2026
Merged

chore: update dependencies and TypeScript 7 toolchain#1376
ding113 merged 1 commit into
devfrom
chore/typescript-7-latest-deps

Conversation

@ding113

@ding113 ding113 commented Aug 1, 2026

Copy link
Copy Markdown
Owner

变更摘要

  • 将项目直接依赖和开发工具链更新到当前最新版本, 包括 Next.js 16.2.12, React 19.2.8, Hono 4.12.33, Vitest 4.1.10, Biome 2.5.6, ioredis 6.0.0, MapLibre GL 6.1.0, undici 8.9.0 等.
  • 更新 TypeScript 7 工具链: @typescript/native-preview 升级到最新 TS7 native preview, 并安装稳定版 typescript@7.0.2 alias 用于独立兼容性验证.
  • 按 TypeScript 官方 side-by-side 建议保留 typescript@6.0.2 compiler API 包. TypeScript 7.0 不提供 JavaScript compiler API, 而最新版 openapi-typescript@7.13.0 仍依赖旧 compiler API; 直接替换会破坏 OpenAPI 生成工具链.
  • 仓库实际使用 Next.js + Hono, 不包含 NestJS 依赖、Nest CLI 配置或 Nest 应用入口, 因此没有可升级的 NestJS 组件, 也未引入无关框架.

兼容性修复

  • 适配 ioredis 6 收紧后的 sorted-set 参数类型.
  • 适配 MapLibre GL 6 的 named export 结构, 并同步测试 mock.
  • 适配 @lobehub/icons 5 中移除的 Stepfun.Color API.
  • 迁移 Biome 2.5 配置 schema 和 rule preset 字段.
  • 将 Vitest 配置迁移为 ESM .mts, 使用 configLoader=bundle, 消除 native config loader warning.
  • @lobehub/fluent-emoji 的 ESM directory import 增加测试环境 inline/noExternal 配置和轻量 mock.
  • 将 migration validator 改为 .mjs, 消除 Node MODULE_TYPELESS_PACKAGE_JSON warning.
  • 为 scoped coverage 配置补齐 timeout, 修复时间边界测试在默认 5 秒限制下的误超时.
  • 同步 CI、测试脚本、tsconfig 和测试文档中的新配置路径.

验证

  • bun run lint
  • bun run lint:fix
  • bun run format:check
  • bun run typecheck
  • ./node_modules/typescript-7/bin/tsc -p tsconfig.json --noEmit
  • bun run openapi:check
  • bun run openapi:lint
  • bun run validate:migrations
  • bun run test:coverage:quota: 11 files / 235 tests passed, coverage thresholds passed
  • bun run build: Next.js production build passed, 187 static pages generated
  • bun run test: 843 files passed, 2 skipped; 8172 tests passed, 13 skipped
  • git diff --check

已知非阻塞输出

  • Next.js build 仍会报告现有 Edge Runtime import trace warning, 主要来自 Node-only instrumentation、node:cryptonode:net. 构建成功, 且这些路径涉及既有 Node runtime contract, 本 PR 未做高风险运行时重构.
  • 未配置 DSN/Redis 的本地测试和构建会打印 fallback 日志; 这是测试环境缺少外部服务时的既有行为.
  • 全量测试仍包含预期错误路径日志、happy-dom/KaTeX/React fixture warning 和 event-listener warning, 但没有失败测试.
  • migration validator 对 4 个历史 migration 打印已豁免 warning; 118 个 migration 均通过幂等性检查.

其他说明

仓库明确忽略 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.

  • Migrates Vitest configuration and migration validation scripts to explicit ESM files.
  • Adapts Redis sorted-set calls, MapLibre imports, and vendor icon APIs.
  • Updates Biome configuration and test dependency handling.

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

Filename Overview
package.json Updates runtime and development dependencies, adds the TypeScript 7 alias, and migrates test and migration scripts to the new configuration paths.
tests/vitest.base.mts Converts the shared Vitest configuration to ESM and adds dependency transformation, aliases, and scoped timeout settings.
vitest.config.mts Converts the primary Vitest configuration to ESM and aligns dependency transformation with the shared configuration.
src/app/v1/_lib/proxy/affinity/affinity-store.ts Adapts a Redis ZRANGE call to ioredis 6’s tightened argument typing without changing Redis behavior.
src/lib/session-manager.ts Adapts provider-session ZRANGE pipeline arguments while preserving result handling.
src/lib/session-tracker.ts Consistently adapts active-session ZRANGE calls while preserving cleanup and pipeline indexing.
src/components/ui/map.tsx Migrates MapLibre GL usage from a default import to the v6 named namespace exports.
biome.json Migrates the Biome schema and rule preset fields to the 2.5 configuration format.

Reviews (1): Last reviewed commit: "chore: update dependencies and TypeScrip..." | Re-trigger Greptile

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Review Change Stack

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b8884304-9cad-4d49-98d7-135a6f1ae7c8

📥 Commits

Reviewing files that changed from the base of the PR and between fce24af and e9228ba.

📒 Files selected for processing (33)
  • .github/workflows/test.yml
  • biome.json
  • package.json
  • scripts/validate-migrations.mjs
  • src/app/v1/_lib/proxy/affinity/affinity-store.ts
  • src/components/ui/__tests__/map.test.tsx
  • src/components/ui/map.tsx
  • src/lib/model-vendor-icons.tsx
  • src/lib/public-status/vendor-icon.ts
  • src/lib/session-manager.ts
  • src/lib/session-tracker.ts
  • tests/README.md
  • tests/configs/codex-session-id-completer.config.mts
  • tests/configs/e2e.config.mts
  • tests/configs/include-session-id-in-errors.config.mts
  • tests/configs/integration.config.mts
  • tests/configs/logs-sessionid-time-filter.config.mts
  • tests/configs/my-usage.config.mts
  • tests/configs/provider-batch-ledger-postgres.config.mts
  • tests/configs/proxy-guard-pipeline.config.mts
  • tests/configs/public-status.integration.config.mts
  • tests/configs/quota.config.mts
  • tests/configs/session-binding.config.mts
  • tests/configs/thinking-effort-conflict-rectifier.config.mts
  • tests/configs/thinking-signature-rectifier.config.mts
  • tests/configs/usage-logs-sessionid-search.config.mts
  • tests/configs/v1.config.mts
  • tests/e2e/responses-ws-codex-cli-transport.test.ts
  • tests/fluent-emoji.mock.tsx
  • tests/tsconfig.provider-batch-ledger.json
  • tests/unit/lib/session-manager-terminate-provider-sessions.test.ts
  • tests/vitest.base.mts
  • vitest.config.mts

📝 Walkthrough

Walkthrough

本次变更更新测试工具链和依赖版本,迁移 Vitest 配置至 .mts,新增迁移校验脚本,并修正 Redis、地图和供应商图标的兼容性问题。

Changes

工具链与运行时维护

Layer / File(s) Summary
测试配置与依赖迁移
.github/workflows/test.yml, biome.json, package.json, tests/configs/*, tests/README.md, tests/e2e/..., tests/tsconfig.provider-batch-ledger.json, vitest.config.mts
更新测试脚本、依赖版本和 Biome 配置。测试配置导入、CI 命令、文档引用和 TypeScript 包含路径改用 .mts;迁移校验脚本改用 .mjs
Vitest 运行时与 Fluent Emoji mock
tests/fluent-emoji.mock.tsx, tests/vitest.base.mts, vitest.config.mts
新增 Fluent Emoji 测试组件、辅助函数和别名。Vitest 增加超时、慢测试、依赖内联及 SSR noExternal 配置。
迁移文件与 journal 校验
scripts/validate-migrations.mjs
新增 SQL 迁移幂等性检查和 Drizzle journal 校验,并根据校验结果输出问题和设置进程退出码。
Redis、地图与供应商图标兼容性
src/app/v1/_lib/proxy/affinity/affinity-store.ts, src/lib/session-manager.ts, src/lib/session-tracker.ts, tests/unit/lib/session-manager-terminate-provider-sessions.test.ts, src/components/ui/map.tsx, src/components/ui/__tests__/map.test.tsx, src/lib/model-vendor-icons.tsx, src/lib/public-status/vendor-icon.ts
将 Redis zrange 的范围参数改为字符串。地图组件改用命名空间导入并扩展 mock。stepfun 图标映射改用基础图标组件。

Estimated code review effort: 3 (Moderate) | ~30 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed 标题准确概括了依赖更新和 TypeScript 7 工具链升级,内容清晰且与主要变更一致。
Description check ✅ Passed 描述详细说明了依赖、工具链、兼容性修复和验证结果,与变更内容相关。
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 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/typescript-7-latest-deps

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.

@github-actions github-actions Bot added the size/XL Extra Large PR (> 1000 lines) label Aug 1, 2026
@ding113
ding113 merged commit 519c605 into dev Aug 1, 2026
10 of 13 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Claude Code Hub Roadmap Aug 1, 2026

@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: 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

📥 Commits

Reviewing files that changed from the base of the PR and between fce24af and e9228ba.

📒 Files selected for processing (33)
  • .github/workflows/test.yml
  • biome.json
  • package.json
  • scripts/validate-migrations.mjs
  • src/app/v1/_lib/proxy/affinity/affinity-store.ts
  • src/components/ui/__tests__/map.test.tsx
  • src/components/ui/map.tsx
  • src/lib/model-vendor-icons.tsx
  • src/lib/public-status/vendor-icon.ts
  • src/lib/session-manager.ts
  • src/lib/session-tracker.ts
  • tests/README.md
  • tests/configs/codex-session-id-completer.config.mts
  • tests/configs/e2e.config.mts
  • tests/configs/include-session-id-in-errors.config.mts
  • tests/configs/integration.config.mts
  • tests/configs/logs-sessionid-time-filter.config.mts
  • tests/configs/my-usage.config.mts
  • tests/configs/provider-batch-ledger-postgres.config.mts
  • tests/configs/proxy-guard-pipeline.config.mts
  • tests/configs/public-status.integration.config.mts
  • tests/configs/quota.config.mts
  • tests/configs/session-binding.config.mts
  • tests/configs/thinking-effort-conflict-rectifier.config.mts
  • tests/configs/thinking-signature-rectifier.config.mts
  • tests/configs/usage-logs-sessionid-search.config.mts
  • tests/configs/v1.config.mts
  • tests/e2e/responses-ws-codex-cli-transport.test.ts
  • tests/fluent-emoji.mock.tsx
  • tests/tsconfig.provider-batch-ledger.json
  • tests/unit/lib/session-manager-terminate-provider-sessions.test.ts
  • tests/vitest.base.mts
  • vitest.config.mts

Comment thread package.json
"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",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 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,并仅通过环境变量允许显式覆盖主机地址,保留端口配置。

Comment thread package.json
Comment on lines 51 to +150
"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"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 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.json

Repository: 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
done

Repository: ding113/claude-code-hub

Length of output: 13662


提交 Bun lockfile,并将 CI 安装改为冻结模式。

package.json 大量依赖使用版本范围,但仓库未提交 bun.lock/bun.lockb,当前 .github/workflows/test.ymldev.ymlrelease.ymlpr-check.ymlclaude-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.

@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

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

📥 Commits

Reviewing files that changed from the base of the PR and between fce24af and e9228ba.

📒 Files selected for processing (33)
  • .github/workflows/test.yml
  • biome.json
  • package.json
  • scripts/validate-migrations.mjs
  • src/app/v1/_lib/proxy/affinity/affinity-store.ts
  • src/components/ui/__tests__/map.test.tsx
  • src/components/ui/map.tsx
  • src/lib/model-vendor-icons.tsx
  • src/lib/public-status/vendor-icon.ts
  • src/lib/session-manager.ts
  • src/lib/session-tracker.ts
  • tests/README.md
  • tests/configs/codex-session-id-completer.config.mts
  • tests/configs/e2e.config.mts
  • tests/configs/include-session-id-in-errors.config.mts
  • tests/configs/integration.config.mts
  • tests/configs/logs-sessionid-time-filter.config.mts
  • tests/configs/my-usage.config.mts
  • tests/configs/provider-batch-ledger-postgres.config.mts
  • tests/configs/proxy-guard-pipeline.config.mts
  • tests/configs/public-status.integration.config.mts
  • tests/configs/quota.config.mts
  • tests/configs/session-binding.config.mts
  • tests/configs/thinking-effort-conflict-rectifier.config.mts
  • tests/configs/thinking-signature-rectifier.config.mts
  • tests/configs/usage-logs-sessionid-search.config.mts
  • tests/configs/v1.config.mts
  • tests/e2e/responses-ws-codex-cli-transport.test.ts
  • tests/fluent-emoji.mock.tsx
  • tests/tsconfig.provider-batch-ledger.json
  • tests/unit/lib/session-manager-terminate-provider-sessions.test.ts
  • tests/vitest.base.mts
  • vitest.config.mts
🛑 Comments failed to post (2)
scripts/validate-migrations.mjs (2)

82-130: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

修复 CREATE 语句的计数门控逻辑。

createTableRegexcreateIndexRegex 只匹配缺少 IF NOT EXISTS 的语句。对应的 *IfNotExistsRegex 只匹配合规语句。

如果同一文件同时有一个合规语句和一个不合规语句,两个数组长度相同。missingIfNotExistsTablesmissingIfNotExistsIndexes 会变为 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.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 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".

Comment thread vitest.config.mts
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";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

🧪 测试结果

测试类型 状态
代码质量
单元测试
集成测试
API 测试

总体结果: ✅ 所有测试通过

Comment thread package.json
"tailwind-merge": "^3.6.0",
"timeago.js": "^4.0.2",
"tw-animate-css": "^1.4.0",
"undici": "^8.9.0",

@github-actions github-actions Bot Aug 1, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[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

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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: Upgrading undici to ^8.9.0 causes Docker Build Test and dev-build-deploy to fail in bun run build with TypeError: ... markAsUncloneable is not a function during page-data collection for /v1/[...route] and /v1beta/[...route]. Restore the Bun-compatible undici 7.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

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review complete for PR #1376.

  • Applied the size/XL label.
  • Posted one validated inline Critical comment at package.json:124: upgrading undici to ^8.9.0 causes both Docker build workflows to fail with TypeError: ... markAsUncloneable is not a function while collecting /v1 and /v1beta route data.
  • Suggested restoring undici to the compatible ^7 line, or pinning a verified Bun-compatible 8.x release.
  • Posted the mandatory review summary with the XL split recommendation: separate dependency updates, Vitest/config migration, and source compatibility fixes.
  • Validation: unit, integration, API, code-quality, and type checks passed; Docker Build Test and dev-build-deploy failed.
  • No repository files were modified.

@github-actions github-actions Bot mentioned this pull request Aug 1, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XL Extra Large PR (> 1000 lines)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant