Commit Graph

706 Commits

Author SHA1 Message Date
Cita bafceb855b [codex] Add model tester fixed-channel selection (#352)
* feat: add model tester forced channel

* fix: keep codex websocket defaults and route refresh checks

* fix: scope tester-only forced channel overrides

* fix: keep tester hydration and websocket hints internal

* fix: reject gemini on legacy tester chat routes

* fix: harden forced channel selection edges
2026-04-01 12:56:13 +08:00
Cita 8c3be1a613 Add zod payload contracts for admin API routes (#358)
* Add zod route payload contracts for admin APIs

* Fix review follow-ups for zod admin payloads

* Refactor account payload parser helpers
2026-04-01 12:52:55 +08:00
nodca 6a55effd3b 修复 weighted 路由失败退避时间溢出导致服务崩溃 (#354)
* fix: cap token router cooldown backoff

* docs: explain token router cooldown cap
2026-04-01 12:29:05 +08:00
Cita 4096c757d4 [codex] fix anyrouter checkin session failure classification (#353)
* fix anyrouter checkin session failure classification

* fix auth failure classification review follow-up
2026-04-01 12:28:09 +08:00
Cita 6206c5bd77 fix(web): preserve both site-created next steps (#357) 2026-04-01 09:47:21 +08:00
Cita 0de9c5e3f1 [codex] add coding plan site initialization flow (#351)
* add coding plan site initialization flow

* fix ci for coding plan site init flow

* address coding plan review comments
2026-03-31 21:55:25 +08:00
Cita e74e11375c [codex] add route priority bucket editor (#350)
* feat: add route priority bucket editor

* fix: address route editor review comments
2026-03-31 21:23:02 +08:00
Cita baa11d7787 cache update center status snapshots (#349) 2026-03-31 20:47:02 +08:00
Cita d930b87762 [codex] Fix Anyrouter model sync shield handling (#348)
* fix anyrouter model sync shield handling

* fix shield challenge message precedence
2026-03-31 19:32:25 +08:00
Cita 87390651f4 fix: add searchable token account selectors (#347) 2026-03-31 19:13:07 +08:00
Cita 6b19d06140 [codex] fix empty stream success handling and unknown usage logs (#343)
* fix: preserve repeated short responses deltas

* fix empty stream success handling and unknown usage logs

* fix proxy usage metadata typing

* fix stream bookkeeping and explicit zero usage source

* fix sticky fast path and usage placeholder detection
2026-03-31 16:45:13 +08:00
Cita 3ce5179fed fix: detect latest digest updates in update center (#344) 2026-03-31 15:02:24 +08:00
rcocco e8921e63ce Fix orphaned responses tool outputs in messages fallback (#342) 2026-03-31 14:56:54 +08:00
Cita 6e04db61dd fix: wire site-created dialog cancel cleanup (#341) 2026-03-31 13:47:36 +08:00
Cita 618ca0b9bf fix: restore armv7 docker base image (#337) 2026-03-30 23:23:55 +08:00
Cita eb65a2be88 fix: preserve repeated short responses deltas (#336) 2026-03-30 22:54:05 +08:00
Cita 5d54e92dc6 docs: add management API guide (#334) 2026-03-30 22:53:33 +08:00
Cita 9e95819952 fix: decode zstd-compressed SSE proxy surfaces (#335)
* Fix zstd-compressed SSE decoding in proxy surfaces

* Fix stream/web type bridge for zstd SSE

* Guard zstd stream readers against decoded bodies

* Handle stacked zstd stream encodings
2026-03-30 22:46:31 +08:00
Cita 9eb33df6d4 [codex] add automatic update-center reminders (#333)
* add automatic update-center reminders

* fix update-center reminder review issues
2026-03-30 22:37:24 +08:00
Cita 26f9717ad7 [codex] add setting to disable cross-protocol fallback (#332)
* Add toggle to disable cross-protocol fallback

* Tighten runtime settings payload typing
2026-03-30 20:02:51 +08:00
Cita 6726da987f persist proxy trace panel state (#331) 2026-03-30 19:21:57 +08:00
Cita 9aeec87cfa chore: sweep dependabot updates and align Node 25 (#329)
* chore: sweep dependabot updates

* fix: narrow optional browser Buffer typing

* chore: align repo node pins to v25
2026-03-30 19:14:41 +08:00
Delicious233 9212b765cd feat: 新站点创建后显示选择对话框 (#302)
* feat: 实现全局模型白名单功能

## 功能概述
实现全局模型白名单,允许管理员配置只启用特定模型的路由,实现精细化的模型访问控制。

## 主要变更

### 后端实现
- config.ts: 新增 globalAllowedModels 配置项
- settings.ts:
  - 新增 RuntimeSettingsBody 类型支持
  - 实现数据库加载和持久化
  - 配置变更自动触发路由重建
- modelService.ts:
  - 在路由重建中添加白名单过滤逻辑
  - 大小写不敏感匹配,自动trim空格
  - 空白名单时允许所有模型(向后兼容)
- stats.ts:
  - 候选API过滤 models/modelsWithoutToken/modelsMissingTokenGroups

### 前端实现
- Settings.tsx:
  - 新增"全局模型白名单"配置卡片
  - 支持手动输入和点击选择两种添加方式
  - 绿色徽章显示已选模型,支持删除
  - 保存后自动触发路由重建

## 技术特性
- ✅ 向后兼容(默认为空数组,允许所有模型)
- ✅ 大小写不敏感匹配
- ✅ 自动trim和去重
- ✅ 输入验证(类型检查、空值过滤)
- ✅ 配置变更自动重建路由

## 测试验证
- 白名单为空时所有模型可见
- 白名单有值时只显示白名单模型
- 路由重建正确过滤模型
- 候选API正确返回过滤结果
- 前端UI交互正常

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat: 站点创建后显示选择对话框

新站点创建后不再根据平台类型自动跳转,而是显示一个选择对话框让用户决定下一步操作:
- 添加账号(用户名密码登录)
- 添加 API Key
- 稍后配置

对于 codex 平台,选择"添加账号"时会跳转到 OAuth 流程,其他平台则跳转到账号管理页面。

这样可以避免用户被强制跳转,提供更灵活的配置选择。

* fix: add getModelTokenCandidates mock to Settings tests

* fix: add getModelTokenCandidates mock to proxy-transport test

---------

Co-authored-by: Ding <ding@local>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-30 18:51:23 +08:00
Delicious233 fa25a501a8 feat: 实现全局模型白名单功能 (#301)
* feat: 实现全局模型白名单功能

## 功能概述
实现全局模型白名单,允许管理员配置只启用特定模型的路由,实现精细化的模型访问控制。

## 主要变更

### 后端实现
- config.ts: 新增 globalAllowedModels 配置项
- settings.ts:
  - 新增 RuntimeSettingsBody 类型支持
  - 实现数据库加载和持久化
  - 配置变更自动触发路由重建
- modelService.ts:
  - 在路由重建中添加白名单过滤逻辑
  - 大小写不敏感匹配,自动trim空格
  - 空白名单时允许所有模型(向后兼容)
- stats.ts:
  - 候选API过滤 models/modelsWithoutToken/modelsMissingTokenGroups

### 前端实现
- Settings.tsx:
  - 新增"全局模型白名单"配置卡片
  - 支持手动输入和点击选择两种添加方式
  - 绿色徽章显示已选模型,支持删除
  - 保存后自动触发路由重建

## 技术特性
- ✅ 向后兼容(默认为空数组,允许所有模型)
- ✅ 大小写不敏感匹配
- ✅ 自动trim和去重
- ✅ 输入验证(类型检查、空值过滤)
- ✅ 配置变更自动重建路由

## 测试验证
- 白名单为空时所有模型可见
- 白名单有值时只显示白名单模型
- 路由重建正确过滤模型
- 候选API正确返回过滤结果
- 前端UI交互正常

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: add getModelTokenCandidates mock to Settings tests

* fix: add getModelTokenCandidates mock to proxy-transport test

---------

Co-authored-by: Ding <ding@local>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-30 17:19:02 +08:00
Cita 01481be511 [codex] Add digest-safe k3s update-center assets (#326)
* Add digest-safe k3s update-center assets

* Harden k3s update-center assets

* Trim k3s env secret names safely
2026-03-30 17:17:24 +08:00
Cita 7d91823f6c Add site filters for manual connection selection (#328) 2026-03-30 16:32:48 +08:00
Cita 0d2c4501c2 make proxy trace panel collapsible (#327) 2026-03-30 16:32:26 +08:00
Cita 26d87db2cb [codex] tighten update center and proxy debug UX (#325)
* tighten update center and proxy debug UX

* Address update center review feedback
2026-03-30 13:39:20 +08:00
Cita 71be4cb63a Handle codex OAuth usage-limit cooldowns (#316)
* Handle codex oauth usage-limit cooldowns

* Generalize short-window 429 limit cooldowns

* Fan out short-window cooldowns by credential
2026-03-30 13:39:07 +08:00
Cita d47c3c4a29 Support digest-aware update center rollbacks (#318) 2026-03-29 22:16:39 +08:00
Cita b9ae85e98b Fix update center helper token lookup (#317) 2026-03-29 19:49:13 +08:00
cita-777 faf9874779 Fix armv7 docker helper build 2026-03-29 17:57:41 +08:00
Cita 11583c51b9 [codex] add K3s update center (#314)
* add k3s update center

* fix update center status timeouts

* Polish update center settings UI

* Document k3s update center

* Refocus update center docs for users

* Clarify k3s migration path in docs
2026-03-29 17:43:49 +08:00
Cita dcfd45ea65 Fix proxy debug trace truncation previews (#313) 2026-03-29 15:08:37 +08:00
Cita 7092e2f129 [codex] refine proxy logs debug UI follow-ups (#312)
* Refine proxy logs debug page layout

* Align proxy logs debug UI with page patterns

* Prevent proxy trace detail refresh flicker

* Polish proxy trace detail modal
2026-03-29 13:39:25 +08:00
Cita ab8640c8c3 [daily] reset oauth proxy form after start (#311) 2026-03-29 13:37:40 +08:00
Cita ed44e7f925 Refine proxy logs debug trace UI (#309) 2026-03-29 11:50:16 +08:00
Cita 03ca1154a0 Add OAuth account proxy controls (#307)
* Add oauth account proxy controls

* Refine oauth proxy review fixes

* Fix oauth clear-proxy exchange fallback
2026-03-29 00:35:45 +08:00
Cita 785ee93505 fix gemini oauth validation site proxy (#298) 2026-03-28 20:06:20 +08:00
Cita 4d4684a39b [codex] add proxy debug tracing (#299)
* add proxy debug tracing

* fix proxy debug response header typing

* extend proxy debug tracing to side paths

* Refine proxy debug trace review fixes

* Stabilize proxy debug attempt indexing

* Tighten proxy debug trace accuracy
2026-03-28 20:05:48 +08:00
Sean Lee 3bf3cd1622 feat: 新增路由批量禁用/启用功能 (#295)
* feat: Preserve manual models during discovery and refresh, and add Claude configuration files and project documentation.feat: Preserve manual models during discovery and refresh, and add Claude configuration and project documentation files.

* fix: fix Feishu and Larksuite webhook support to the notification service with updated UI and tests.

* feat: 新增路由批量禁用/启用功能

- 后端新增 POST /api/routes/batch 接口,支持批量 enable/disable
- 前端新增批量操作模式,支持 checkbox 选择路由
- 浮动操作栏显示选中数量,支持全选/取消全选
- 批量操作完成后自动退出选择模式并刷新列表

* fix: complete route batch actions on mobile

---------

Co-authored-by: Xiang Li <xiangli>
Co-authored-by: cita-777 <juricek.chen@gmail.com>
2026-03-28 16:54:09 +08:00
Cita 5ae452ab45 [codex] inherit site proxy settings for oauth (#296)
* test: define oauth proxy inheritance behavior

* feat: apply site proxy settings to oauth requests

* feat: backfill oauth provider sites at startup

* test: remove oauth site registry temp dir
2026-03-28 16:38:39 +08:00
apple 40b8eddef8 chore: remove committed local debug artifacts 2026-03-26 21:59:48 +08:00
Cita 8ebfc39745 [codex] add harness engineering guardrails (#284)
* refactor: add harness engineering guardrails

* fix: address harness review feedback

---------

Co-authored-by: apple <apple@appledeMacBook-Pro.local>
2026-03-26 21:22:36 +08:00
Cita b3387dfba7 [codex] fix cross-database JSON boundary handling (#283)
* fix: normalize cross-database json boundaries

* fix: address json boundary review comments

---------

Co-authored-by: apple <apple@appledeMacBook-Pro.local>
2026-03-26 20:21:19 +08:00
Cita 7e1fb8eb1b [codex] HTTP-first Codex upstream websocket settings (#280)
* http-first codex upstream websocket settings

* address websocket runtime review comments

---------

Co-authored-by: apple <apple@appledeMacBook-Pro.local>
2026-03-25 21:01:01 +08:00
Cita 5d2596285b fix: truncate collapsed route group regex badge (#279)
Co-authored-by: apple <apple@appledeMacBook-Pro.local>
2026-03-25 20:37:53 +08:00
Cita 639c387532 [codex] fix responses lifecycle parity and codex session serialization (#278)
* fix responses lifecycle parity

* remove websocket test debug logging

* fix responses proxy stream typecheck

* update compact upstream response expectations

* add community and deepwiki badges

* update linuxdo banner link

* fix responses review follow-ups

* preserve whitespace in responses terminal deltas

* fix responses stream reconciliation edges

* fix responses lifecycle parity and codex session serialization

* fix review follow-up edge cases

---------

Co-authored-by: apple <apple@appledeMacBook-Pro.local>
2026-03-25 18:56:36 +08:00
Sean Lee 9ba4369a83 fix: auto-detect Feishu webhook format and validate response body (#271)
* feat: Preserve manual models during discovery and refresh, and add Claude configuration files and project documentation.feat: Preserve manual models during discovery and refresh, and add Claude configuration and project documentation files.

* fix: fix Feishu and Larksuite webhook support to the notification service with updated UI and tests.

---------

Co-authored-by: Xiang Li <xiangli>
2026-03-25 18:30:32 +08:00
ZhengYiTao dc40edf8e8 fix: case-insensitive model merging and disabled model matching (#251)
* fix: MySQL-compatible case-insensitive model merge and disabled model matching

Root cause: MySQL uses utf8mb4_general_ci collation by default, making the
unique index on (account_id, model_name) case-insensitive. When different
tokens discover the same model with different casing (e.g., 'GPT-4o' vs
'gpt-4o'), the case-sensitive JavaScript Set allowed both, but the MySQL
batch INSERT failed with a duplicate key error — causing the entire model
refresh to silently fail and leaving stale routes (including disabled models).

Fixes:
1. mergeDiscoveredModels: change Set<string> to Map<lowercase, original>
   for cross-scan dedup, matching normalizeModels' existing behavior.
2. isModelDisabledForSite: compare with toLowerCase() so disabled models
   are filtered regardless of case variants across discovery sources.
3. tokens.ts /api/routes/rebuild: add missing await on
   rebuildTokenRoutesFromAvailability() so errors propagate correctly
   instead of being silently swallowed.

* fix: add missing await on rebuildTokenRoutesFromAvailability in stats.ts

The POST handler for /api/models/check/:accountId called
rebuildTokenRoutesFromAvailability() without await, returning a Promise
object in the response instead of the actual rebuild result.
2026-03-25 11:22:37 +08:00