IanShaw027
|
030da8c2f6
|
fix: close admin settings review gaps
|
2026-04-21 00:41:29 +08:00 |
|
IanShaw027
|
55e8dd550a
|
Tighten WeChat payment resume flow
|
2026-04-21 00:33:23 +08:00 |
|
IanShaw027
|
1521d50399
|
fix: apply email first-bind defaults on legacy login
|
2026-04-21 00:31:52 +08:00 |
|
IanShaw027
|
bf3ef2d19a
|
add admin user last used support
|
2026-04-21 00:22:17 +08:00 |
|
IanShaw027
|
beeab54ae3
|
Implement latest-used user repo queries
|
2026-04-21 00:17:48 +08:00 |
|
IanShaw027
|
b79052aaf2
|
Decouple email sync tests from local stubs
|
2026-04-21 00:16:06 +08:00 |
|
IanShaw027
|
16be82b959
|
fix payment visible methods and resume recovery
|
2026-04-21 00:14:05 +08:00 |
|
IanShaw027
|
5d58c7c6fb
|
Add auth identity legacy backfill and email sync
|
2026-04-21 00:13:40 +08:00 |
|
IanShaw027
|
9204145746
|
Close profile identity and avatar loop
|
2026-04-21 00:11:03 +08:00 |
|
IanShaw027
|
f73117f9b1
|
feat: add admin auth migration reports view
|
2026-04-21 00:07:14 +08:00 |
|
IanShaw027
|
85fc54b205
|
fix(frontend): restore pending auth session flow
|
2026-04-21 00:05:44 +08:00 |
|
IanShaw027
|
4f6966d7b3
|
frontend: route wechat oauth entry by public settings
|
2026-04-21 00:05:42 +08:00 |
|
IanShaw027
|
9e84e2fd2b
|
fix: persist admin payment visibility and scheduler settings
|
2026-04-21 00:05:17 +08:00 |
|
IanShaw027
|
f83fd59dca
|
Refine payment UX for wallet flows
|
2026-04-21 00:05:09 +08:00 |
|
IanShaw027
|
4ebdfcd13a
|
test(admin): constrain payment visible method sources
|
2026-04-21 00:03:27 +08:00 |
|
IanShaw027
|
0fa47f18ed
|
feat: complete pending oauth account creation UI
|
2026-04-21 00:02:51 +08:00 |
|
IanShaw027
|
7ef7fd19e7
|
fix: restore wechat payment oauth and jsapi flow
|
2026-04-20 23:34:57 +08:00 |
|
IanShaw027
|
6f00efa350
|
fix: support legacy payment method aliases
|
2026-04-20 23:05:29 +08:00 |
|
IanShaw027
|
e1a28848fa
|
fix: clarify wechat existing account binding
|
2026-04-20 22:54:47 +08:00 |
|
IanShaw027
|
7fdede579a
|
fix: preserve wechat bind resume state
|
2026-04-20 22:52:56 +08:00 |
|
IanShaw027
|
4d10ba4297
|
fix: complete wechat pending auth callback flows
|
2026-04-20 22:50:41 +08:00 |
|
IanShaw027
|
bffcc2042e
|
fix: complete oidc pending auth callback flows
|
2026-04-20 22:37:25 +08:00 |
|
IanShaw027
|
724f8e89a1
|
feat: resolve auth identity migration reports
|
2026-04-20 22:29:21 +08:00 |
|
IanShaw027
|
452e55a53c
|
feat: add admin auth identity repair binding
|
2026-04-20 22:22:14 +08:00 |
|
IanShaw027
|
3bd3027251
|
feat: expose auth identity migration reports
|
2026-04-20 22:05:33 +08:00 |
|
IanShaw027
|
aaf4946b27
|
fix: normalize pending oauth email lookups
|
2026-04-20 21:59:03 +08:00 |
|
IanShaw027
|
31d0183d45
|
fix: normalize repository email lookups
|
2026-04-20 21:51:57 +08:00 |
|
IanShaw027
|
b309822199
|
fix: tighten legacy payment provider resolution
|
2026-04-20 21:46:24 +08:00 |
|
IanShaw027
|
422f60a145
|
fix: normalize legacy wechat auth identity keys
|
2026-04-20 21:42:35 +08:00 |
|
IanShaw027
|
f65429145e
|
fix: route legacy linuxdo users to account binding
|
2026-04-20 21:31:05 +08:00 |
|
IanShaw027
|
5adefb466b
|
fix: finalize oauth identity bindings
|
2026-04-20 21:24:33 +08:00 |
|
IanShaw027
|
bdcd3d87e5
|
fix: resolve unique legacy payment providers
|
2026-04-20 21:09:38 +08:00 |
|
IanShaw027
|
32059ae9d5
|
fix: backfill email identities on successful login
|
2026-04-20 20:58:19 +08:00 |
|
IanShaw027
|
9bebf1c1a6
|
feat: resolve payment results by resume token
|
2026-04-20 20:53:46 +08:00 |
|
IanShaw027
|
c0b24aefba
|
feat: snapshot payment provider keys on orders
|
2026-04-20 20:47:14 +08:00 |
|
IanShaw027
|
e3f69e0246
|
fix: tighten webhook provider resolution
|
2026-04-20 20:42:01 +08:00 |
|
IanShaw027
|
7c7924e9fa
|
fix: guard payment fulfillment provider mismatch
|
2026-04-20 20:31:19 +08:00 |
|
IanShaw027
|
97c9b992cb
|
fix: require wechat unionid for oauth identity
|
2026-04-20 20:27:15 +08:00 |
|
IanShaw027
|
58b2cc380f
|
test: harden payment result resume flow
|
2026-04-20 20:22:00 +08:00 |
|
IanShaw027
|
b51bc7ee24
|
feat: wire payment return url payloads
|
2026-04-20 20:19:23 +08:00 |
|
IanShaw027
|
7826e9880c
|
feat: support linuxdo pending bind 2fa callback
|
2026-04-20 19:53:22 +08:00 |
|
IanShaw027
|
fb6204ea8b
|
feat: apply oauth first-bind defaults and pending bind 2fa
|
2026-04-20 19:53:22 +08:00 |
|
IanShaw027
|
6ea3f42e2f
|
feat: add oauth callback email binding ui
|
2026-04-20 19:30:19 +08:00 |
|
IanShaw027
|
6a75bd77e3
|
feat: add pending oauth email onboarding flow
|
2026-04-20 19:30:09 +08:00 |
|
IanShaw027
|
d47580a144
|
test: pin email signup defaults in register tests
|
2026-04-20 18:42:28 +08:00 |
|
IanShaw027
|
0353c3870f
|
test: update user service stubs for identity summaries
|
2026-04-20 18:40:34 +08:00 |
|
IanShaw027
|
4e0e691546
|
feat: apply auth source signup defaults
|
2026-04-20 18:39:53 +08:00 |
|
IanShaw027
|
c6d8592484
|
feat: add profile auth identity binding flow
|
2026-04-20 18:28:44 +08:00 |
|
IanShaw027
|
13d9780df4
|
feat: expose user activity timestamps in admin list
|
2026-04-20 17:48:30 +08:00 |
|
IanShaw027
|
e9de839d87
|
feat: rebuild auth identity foundation flow
|
2026-04-20 17:39:57 +08:00 |
|
IanShaw027
|
fbd0a2e3c4
|
feat: carry suggested third-party profile through pending oauth
|
2026-04-20 16:27:23 +08:00 |
|
IanShaw027
|
d3d4267731
|
fix: harden oidc callback security
|
2026-04-20 16:23:42 +08:00 |
|
IanShaw027
|
584ded2182
|
docs: harden auth identity payment design
|
2026-04-20 14:41:12 +08:00 |
|
IanShaw027
|
b6751f7ebc
|
docs: add auth identity implementation plan
|
2026-04-20 13:47:00 +08:00 |
|
IanShaw027
|
721d7ab3ab
|
docs: add audit synthesis to auth identity spec
|
2026-04-20 13:40:31 +08:00 |
|
IanShaw027
|
e01c1eaceb
|
docs: add auth identity payment foundation design spec
|
2026-04-20 13:18:30 +08:00 |
|
IanShaw027
|
f480e57344
|
fix: align table defaults and preserve sidebar svg colors
|
2026-04-10 18:27:53 +08:00 |
|
IanShaw027
|
7dc7ff22d2
|
fix: preserve messages dispatch config in repository hydration
|
2026-04-10 18:13:18 +08:00 |
|
IanShaw027
|
67a05dfccd
|
fix: honor table defaults and preserve dispatch mappings
|
2026-04-10 17:55:37 +08:00 |
|
IanShaw027
|
b6bc042302
|
fix(frontend): 升级 axios 修复审计高危漏洞
|
2026-04-10 09:28:32 +08:00 |
|
IanShaw027
|
1312405966
|
fix(settings): 补齐公开设置中的表格分页字段返回
|
2026-04-10 09:18:48 +08:00 |
|
IanShaw027
|
57d0f9794f
|
fix(frontend): 补全 messages 调度国际化文案
|
2026-04-10 00:56:23 +08:00 |
|
IanShaw027
|
269c7a065c
|
fix(test): restore integration expectations
|
2026-04-09 22:08:42 +08:00 |
|
IanShaw027
|
b6946e78a2
|
fix(lint): restore repository sort helpers
|
2026-04-09 21:49:10 +08:00 |
|
IanShaw027
|
2b70d1d332
|
merge upstream main into fix/bug-cleanup-main
|
2026-04-09 21:35:48 +08:00 |
|
IanShaw027
|
b37afd68ec
|
fix(lint): format setting service
|
2026-04-09 21:31:48 +08:00 |
|
IanShaw027
|
62962c05f1
|
fix(lint): 修复 CI 中的 ineffassign 和 unused 代码告警,修正 group 排序集成测试兼容性
|
2026-04-09 19:25:08 +08:00 |
|
IanShaw027
|
5f8e60a1b7
|
feat(table): 表格排序与搜索改为后端处理
|
2026-04-09 18:14:28 +08:00 |
|
IanShaw027
|
66e15a54a4
|
fix(export): 导出逻辑与当前筛选条件对齐
|
2026-04-09 18:14:28 +08:00 |
|
IanShaw027
|
ad80606a44
|
feat(settings): 增加全局表格分页配置,支持自定义
|
2026-04-09 18:14:28 +08:00 |
|
IanShaw027
|
d8fa38d55a
|
fix(account): 修复账号管理中的状态筛选
|
2026-04-09 18:14:28 +08:00 |
|
IanShaw027
|
fe211fc563
|
fix(ui): 修复在 macOS 系统下数据表格横向滚动条闪隐和消失的问题
问题原因:
原本的 `style.css` 代码全局使用了 W3C 标准属性 (`scrollbar-width`)。而在 Chrome 121+ 以及 Safari 环境下,一旦匹配到 W3C 标准属性,浏览器就会放弃 WebKit 的定制样式,全面交由操作系统原生渲染。因为 macOS 原生的滚动条特性就是“不滚动时自动隐藏”,加之原本又配置了全局 hover 时才显色的透明度逻辑,最终导致在苹果系统下数据表常常无法明显看出横向滚动条。
修复方式:
1. 在 `style.css` 中增加 `@supports (-moz-appearance:none)`,将对全局 `scrollbar-width` 的干预严格隔离限制在 Firefox 浏览器内,防止误伤 Chrome 等 WebKit 系浏览器。
2. 移除旧版代码中对 `.table-wrapper` 直接定义的 `scrollbar-width` 和透明覆盖。
3. 在 `DataTable.vue` 内部,通过 `!important` 将 Webkit 专属定制外观(12px高度,实心圆角灰色轨道)的优先权推至最高,强制覆盖透明隐身规则。
4. 为底层 table 添加了 `min-w-max` 属性,强制阻止内容宽度受限于屏幕边界带来的收缩,充分保证合理超出范围而触发常驻横向溢出。
|
2026-04-09 15:13:16 +08:00 |
|
IanShaw027
|
7d008bd5b6
|
fix(test): 修正 admin service 分组测试平台字段赋值
|
2026-04-09 12:42:37 +08:00 |
|
IanShaw027
|
66ff2def8c
|
fix(test): 补充 admin service 分组测试字符串指针辅助函数
|
2026-04-09 12:39:05 +08:00 |
|
IanShaw027
|
de9b9c9dfb
|
feat(admin): 增加分组 messages 调度映射配置界面
|
2026-04-09 12:30:25 +08:00 |
|
IanShaw027
|
d765359f4b
|
test(admin): 增加messages调度表单状态转换测试
|
2026-04-09 12:30:06 +08:00 |
|
IanShaw027
|
4de4823a65
|
feat(openai): 支持messages模型映射与instructions模板注入
|
2026-04-09 12:29:49 +08:00 |
|
IanShaw027
|
23c4d592f8
|
feat(group): 增加messages调度模型映射配置
|
2026-04-09 12:29:28 +08:00 |
|
IanShaw027
|
686f890fbf
|
style: 修复 gofmt 格式问题
|
2026-03-15 18:42:32 +08:00 |
|
IanShaw027
|
90b3838173
|
fix: 移除 Gemini 不支持的 patternProperties 字段 #795
|
2026-03-15 17:46:58 +08:00 |
|
IanShaw027
|
19d3ecc76f
|
fix: 修复批量编辑账号时模型白名单显示与实际不一致的问题 #982
修复批量编辑账号时,UI 显示的是 plain 模型名(如 GPT-5),但实际落库的是 dated 模型名的问题。
核心改动:
1. 批量编辑白名单不再使用 BulkEditAccountModal.vue 中手写的过期模型列表
- 移除了 allModels 和 presetMappings 的硬编码列表(共 200+ 行)
- 直接复用 ModelWhitelistSelector.vue 组件
2. ModelWhitelistSelector 组件支持多平台联合过滤
- 新增 platforms 属性支持传入多个平台
- 添加 normalizedPlatforms 计算属性统一处理单平台和多平台场景
- availableOptions 根据选中的多个平台动态联合过滤模型列表
- fillRelated 功能支持一次性填充多个平台的相关模型
3. 模型映射预设改为动态生成
- filteredPresets 改用 getPresetMappingsByPlatform 从统一模型源按平台动态生成
- 不再依赖弹窗中的手写预设列表
现在的行为:
- UI 显示什么模型,勾选什么模型,传给后端的就是什么模型
- 彻底解决了批量编辑链路上"显示与实际不一致"的问题
- 模型列表和映射预设始终与系统定义保持同步
|
2026-03-15 17:46:58 +08:00 |
|
IanShaw027
|
6fba4ebb13
|
fix: 在 Dockerfile.goreleaser 中添加 pg_dump 和 psql 工具 #1002
为了支持容器内的数据库备份和恢复功能,在运行时镜像中添加 PostgreSQL 客户端工具。
变更内容:
- 使用多阶段构建从 postgres:18-alpine 镜像复制 pg_dump 和 psql 二进制文件
- 添加必要的依赖库(libpq, zstd-libs, lz4-libs, krb5-libs, libldap, libedit)
- 升级基础镜像到 alpine:3.21
- 复制 libpq.so.5 共享库以确保工具正常运行
这样可以在运行时容器中直接执行数据库备份和恢复操作,无需访问 Docker socket。
|
2026-03-15 17:46:58 +08:00 |
|
IanShaw027
|
c31974c913
|
fix: 兼容部分限额字段为空的情况 #1021
修复在填写限额时,如果不填写完整的三个限额额度(日限额、周限额、月限额)就会报错的问题。
变更内容:
- 后端:添加 optionalLimitField 类型处理空值和空字符串,兼容部分限额字段为空的情况
- 前端:添加 normalizeOptionalLimit 函数规范化限额输入,将空值、空字符串和无效数字统一处理为 null
|
2026-03-15 17:46:58 +08:00 |
|
ianshaw
|
7b46bbb628
|
fix(lint): 修复错误消息大写问题以符合 Go 惯例
|
2026-02-05 20:47:15 +08:00 |
|
ianshaw
|
d2527e36eb
|
feat(gemini): 增强 API 授权错误处理,自动提取并显示激活 URL
当 Gemini for Google Cloud API 未启用时(SERVICE_DISABLED 错误),
系统现在会:
- 自动检测 403 PERMISSION_DENIED 错误
- 从错误响应中提取 API 激活 URL
- 向用户显示清晰的错误消息和可点击的激活链接
- 提供操作指引(启用后等待几分钟)
新增文件:
- internal/pkg/googleapi/error.go: Google API 错误解析器
- internal/pkg/googleapi/error_test.go: 完整的测试覆盖
- GEMINI_API_ERROR_HANDLING.md: 实现文档
修改文件:
- internal/repository/geminicli_codeassist_client.go:
在 LoadCodeAssist 和 OnboardUser 中增强错误处理
这大大改善了用户体验,用户不再需要手动从错误日志中查找激活 URL。
|
2026-02-05 20:17:53 +08:00 |
|
柴叁
|
9985c4a344
|
fix(gemini): 优化 Gemini 接口认证兼容性,支持 Authorization: Bearer
调整 API key 提取优先级,让 /v1beta 接口同时支持 x-goog-api-key 和
Authorization: Bearer 两种认证方式,解决 OpenClaw 等使用 Bearer 认证
的客户端无法直接访问 Gemini 接口的问题。
|
2026-02-04 16:26:36 +08:00 |
|
ianshaw
|
2cd5037878
|
chore: 触发 CI 重新运行
|
2026-02-03 14:43:59 +08:00 |
|
ianshaw
|
03e94f9f53
|
fix(gemini): 为 Gemini 工具调用添加 thoughtSignature 避免 INVALID_ARGUMENT 错误
|
2026-02-03 06:01:29 +08:00 |
|
ianshaw
|
a55cfebd09
|
fix(ratelimit): 修复 OpenAI usage_limit_reached 错误的重置时间解析
- 问题:OpenAI 的 usage_limit_reached 错误(需 37 小时重置)被错误地设置为 5 分钟
- 原因:handle429 只检查 Anthropic 响应头,没有解析 OpenAI 响应体中的 resets_in_seconds
- 修复:新增 parseOpenAIRateLimitResetTime 函数解析 OpenAI 响应体
- 影响:避免调度器不断尝试已达配额上限的账户
|
2026-01-26 09:57:44 +08:00 |
|
ianshaw
|
839975b0cf
|
feat(gemini): 支持 Gemini CLI 粘性会话与跨账号 thoughtSignature 清理
## 问题背景
1. Gemini CLI 没有明确的会话标识(如 Claude Code 的 metadata.user_id)
2. thoughtSignature 与具体上游账号强绑定,跨账号使用会导致 400 错误
3. 粘性会话切换账号或 cache 丢失时,旧签名会导致请求失败
## 解决方案
### 1. Gemini CLI 会话标识提取
- 从 `x-gemini-api-privileged-user-id` header 和请求体中的 tmp 目录哈希生成会话标识
- 组合策略:SHA256(privileged-user-id + ":" + tmp_dir_hash)
- 正则提取:`/\.gemini/tmp/([A-Fa-f0-9]{64})`
### 2. 跨账号 thoughtSignature 清理
实现三种场景的智能清理:
1. **Cache 命中 + 账号切换**
- 粘性会话绑定的账号与当前选择的账号不同时清理
2. **同一请求内 failover 切换**
- 通过 sessionBoundAccountID 跟踪,检测重试时的账号切换
3. **Gemini CLI + Cache 未命中 + 含签名**
- 预防性清理,避免 cache 丢失后首次转发就 400
- 仅对 Gemini CLI 请求且请求体包含 thoughtSignature 时触发
## 修改内容
### backend/internal/handler/gemini_v1beta_handler.go
- 添加 `extractGeminiCLISessionHash` 函数提取 Gemini CLI 会话标识
- 添加 `isGeminiCLIRequest` 函数识别 Gemini CLI 请求
- 实现账号切换检测与 thoughtSignature 清理逻辑
- 添加 `geminiCLITmpDirRegex` 正则表达式
### backend/internal/service/gateway_service.go
- 添加 `GetCachedSessionAccountID` 方法查询粘性会话绑定的账号 ID
### backend/internal/service/gemini_native_signature_cleaner.go (新增)
- 实现 `CleanGeminiNativeThoughtSignatures` 函数
- 递归清理 JSON 中的所有 thoughtSignature 字段
- 支持任意 JSON 顶层类型(object/array)
### backend/internal/handler/gemini_cli_session_test.go (新增)
- 测试 Gemini CLI 会话哈希提取逻辑
- 测试 tmp 目录正则匹配
- 覆盖有/无 privileged-user-id 的场景
## 影响范围
- 修复 Gemini CLI 多轮对话时账号切换导致的 400 错误
- 提高粘性会话的稳定性和容错能力
- 不影响其他客户端(Claude Code 等)的会话标识生成
## 测试
- 单元测试:go test -tags=unit ./internal/handler -run TestExtractGeminiCLISessionHash
- 单元测试:go test -tags=unit ./internal/handler -run TestGeminiCLITmpDirRegex
- 编译验证:go build ./cmd/server
|
2026-01-26 04:40:38 +08:00 |
|
ianshaw
|
8c1233393f
|
fix(antigravity): 修复 Gemini 模型 thoughtSignature 被错误覆盖的问题
## 问题描述
在使用 Gemini 模型(gemini-3-flash-preview)时,出现 400 错误:
"Unable to submit request because Thought signature is not valid"
## 根本原因
在 `request_transformer.go` 的 `buildParts()` 函数中:
- 对于 `tool_use` 和 `thinking` 块,当 `allowDummyThought=true`(Gemini 模型)时
- 代码会无条件将客户端传入的真实 `thoughtSignature` 覆盖成 dummy 值
- 导致 Gemini API 验证签名失败(签名与上下文不匹配)
## 修复方案
修改 signature 处理逻辑:
1. **优先透传真实 signature**:如果客户端提供了有效的 signature,保留它
2. **缺失时才使用 dummy**:只有在 signature 缺失且是 Gemini 模型时,才使用 dummy signature
3. **Claude 模型特殊处理**:将 dummy signature 视为缺失,避免透传到需要真实签名的链路
## 修改内容
### request_transformer.go
- `thinking` 块(第 367-386 行):优先透传真实 signature
- `tool_use` 块(第 411-418 行):优先透传真实 signature
### request_transformer_test.go
- 修改测试用例名称,反映新的行为
- 新增测试用例验证"缺失时才使用 dummy"的逻辑
## 影响范围
- 修复 Gemini 模型在多轮对话中使用 tool_use 时的签名验证错误
- 不影响 Claude 模型的现有行为
- 提高跨账号切换时的稳定性
相关问题:#[issue_number]
|
2026-01-26 03:06:45 +08:00 |
|
ianshaw
|
bc1d7edc58
|
fix(ops): 统一 request-errors 和 SLA 的错误分类逻辑
修复 request-errors 接口与 Dashboard Overview SLA 计算不一致的问题:
- errors 视图现在只排除业务限制错误(余额不足、并发限制等)
- 上游 429/529 错误现在包含在 errors 视图中,与 SLA 计算保持一致
- excluded 视图现在只显示业务限制错误
这确保了 request-errors 接口和 Dashboard 的 error_count_sla 使用相同的过滤逻辑。
|
2026-01-17 17:57:40 +08:00 |
|
ianshaw
|
25b00abca1
|
fix(网关): 修复账号选择中的调度器快照延迟问题
## 问题描述
调度器快照更新存在0.5-1秒的延迟(Outbox轮询间隔),导致在账号被限流或过载后的短时间窗口内,
可能仍会被选中,造成请求失败。
## 根本原因
账号选择逻辑依赖调度器快照(listSchedulableAccounts),但快照更新有延迟:
- Outbox轮询: 每1秒检查一次变更事件
- 全量重建: 每300秒重建一次
- 时间窗口: 账号状态变更后0.5-1秒内,快照可能未更新
## 解决方案
在账号选择循环中添加IsSchedulable()实时检查,作为第二道防线:
1. 第一道防线: 调度器快照过滤(可能有延迟)
2. 第二道防线: IsSchedulable()实时检查(本次修复)
IsSchedulable()会检查:
- RateLimitResetAt: 限流重置时间
- OverloadUntil: 过载持续时间
- TempUnschedulableUntil: 临时不可调度时间
- Status: 账号状态
- Schedulable: 可调度标志
## 修改范围
### OpenAI Gateway Service
- SelectAccountForModelWithExclusions: 添加IsSchedulable()检查
- SelectAccountWithLoadAwareness: 添加IsSchedulable()检查
### Gateway Service (Claude/Gemini/Antigravity)
- 负载感知选择候选账号筛选: 添加IsSchedulable()检查
- selectAccountForModelWithPlatform: 添加IsSchedulable()检查
- selectAccountWithMixedScheduling: 添加IsSchedulable()检查
### 测试用例
- OpenAI: 添加2个测试用例验证限流账号过滤
- Gateway: 添加2个测试用例验证限流和过载账号过滤
### 其他修复
- ops_repo_preagg.go: 修复platform为NULL时的聚合问题
## 测试结果
所有单元测试通过 ✅
|
2026-01-13 22:49:26 -08:00 |
|
ianshaw
|
d7fa47d732
|
refactor(openai): 移除不必要的 seedOpenAISessionHeaders 函数
|
2026-01-12 20:38:46 -08:00 |
|
ianshaw
|
3d6e01a58f
|
fix(openai): 增强 OpenCode 兼容性和模型规范化
## 主要改动
1. **模型规范化扩展到所有账号**
- 将 Codex 模型规范化(如 gpt-5-nano → gpt-5.1)应用到所有 OpenAI 账号类型
- 不再仅限于 OAuth 非 CLI 请求
- 解决 Codex CLI 使用 ChatGPT 账号时的模型兼容性问题
2. **reasoning.effort 参数规范化**
- 自动将 `minimal` 转换为 `none`
- 解决 gpt-5.1 模型不支持 `minimal` 值的问题
3. **Session/Conversation ID fallback 机制**
- 从请求体多个字段提取 session_id/conversation_id
- 优先级:prompt_cache_key → session_id → conversation_id → previous_response_id
- 支持 Codex CLI 的会话保持
4. **Tool Call ID fallback**
- 当 call_id 为空时使用 id 字段作为 fallback
- 确保 tool call 输出能正确匹配
- 保留 item_reference 类型的 items
5. **Header 优化**
- 添加 conversation_id 到允许的 headers
- 移除删除 session headers 的逻辑
## 相关 Issue
- 参考 OpenCode issue #3118 关于 item_reference 的讨论
|
2026-01-12 20:18:53 -08:00 |
|
ianshaw
|
d85288a6c0
|
Revert "fix(gateway): 修复 base_url 包含 /chat/completions 时路径拼接错误"
This reverts commit 7fdc25df3c.
|
2026-01-12 13:29:04 -08:00 |
|
ianshaw
|
3402acb606
|
feat(gateway): 对所有请求(包括 Codex CLI)应用模型映射
- 移除 Codex CLI 的模型映射跳过逻辑
- 添加详细的模型映射日志,包含账号名称和请求类型
- 确保所有 OpenAI 请求都能正确应用账号配置的模型映射
|
2026-01-12 13:23:05 -08:00 |
|
ianshaw
|
7fdc25df3c
|
fix(gateway): 修复 base_url 包含 /chat/completions 时路径拼接错误
问题:
- 当账号的 base_url 配置为 https://example.com/v1/chat/completions 时
- 代码直接追加 /responses,导致路径变成 /v1/chat/completions/responses
- 上游返回 404 错误
修复:
- 在追加 /responses 前,先移除 base_url 中的 /chat/completions 后缀
- 确保最终路径为 https://example.com/v1/responses
影响范围:
- OpenAI API Key 账号的测试接口
- OpenAI API Key 账号的实际网关请求
Related-to: #231
|
2026-01-12 11:39:45 -08:00 |
|
ianshaw
|
ea699cbdc2
|
docs(frontend): 完善 OpenCode 配置说明
更新 API 密钥页面 OpenCode 配置提示信息:
- 补充支持 opencode.jsonc 后缀名
- 说明可使用默认 provider(openai/anthropic/google)或自定义 provider_id
- 说明 API Key 支持直接配置或通过 /connect 命令配置
- 保留"示例仅供参考,模型与选项可按需调整"的提示
配置文件路径:~/.config/opencode/opencode.json(或 opencode.jsonc)
|
2026-01-12 11:17:47 -08:00 |
|
ianshaw
|
fe6a3f4267
|
fix(gateway): 完善 max_output_tokens 参数处理逻辑
根据不同平台和账号类型处理 max_output_tokens 参数:
- OpenAI OAuth (Responses API): 保留 max_output_tokens(支持)
- OpenAI API Key: 删除 max_output_tokens(不支持)
- Anthropic (Claude): 转换 max_output_tokens 为 max_tokens
- Gemini: 删除 max_output_tokens(由 Gemini 专用转换处理)
- 其他平台: 删除(安全起见)
同时处理 max_completion_tokens 参数,仅在 OpenAI OAuth 时保留。
修复客户端(如 OpenCode)发送不支持参数导致上游返回 400 错误的问题。
Related-to: #231
|
2026-01-12 11:08:28 -08:00 |
|