Wesley Liddick
e002fbb349
Merge pull request #4508 from wucm667/fix/model-not-found-transient-misclassification
...
fix: 临时账号耗尽时保留 503 错误分类
2026-07-18 20:41:35 +08:00
Wesley Liddick
005bc5c8d4
Merge pull request #4497 from heathermhuang/agent/fix-grok-media-fallback-4471
...
fix(grok): fail closed for ineligible OAuth media
2026-07-18 20:41:24 +08:00
Wesley Liddick
bc4bd118d8
Merge pull request #4547 from heathermhuang/codex/fix-model-scoped-temp-cooldown-4527
...
fix(routing): isolate temporary cooldowns by model
2026-07-18 20:41:12 +08:00
Wesley Liddick
f3925db11b
Merge pull request #4496 from StarryKira/agent/fix-4470-pool-temp-unschedulable
...
fix: honor temp unschedulable rules in pool mode
2026-07-18 20:40:12 +08:00
Wesley Liddick
f9a467a4c0
Merge pull request #4520 from StarryKira/codex/fix-4487
...
fix: report Chat Completions stream transport failures
2026-07-18 20:39:49 +08:00
Wesley Liddick
8ce9288a6a
Merge pull request #4489 from fengshao1227/fix/grok-free-cache-tool-injection
...
fix(grok): 纯客户端函数工具不再注入原生搜索工具
2026-07-18 20:39:37 +08:00
Wesley Liddick
c1e702be5e
Merge pull request #4505 from cyhhao/fix/claude-1m-model-suffix
...
fix(gateway): normalize Claude Code 1m model suffix
2026-07-18 20:39:27 +08:00
haruka and Claude Opus 4.8
37db8d031b
fix(config): 让环境变量能真正配置 image_storage 等凭证
...
viper.Unmarshal 只解码 AllKeys() 返回的键,而 AllKeys() 只汇总 SetDefault、
配置文件和显式 BindEnv 三个来源。AutomaticEnv 仅能覆盖已在其中的键,无法引入
新键;能兜底的 viper_bind_struct 又被 build tag 排除(我们只用 -tags embed)。
因此任何「没有注册默认值、且不在 config.yaml 里」的配置项,其环境变量会被静默
丢弃。image_storage 的 endpoint/bucket/access_key_id/secret_access_key/
public_base_url 正属此列,于是纯环境变量部署落到最坏组合:IMAGE_STORAGE_ENABLED
生效使 Enabled=true,四个凭证却为空 → Active()=false → 异步生图接口整体 404,
运维看到的却是"凭证不完整"。deploy/docker-compose.yml 默认就是纯环境变量驱动,
且自动生成的 config.yaml 从不写 image_storage 段,必然踩中(见 #4458、#4542)。
同类缺口不止于此:github_oauth、google_oauth、dingtalk_connect 三组第三方登录
配置(含 client_secret)同样完全无法用环境变量设置。
- 为这些键注册零值默认,使其进入 AllKeys() 而可被环境变量覆盖。零值与"键缺失"
时的解码结果一致,故行为不变。
- sticky_escape_enabled 例外:它的实际默认是 true(靠 IsSet 守卫在解码后补上),
注册 false 会让 IsSet 恒真而永久关闭该特性,故直接注册 true。
- 启动告警补上 missing_keys 字段,指明到底哪个凭证为空。
- 新增反射守卫测试:Config 结构体上每个可由环境变量表达的字段都必须已注册默认值。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
Claude-Session: https://claude.ai/code/session_01VHreE5pzCkSYz7J45fmd2Y
2026-07-18 05:24:32 -07:00
王鹏
f0e0b7e6d8
fix(openai-ws): enforce passthrough turn lifecycle
2026-07-18 19:17:53 +08:00
Heatherm Huang
4c845ca697
test(grok): sanitize security fixtures
2026-07-18 17:50:53 +08:00
Heatherm Huang
95d27f2dce
fix(grok): fetch validated signed video content
2026-07-18 17:49:09 +08:00
Heatherm Huang
f2e7a55703
fix(grok): proxy signed video status URLs
2026-07-18 17:21:53 +08:00
Heatherm Huang
b4ad7fd363
test(grok): configure multipart media mapping
2026-07-18 15:49:21 +08:00
Heatherm Huang
ef2a22be70
fix(routing): isolate temporary cooldowns by model
2026-07-18 15:35:30 +08:00
Heatherm Huang
c831bb979f
fix(grok): scope video content to request owner
2026-07-18 14:56:15 +08:00
Heatherm Huang
3edcbfd120
fix(grok): keep media content proxy URLs same-origin
2026-07-18 14:43:08 +08:00
wucm667
1db10dc559
fix(subscription): renew expired admin assignments
2026-07-18 14:42:22 +08:00
Vz7797
3f6b5c7bd7
fix(grok): proxy protected video content through upstream account
...
(cherry picked from commit a01177e294 )
2026-07-18 14:37:25 +08:00
Heatherm Huang
335edde9c8
fix(grok): apply account model mapping to media
2026-07-18 14:21:47 +08:00
mark-ly-wang
1a855d3e0e
fix(monitor): extract anthropic text blocks
...
(cherry picked from commit 76cf1ee834 )
2026-07-18 13:53:36 +08:00
shaw
539bfc8bad
feat(security): 敏感操作 step-up 2FA 开关化,安全开关默认关闭
...
新增系统设置 step_up_enabled(默认关闭),把敏感操作 2FA 门控做成可开关;
同时将会话 IP/UA 绑定默认值从开启改为关闭,避免用户因 IP 变动登录后掉线。
## 新增功能
- 敏感操作 step-up 2FA 总开关 step_up_enabled(默认关闭):关闭时账号/代理导出、
备份创建/下载、S3 配置修改、提升管理员等操作恢复门控引入前的直接放行行为;
开启后要求当前会话在 15 分钟内完成过 TOTP step-up 验证。
## 优化改进
- 会话 IP/UA 绑定默认改为关闭(功能保留,可在设置页按需开启)。
- 开启 step-up 开关需操作者本人已启用 TOTP(防自锁);关闭开关本身作为敏感操作,
需通过 step-up 验证(防止攻击者拿到会话后先关闸再导出/备份)。
- 两个安全开关请求字段改为可空指针(省略=保持现值),避免旧客户端全量保存时
静默重置安全开关。
- 备份恢复(整库覆盖可回滚安全设置)纳入 step-up 门控。
- 审计摘要 diffSettings 补记 step_up_enabled / session_binding_enabled 变更。
## Bug 修复
- 修复 BackupView 恢复操作 409(恢复进行中)判断未适配 apiClient 扁平化错误对象。
2026-07-18 10:46:42 +08:00
haruka
bd0f2d6405
fix: report chat stream transport failures
2026-07-18 03:24:04 +08:00
benjamin
71afe24710
fix: 修复CI检查问题
2026-07-18 00:42:16 +08:00
benjamin
b92bbf0299
fix: 过滤入口拒绝日志并强化鉴权边界
2026-07-18 00:11:18 +08:00
wucm667
2594950993
fix: classify transient account exhaustion as 503 instead of 404
2026-07-17 22:10:18 +08:00
cyh
2264a33085
fix(gateway): normalize Claude Code 1m model suffix
2026-07-17 21:59:57 +08:00
Tian Lee
d2585097f3
fix: 完善上游 Sub2API 计费倍率探测与账号展示
2026-07-17 20:59:29 +08:00
Heatherm Huang
e86063155f
fix(grok): gate OAuth media on paid eligibility
2026-07-17 19:15:16 +08:00
haruka
1f7b7b9132
fix: honor temp unschedulable rules in pool mode
2026-07-17 18:12:33 +08:00
li
7043982ae3
fix(grok): 纯客户端函数工具不再注入原生搜索工具
...
Fixes #4486
2026-07-17 16:59:40 +08:00
li
e375623abf
fix(gateway): 被动 image_gen namespace 不再强制要求 Responses capability
...
Fixes #4476
2026-07-17 15:07:41 +08:00
Heatherm Huang
d2ac6b2c97
fix(grok): harden media quarantine edge cases
2026-07-17 12:08:50 +08:00
Heatherm Huang
8f9296140f
Merge remote-tracking branch 'origin/main' into codex/fix-grok-media-image-url-4420
2026-07-17 11:51:46 +08:00
Heatherm Huang
8bc0a277f2
fix(grok): quarantine ineligible media accounts
2026-07-17 11:51:16 +08:00
Heatherm Huang
456c619379
fix(grok): normalize media reference image payloads
2026-07-17 11:51:08 +08:00
Wesley Liddick
9b3c96dc68
Merge pull request #4451 from rurucxk/fix/grok-free-responses-function-tool-cache
...
fix(grok): enable free prompt cache for Responses function tools
2026-07-17 09:04:47 +08:00
shaw
d2b080e88b
fix(openai): restore APIKey account scheduling for alpha/search
...
PR #4394 (776f3f0de ) 在新增 alpha_search 调度能力时加入了 OAuth-only
门控,把 APIKey 账号从 /alpha/search 候选池整体剔除;但转发层自
52071d391 起就支持 APIKey 走 {base_url}/v1/alpha/search,门控注释中
「API key 会被发往 chatgpt.com 导致 401」与实际路由不符。结果是纯
APIKey 分组自 v0.1.157 起独立搜索在选号阶段即失败(无可用账号)。
修复:
- SupportsOpenAIEndpointCapability 的 alpha_search 门控放行
AccountTypeAPIKey(OAuth/APIKey 均可,Grok 等仍拒绝);显式能力集
语义不变,chat_completions 继续隐含放行 alpha_search。
- ForwardAlphaSearch 对 APIKey 账号的 404/405 按端点级 failover 处理
(换号、不写账号错误状态),避免混合分组里请求死在不支持该端点的
APIKey 上游;OAuth 账号 404 透传行为保持不变。
- 更新固化旧门控行为的用例,并在调度层新增 APIKey 放行回归锁。
2026-07-17 08:44:23 +08:00
rurucxk
29e39b96e5
fix(grok): enable free prompt cache for Responses function tools
...
Reuse applyGrokFreeMessagesFunctionToolCacheRoute on native /v1/responses
and the Grok WS HTTP bridge so Free OAuth requests with client function
tools get the same mixed-tools cache route as the Messages bridge
(append/convert web_search and x_search).
Also dedupe: Grok Build already declares function tools named web_search,
so naive append caused "Duplicate tool names: web_search". Convert those
function entries to native tool types and skip duplicates.
Only Free OAuth accounts (isKnownGrokFreeAccount); paid/unknown unchanged.
2026-07-17 00:23:19 +08:00
shaw
c1fd1cb44e
Merge origin/main into codex/fix-grok-regressions-4412-4421
...
Reconcile the OAuth media route with the manual endpoint-switch redesign
(7f5d067af ): media leaves for api.x.ai only when text traffic resolves to
the CLI gateway host; manually selected official/regional/custom endpoints
keep serving media as-is.
2026-07-16 19:57:48 +08:00
Wesley Liddick
7e13b6d039
Merge pull request #4425 from AdrianZhaoDev/agent/admin-users-batch-limits
...
feat(admin): batch update user concurrency and RPM
2026-07-16 19:33:32 +08:00
Wesley Liddick
c993490a82
Merge pull request #4434 from yan9651688/feat/group-one-click-copy
...
feat(group): add safe one-click duplication
2026-07-16 19:33:18 +08:00
Wesley Liddick
4d91f39474
Merge pull request #4431 from linyqh/codex/fix-codex-image-handoff
...
fix(openai): 修复 Codex 生图网关侧交接问题
2026-07-16 19:32:33 +08:00
shaw
7f5d067af2
feat(grok): 支持上游端点手动切换与快捷端点,修复 SSO 建号自定义地址被覆盖
...
官方端点(api.x.ai / cli-chat-proxy.grok.com)偶发不可用,运营方需要在
端点间手动切换。旧语义把 OAuth 账号存储的官方 host 一律视同"未定制"并
回落默认 CLI 网关:填了官方地址保存成功却不生效、重新编辑开关回到关闭、
再次保存直接删值,形成"修改不生效"的静默循环。
后端:
- GetGrokBaseURL OAuth 分支改为"存了什么用什么":官方 API / 区域 API /
第三方转发地址一律按填写值转发与探测,仅空值或无法解析的脏数据回落
默认 CLI 网关;删除官方变体运行时迁移逻辑
- *.api.x.ai 区域端点(us-east-1/us-west-2/eu-west-1 等)纳入可信 host,
OAuth 使用时不受运营方 URL 白名单限制,官方 host 仍强制 /v1 path
- 修复 SSO 批量建号 MergeCredentials 方向缺陷:BuildAccountCredentials
恒写官方 base_url,会覆盖导入请求指定的自定义转发地址;抽出
grokSSOImportCredentials 显式保留请求值(与 RefreshAccountToken 对齐)
前端:
- isCustomGrokBaseUrl 仅默认 CLI 网关 host 视同未定制:api.x.ai 与区域
端点保存后正常回显(开关开启 + 显示地址),不再被静默吞掉
- 新增 GrokBaseUrlPresets 快捷端点组件(Grok Build CLI / 官方 API /
us-east-1 / us-west-2 / eu-west-1),接入编辑(OAuth 自定义区 + apikey
Base URL)、新增(同前)与批量编辑(所选平台全为 grok 时显示,点击
自动勾选 base_url);仅快速填充,输入框仍可自由填写任意第三方地址
2026-07-16 19:10:21 +08:00
yan9651688
9fc006546c
Make repeated group setup safer
...
Admins often recreate groups with the same pricing, routing, and account membership. A server-side duplicate creates an inactive copy for review, preserves eligible account priorities, and recovers ambiguous retries without creating extra groups.
Constraint: Group has no neutral JSON metadata field for durable operation recovery
Constraint: Model routing references account IDs, so copied configuration requires matching bindings
Rejected: Rebuild from the list response | it omits configuration and account priority details
Rejected: Store operation identity in business configuration | it would pollute real group settings
Confidence: high
Scope-risk: moderate
Reversibility: clean
Directive: Keep duplicated groups inactive until an administrator reviews the copied configuration
Tested: Go unit and full tests, go vet, integration-tag compile, frontend Vitest, lint, typecheck, production build, and Playwright duplicate flow
Not-tested: PostgreSQL container integration locally because Docker is unavailable; CI will execute the database-backed suite
2026-07-16 18:18:28 +08:00
viccy and OmX
2b5944fd6c
防止 WebSocket 生图结果停留在进行中状态
...
HTTP/SSE 已会在终态事件中修正带结果的图片 item,但 WebSocket 下行路径缺少同一处理。现在四条文本帧出口复用现有归一化,并原样保留 result 数据。
Constraint: 仅修改终态事件中带非空 result 的 image_generation_call
Rejected: 解码并改写二进制帧 | 二进制帧不属于 JSON 事件契约
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: 保持 HTTP、SSE 与 WebSocket 的图片终态规则一致
Tested: 后端 unit、integration、go vet
Not-tested: 真实 Codex WebSocket 生图会话
Co-authored-by: OmX <omx@oh-my-codex.dev >
2026-07-16 17:11:00 +08:00
viccy and OmX
43e95dfa45
避免无效模型清单破坏 Codex 能力发现
...
自定义 API-key 上游可能将普通 OpenAI 模型列表作为 2xx 响应返回。现在只校验稳定 envelope,并把结构错误归类为可重试,以便冷缓存时换号且不污染缓存。
Constraint: Codex manifest schema 会随客户端演进,仅校验顶层 models 数组
Rejected: 在网关合成完整 manifest | 容易与上游 schema 漂移
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: 不要在此处校验 models 元素的易变字段
Tested: 后端 unit、integration、go vet
Not-tested: 真实第三方 API-key 上游的在线 failover
Co-authored-by: OmX <omx@oh-my-codex.dev >
2026-07-16 17:10:44 +08:00
Wesley Liddick
a2779cd5f3
Merge pull request #4428 from alfadb/fix/anthropic-haiku-full-mimicry
...
fix(gateway): 修复 Haiku OAuth 请求被归入额外用量
2026-07-16 16:55:11 +08:00
Wesley Liddick
dbef64bb45
Merge pull request #4427 from yan9651688/feat/channel-monitor-one-click-copy
...
feat(channel-monitor): add safe one-click duplication
2026-07-16 16:54:22 +08:00
Heatherm Huang
115116e8bf
fix(grok): repair OAuth routing regressions
2026-07-16 16:52:25 +08:00
shaw
35748d8c51
feat(security): gate admin role promotion behind step-up 2FA and harden admin TOTP verification
...
- 提升用户为管理员 / 创建管理员账号纳入敏感操作:handler 级 EnforceStepUp 门控
(admin API key 拒绝、未启用 TOTP 拒绝、无 grant 返回 STEP_UP_REQUIRED),
目标已是管理员的日常编辑不触发
- 管理员启用/停用 2FA 一律使用密码验证(默认通知邮箱常收不到验证码),
verification-method 按用户角色返回;普通用户行为不变
- 用户编辑/创建弹窗接入 useStepUp:命中 STEP_UP_REQUIRED 弹 TOTP 验证并自动重试
- 审计日志清理入口与其他敏感操作对齐:未启用 2FA 时直接提示先启用 TOTP,
不再弹出无法完成的验证码输入框(后端强制现场 TOTP 语义不变)
- 审计日志页重构:DataTable 布局、详情弹窗分区展示、时间范围改为 ops 同款
下拉(预设窗口 + 自定义起止支持时分)
2026-07-16 16:49:08 +08:00