Skip to content

Master - #5509

Closed
tianyeruci wants to merge 11 commits into
QuantumNous:mainfrom
tianyeruci:master
Closed

Master#5509
tianyeruci wants to merge 11 commits into
QuantumNous:mainfrom
tianyeruci:master

Conversation

@tianyeruci

@tianyeruci tianyeruci commented Jun 15, 2026

Copy link
Copy Markdown

⚠️ 提交说明 / 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

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

Summary by CodeRabbit

Release Notes

  • New Features

    • Added CC Switch one-click import functionality. Users can now import tokens directly into CC Switch (Codex/Claude Code) with target and model selection.
    • New import dialog displays available targets and searchable model list with recommended options.
  • Infrastructure

    • Added Docker Compose configuration for local development setup.
    • Added PowerShell automation scripts for development workflow management on Windows.
  • Localization

    • Updated translations across multiple languages for new import features.
  • Bug Fixes

    • Fixed Go 1.26 compatibility in Docker build configuration.

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

Walkthrough

该 PR 新增 CC Switch 导入的后端接口、模型缓存、默认与经典前端导入弹窗和入口,补充测试、本地脚本与 Docker 配置,并同步加入大量 Codex 规则包、维护文档、需求/审查记录及 Demo/SQL 参考文档。

Changes

CC Switch 导入与仓库规则更新

Layer / File(s) Summary
规则包与维护文档基线
AGENTS.md, .agents/*, README.md, USAGE_GUIDE.md, examples/USAGE_GUIDE.md, docs/codex/*, docs/project-map.md, docs/how-to-read.md, docs/change-log.md, docs/changes/*, OLDAGENTS.md
仓库入口规则被重写为中文 Codex 规则包,并新增任务流程、计划、审查、token、维护文档、项目上下文、风险、变更索引与审查报告等文档。
本地运行与检查脚本
scripts/codex-check.ps1, scripts/windows/project.ps1, docker-compose.local.yml, Dockerfile, docs/local-code-change-preview.md, docs/windows-docker-development.md, .playwright-cli/*
新增通用检查脚本和 Windows Docker 管理脚本,补充本地 Compose 环境与运行说明,并将 Docker Go 构建实验参数切换为 nogreenteagc
后端导入接口与模型缓存
dto/ccswitch.go, service/ccswitch_import.go, service/ccswitch_model_cache.go, service/ccswitch_model_cache_test.go, controller/ccswitch_import.go, controller/token_test.go, router/api-router.go, model/model_meta.go, main.go
后端新增 CC Switch 导入选项与导入链接接口、用户可用模型缓存与定时刷新、模型与厂商元数据读取,以及对应路由、启动接线和测试覆盖。
默认前端导入弹窗与行操作
web/default/src/features/keys/*, web/default/src/i18n/*
默认前端改为通过 tokenId 请求导入选项和生成导入链接,重写 CC Switch 导入弹窗、更新列表行操作与上下文状态,并补充类型、静态 i18n 键和多语言文案。
经典前端导入弹窗与列表入口
web/classic/src/components/table/tokens/*, web/classic/src/hooks/tokens/*, web/classic/src/i18n/*, web/classic/src/components/layout/Footer.jsx
经典前端新增导入按钮并改为基于 tokenId 的服务端导入流程,重写弹窗的目标/模型选择和提交逻辑,同步调整页脚与多语言文案。
需求文档、Demo 与 Schema 参考
docs/ccswitch-import-requirements-html-demo/*
新增 CC Switch 导入需求文档、执行计划、静态与交互 HTML Demo,以及 MySQL/PostgreSQL/SQLite 的 schema 参考与说明文档。

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant Frontend
  participant Backend
  participant Cache
  participant CCSwitch

  User->>Frontend: 点击“导入”
  Frontend->>Backend: GET import-options
  Backend->>Cache: 获取用户可用模型
  Cache-->>Backend: 返回模型列表
  Backend-->>Frontend: token/targets/models
  User->>Frontend: 选择目标与模型
  Frontend->>Backend: POST import-link
  Backend-->>Frontend: ccswitch:// 导入链接
  Frontend->>CCSwitch: 跳转到 deep link
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Possibly related PRs

  • QuantumNous/new-api#5346: 同样修改了 web/default/src/features/keys/components/dialogs/cc-switch-dialog.tsx,本 PR 在该对话框上继续改为基于后端 import-options / import-link 的流程。

Suggested reviewers

  • Calcium-Ion
  • seefs001

Poem

小兔捧着令牌跑,
轻点一键进洞道。
模型排好队,链接弯弯跳,
文档也把路标悄悄造。
🐇✨ 今日变更,青草味正好。

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch master

@tianyeruci

Copy link
Copy Markdown
Author

1

@tianyeruci tianyeruci closed this Jun 15, 2026
@tianyeruci
tianyeruci deleted the master branch June 15, 2026 06:14
@tianyeruci
tianyeruci restored the master branch June 21, 2026 16:31
@tianyeruci
tianyeruci deleted the master branch June 21, 2026 16:36
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