IanShaw027
825f9c78d5
fix(channel-monitor-v2): default mode v1 and gentle adaptive backfill
...
Default channel_monitor_mode to v1 (opt-in V2) so upgrades keep active
probes; existing explicit v2 rows are left alone via ON CONFLICT DO NOTHING
plus migration checksum compatibility for already-applied 195.
V2 first-enable backfill no longer compresses ticks to 5s or uses 24h
chunks. Each tick does recent overlap plus at most one historical chunk
with depth-based ceilings (2h/4h/6h), adaptive grow/shrink, and failure
backoff. Error request_id dedup is bounded by a 90-minute lookback so
ops_error_logs is not scanned for full history.
Also align hide_throughput parse default with privacy-preserving public
runtime (missing key → true).
2026-08-08 13:59:11 +08:00
IanShaw027
cec922d335
fix(grok): clear golangci-lint findings on complete-integration branch
...
Check Close/CloseNow errors, drop unused helpers and dead constants,
lowercase ST1005 error strings, and stop discarding unwrap status as an
unused assignment so CI golangci-lint passes.
2026-08-08 12:56:40 +08:00
IanShaw027
a4faa015a7
fix(deps): bump nanoid 3.3.16 -> 3.3.17 for GHSA-2v37-7h3g-55p8
...
Match upstream lockfile pin so frontend-security audit gate passes.
2026-08-08 12:50:53 +08:00
IanShaw027
3c22aeeb3d
fix(channel-monitor-v2): default hide_throughput true for privacy parity
...
Align InitializeDefaultSettings and parseSettings with the public-settings
path and migration 206 so admin and user views agree when the key is unset.
2026-08-08 12:49:39 +08:00
IanShaw027
1f58e25ab3
Merge upstream/main into feat/grok-complete-integration
...
冲突集中在 chat completions / messages 两条 Responses 转发路径:
upstream 给 OpenAIForwardResult 增加了 UpstreamResponseModel 与
UpstreamResponseModelConflict(配套 beginUpstreamResponseModelObservation
观测器),本分支在同样位置把返回值改成了具名变量以便挂 Grok 原生搜索计数。
两侧不互斥,合并结果同时保留上游的响应模型观测字段与 Grok SearchCount 逻辑。
frontend/pnpm-lock.yaml 取 upstream 版本:package.json 与 upstream 完全一致,
本地差异只是 pnpm install 的重解析噪音。
2026-08-08 11:12:56 +08:00
IanShaw027
07b46e93e4
fix(grok): 修正 voice 路由推导、视频价归一化与门禁缓存驻留
...
- custom-voices endpoint 改由匹配到的路由模板推导(c.FullPath())。
原实现按请求 URL 字面后缀判 /audio,voice_id 恰为 "audio" 时
GET /custom-voices/audio 会被改写成 custom-voices/audio/audio,
把档案查询变成音频下载。补 voice_id="audio" 的路由推导测试。
- NormalizeVideoModelPrices 不再把无法识别的分辨率静默折算成 480p:
新增 LookupVideoBillingResolution 报告未知档位,配置解析路径丢弃并告警,
运行时计费仍走 OrDefault 兜底。model/tier 两层遍历改为排序遍历,
多个别名收敛到同一 family 时结果不再随 Go map 顺序漂移,冲突单价告警。
- grok free quota 软门禁缓存新增过期淘汰。条目按 account_id 键控且只写不删,
账号下线后会驻留至进程结束;淘汰只挂在已受 TTL 约束的查询路径上,
不影响缓存命中热路径。
- 迁移 220 清空非 Grok 分组视频价前先落快照表 groups_video_price_backup_220,
原 UPDATE 不可回滚。
- 简化 grok_search_count 两处等价冗余的事件类型分支。
2026-08-08 11:02:22 +08:00
Wesley Liddick
cc67b1aca1
Merge pull request #5406 from bestony/fix/openai-oauth-routing-hints
...
fix(openai): forward OAuth routing hints
2026-08-08 10:58:53 +08:00
shaw
8ad0a5ff52
fix(deps): bump nanoid 3.3.16 -> 3.3.17 to clear GHSA-2v37-7h3g-55p8 audit gate
2026-08-08 10:48:42 +08:00
IanShaw027
b7112d596f
fix(keys): grok-4.5 上下文窗口按 500k 对齐并修正账号测试 i18n mock
...
- UseKeyModal 中 grok-4.5 的 context_window / model_context_window /
OpenCode 模型目录统一改为 500000,与 xAI 实际上下文一致
- UseKeyModal.spec 的 OpenCode 目录断言同步为 500000
- AccountTestModal.spec 补齐 imagePreviewAlt 的 i18n mock,
跟上组件把 alt 文案迁到 i18n 之后的行为
2026-08-08 10:40:40 +08:00
IanShaw027
b717ed9d0d
feat(keys): complete Grok Build sample with endpoints/auth/session/features
...
Expand Use Key Grok CLI config.toml to include production-oriented sections
from working gateway setups: full [endpoints], preferred_method=api_key,
image_description, auto_compact threshold, and Imagine image/video feature
overrides with guided comments.
2026-08-08 10:33:45 +08:00
IanShaw027
f3bac4619e
feat(keys): expand Grok client samples and tune free soft-gate default
...
Ship Use Key templates that match Grok Build / Codex best practice: env
vars + multi-model config.toml with api_backend=responses, env_key over
hardcoded secrets, and clearer shell/path guidance for Claude/Codex/OpenCode.
Also set free_quota_token_limit default to 500k (24h soft-gate), clean up
personal-dev-only comments, and keep billing test fixtures aligned.
2026-08-08 10:26:16 +08:00
IanShaw027
2e857b20b8
chore(grok): 从 PR 中移除进度文档与 lockfile 噪音
...
- 删除 CHANNEL_MONITOR_V2_DESIGN.md(属于其它分支的设计草稿)
- 删除 backend/docs/GROK_INTEGRATION_PROGRESS.md(开发期进度记录,不属于产物)
- 还原 frontend/pnpm-lock.yaml 至 upstream/main(package.json 无变化,
差异全部来自本地 pnpm install 重解析)
2026-08-08 10:00:56 +08:00
IanShaw027
b7863650ec
fix(usage): prefer explicit video billing mode over image_count
...
Reuse shared getDisplayBillingMode so user usage rows with billing_mode=video
are not mislabeled as image when image_count is non-zero.
2026-08-08 09:45:12 +08:00
IanShaw027
bdeb13021a
fix(admin): i18n account-test media uploads and shared file pickers
...
Replace native file-input labels with translated choose-file buttons, localize
upload errors and previews, and fix ImageUpload defaults for zh/en.
2026-08-08 09:45:12 +08:00
IanShaw027
e01ce90d47
fix(grok): harden voice request ids, video pending, and search pricing alerts
...
Mint durable grok_audio/grok_realtime usage ids, avoid CLI headers on api.x.ai
voice, retry video pending store and fail-closed when snapshot is missing without
status duration, align pure-video ImageCount tests, and escalate unset search
price_per_1k to error-level logs.
2026-08-08 09:45:12 +08:00
IanShaw027
12db0f906a
fix(grok): drop account-test ZDR path and align media CLI headers
...
Remove optional upload_url / fake connectivity-only success from admin video
tests. Stamp Grok CLI headers only on the CLI proxy so OAuth media against
api.x.ai can complete and preview video like the gateway path.
2026-08-08 09:45:12 +08:00
IanShaw027
8005335742
fix(channel-monitor-v2): align admin error details dedup
2026-08-08 09:00:15 +08:00
IanShaw027
64d1ebe4a5
fix(channel-monitor-v2): close dedup and migration privacy gaps
2026-08-08 08:59:18 +08:00
IanShaw027
9f3ee38d4e
fix(channel-monitor-v2): preserve migration checksums and privacy defaults
2026-08-08 08:55:59 +08:00
IanShaw027
77e39fe608
docs(grok): note custom-voices coverage and free 24h soft-gate scope
...
Document voice CRUD/audio surface area and clarify free-window local soft-gate
semantics versus upstream metering.
2026-08-08 08:48:38 +08:00
IanShaw027
85fb776151
test(frontend): mock getLiveCapability and align rollback timeout
...
Stub GroupsView live capability API in unit tests and expect the longer
system rollback request timeout; refresh pnpm-lock after dependency resolve.
2026-08-08 08:48:38 +08:00
IanShaw027
6345b048d1
style(admin): color paid Grok and OpenAI plan badges
...
Keep free muted gray; SuperGrok cyan, Heavy purple, and distinct colors for
OpenAI Plus/Team/Pro so paid subscriptions stand out in the account list.
2026-08-08 08:48:38 +08:00
IanShaw027
e1d6600eb2
fix(admin): simplify Grok usage UI for free 24h and paid windows
...
Show free accounts only the rolling 24h soft-gate bar; paid accounts show
7d/30d and prepaid money. Drop the always-visible manual probe chip from the
usage cell in favor of scheduled recovery and usage load.
2026-08-08 08:48:38 +08:00
IanShaw027
8399a30417
fix(grok): treat free-usage and billing exhaustion as recoverable
...
Classify free-usage bodies during account tests without quarantining content
policy, and mark billing/spending-limit refresh failures as transient so
accounts stay probe-eligible.
2026-08-08 08:48:38 +08:00
IanShaw027
35faaa6d21
feat(grok): register custom-voices CRUD and audio download gateway routes
...
Forward list/get/patch/delete and reference-audio paths with safe path segment
encoding, method passthrough, and empty-body GET/DELETE handling.
2026-08-08 08:48:38 +08:00
IanShaw027
85b65284ec
fix(grok): set async video duration_ms from create accept to done discovery
...
Store CreatedAt on pending billing at video create and use wall-clock E2E
latency when status/content first observes official done+video.url, so usage
logs no longer record only the single poll hop.
2026-08-08 08:48:38 +08:00
IanShaw027
0d98176c59
fix(channel-monitor-v2): correct aggregation privacy and backfill
2026-08-08 01:59:44 +08:00
IanShaw027
165b072908
fix(grok): gateway media/voice routing, models, and status UI polish
...
Align gateway Grok media/voice paths and model lists, harden upstream failure
and quota handling, clear non-Grok video generation config migration, and polish
temp-unsched/status indicators with model whitelist updates.
2026-08-08 01:07:27 +08:00
IanShaw027
2526a04226
fix(admin): empty web-search config on missing setting and reset dialog scroll
...
Return a disabled empty web-search-emulation config when the setting key is
absent, and reset BaseDialog body scroll on open for long modals.
2026-08-08 01:07:27 +08:00
IanShaw027
68faeac837
fix(grok): restore base URL resolution and operator settings wiring
...
Honor account GetGrokBaseURLOr policy for official vs custom endpoints,
and wire settings resolution used by responses/chat URL builders.
2026-08-08 01:07:19 +08:00
IanShaw027
6d632eec45
fix(grok): tighten OAuth SSO flow and hide password login
...
Require oauth state/redirect consistency, fail closed on missing proxy,
and remove password login from create/reauth UI (admin-only password path stays off by default).
2026-08-08 01:07:19 +08:00
IanShaw027
d0767eab9d
feat(grok): admin account test modes with real media preview
...
Add mode-first connectivity probes for text/image/video/search/tts/stt/realtime,
standalone voice and web-search paths, media upload options, and in-browser
image/audio/video preview (including ZDR-safe b64 images and edit validation).
2026-08-08 01:07:08 +08:00
wucm667
9763765ebf
fix(openai): fail over OAuth image stream errors
2026-08-08 01:05:29 +08:00
cyh
74fcdf3d42
fix(openai): preserve exponential capacity backoff
2026-08-08 01:02:02 +08:00
github-actions[bot]
68d8f122e4
chore: sync VERSION to 0.1.172 [skip ci]
2026-08-07 15:39:12 +00:00
Wesley Liddick
155c494964
Merge pull request #5399 from fengshao1227/fix/responses-anthropic-invalid-content-blocks
...
fix(apicompat): Responses→Anthropic 转换不再发出上游会拒收的 content block
v0.1.172
2026-08-07 23:21:59 +08:00
Wesley Liddick
8991574873
Merge pull request #5345 from puppywang/fix/oauth-pending-account-takeover
...
fix(security): block OAuth account takeover via pending exchange
2026-08-07 23:20:22 +08:00
Wesley Liddick
8f7b0a314d
Merge pull request #5398 from Wei-Shaw/fix/openai-capacity-shed-stream-recovery
...
fix(gateway): 流内降载错误恢复 pre-output failover 并对客户端改写为可重试错误码
2026-08-07 23:11:20 +08:00
li
64090de664
fix(apicompat): Responses→Anthropic 转换不再发出上游会拒收的 content block
...
convertResponsesInputToAnthropic 的 default 分支把未知 item 的 content 逐字
透传成 Anthropic user 消息,Responses 专有的分片类型会原样进入上游请求体。
最典型的是工具执行后回放的 reasoning item:带 content 数组时,reasoning_text
块直接发给 Anthropic,上游回 400 Request body format invalid,而该 item 会一直
留在会话历史里,导致此后每一轮都继续失败。
同时修正两处会产出空内容消息的路径——Anthropic 拒收空内容消息与空白 text 块:
分片全部不可识别时,user 消息退化成 content:""、assistant 消息退化成单个空
text 块。
改动:
- type=reasoning 显式跳过。Anthropic 无法摄入 OpenAI reasoning:encrypted_content
不透明,thinking 重放需要上游签发的 signature。Codex 常见形态(只带 summary +
encrypted_content)本来就会被丢弃,这里让带 content 的形态行为一致。
- default 分支改走 convertResponsesUserToAnthropicContent 白名单转换,保留其中
可识别的文本/图片,丢弃其余分片。
- user / assistant 分支在转换结果为空内容或纯空白文本时跳过该消息。
Fixes #5329
2026-08-07 23:09:03 +08:00
Wesley Liddick
de904c433e
Merge pull request #5396 from Brisbanehuang/codex/upstream-response-model-audit
...
feat(usage): 增加上游响应模型审计
2026-08-07 23:00:46 +08:00
shaw
14a27f1960
test(gateway): 校准 error 帧边界 flush 期望至 pre-output failover 新契约
...
可重试类 error 帧按设计不再算客户端输出(保留在 attempt 缓冲中,
为随后的 response.failed 保住 pre-output failover),因此不在自身
边界单独 flush,而是与终止帧一起出站(1 次 flush)。原用例按旧行为
断言 2 次 flush 导致 CI 失败。
同时补充不可重试类(invalid_request)error 帧仍在边界 flush 的对照
用例,锁住两类错误帧的行为区分。
2026-08-07 22:55:42 +08:00
shaw
c33c3208e3
fix(gateway): 流内降载错误恢复 pre-output failover 并对客户端改写为可重试错误码
...
上游容量降载的真实序列是「event: error → event: response.failed」。此前
{"type":"error"} 帧被当作首个客户端输出立即 flush,clientOutputStarted 被固化,
随后的 response.failed 永远进不了 pre-output failover 分支,降载错误被原样转发;
Codex CLI 对 server_is_overloaded/slow_down 按闭集判致命,直接终止会话并提示
"Selected model is at capacity. Please try a different model."。
修复:
- 可重试类 error 帧不再算客户端输出,恢复既有的同账号重试+切号链路;
不可重试类(content_policy/invalid_request 等)维持原样转发,保留上游错误细节
- 必须转发给客户端时(流中途已有输出 / WS 桥接),把 server_is_overloaded、
slow_down 改写为致命集之外的 server_error,触发 Codex 内置退避重试;
错误消息原样保留,rate_limit_exceeded 等其他错误码一律不动
- 监控、计费与账号状态判定均基于改写前的原始事件
2026-08-07 22:42:33 +08:00
白宦成
de349187d9
fix(openai): harden priority routing hints
2026-08-07 21:47:54 +08:00
白宦成
815035fcc9
fix(openai): send OAuth routing hints
2026-08-07 21:47:53 +08:00
白宦成
915cc7e7bd
fix(openai): stop injecting legacy beta on OAuth responses
2026-08-07 21:47:53 +08:00
Brisbanehuang
db0bff82c7
feat(usage): audit upstream response models
...
(cherry picked from commit 839036224f795c8ee5dc6718a2a14372a45eea44)
2026-08-07 09:40:11 -04:00
Wesley Liddick
e88fc52ce6
Merge pull request #5383 from fengshao1227/fix/responses-tool-parameters-null-type
...
fix(openai): 修正 Responses 工具 Schema 中显式为 null 的 parameters.type
2026-08-07 21:06:10 +08:00
Wesley Liddick
045b620d0d
Merge pull request #5391 from fengshao1227/fix/codex-plan-gated-image-model-no-cooldown
...
fix(ratelimit): 图片模型被 Codex 文本端点拒绝时不再写模型冷却
2026-08-07 21:05:58 +08:00
Wesley Liddick
e79429b03f
Merge pull request #5392 from fengshao1227/fix/grok-405-failover-and-cooldown
...
fix(grok): 405 纳入 failover 与临时踢号,修复 Grok 会话粘性锁死
2026-08-07 21:05:46 +08:00
li
02fbcbe3ad
fix(ratelimit): 守卫按端点来源门控,并与冷却键对齐模型口径
...
上一版守卫只看模型类型,不区分请求从哪个端点进来。OAuth 账号的 /v1/images/*
上游同样是 Codex Responses(openai_images_responses.go → handleOpenAIImagesErrorResponse
→ handleOpenAIAccountUpstreamError → HandleUpstreamModelNotFound),所以专用生图
端点也会命中 plan-gated 分支。账号确实不具备生图能力时跳过冷却,会让调度层失去
唯一的刹车:每个请求都完整走一遍号池,对上游形成无上界的 400 放大。
改动:
- 新增 ctxkey.OpenAIImagesEndpoint 与 WithOpenAIImagesEndpoint /
OpenAIImagesEndpointFromContext,在 handler/openai_images.go 入口置位;
与 OpenAIImageGenerationIntent 区分——后者在 /v1/responses 带图片模型时也会置位。
- 守卫下移到 modelKey 计算之后,抽成 shouldSkipCodexPlanGatedImageModelCooldown,
仅在 plan-gated 分支、且非 /v1/images/* 入站时生效。
- 同时判断 requestedModel 与最终 modelKey:冷却键走 account.GetMappedModel,
账号可以把文本别名映射到 gpt-image-*,只判请求模型会漏掉这种形态。
2026-08-07 20:49:39 +08:00