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
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
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
IanShaw027
72a56f862c
fix(grok): free 500k + 对齐 personal-dev tier/时间窗
...
- soft-gate 默认额度 500k tokens / 滚动 24h / 95%(门禁 475k)
- soft-gate 仅显式 free OAuth(subscription_tier/plan_type == free)
- isKnownGrokFreeAccount 按 personal-dev(usage% 为 paid 证据、仅 credentials tier)
- 调度阈值仅 grok_sched header quota 窗,去掉 billing 7d/30d 候选
2026-08-07 18:52:53 +08:00
IanShaw027
8f5657b91c
fix(grok): 收窄 free 推断 — 仅月度探测,勿把周度 OK 当 free
...
- isKnownGrokFreeAccount 不再因 weekly StatusOK 推断 free
- 修复周度付费快照被 media soft-block 的回归
- 外部 OpenAI token 对比测试在 401 时 skip
2026-08-07 18:34:55 +08:00
IanShaw027
3a415e6d04
fix(grok): 五轮评审 — messages SearchCount 与 OpenAI free-gate
...
- /v1/messages Grok:SSE/buffered 路径累计 SearchCount
- OpenAI 遗留 sticky/list 应用 free soft-gate(advanced 关闭时)
- 单测:OpenAI getSchedulableAccount free-gate + messages 计数器
2026-08-07 18:23:28 +08:00
IanShaw027
3ae94df72b
fix(grok): 四轮评审 — SearchCount 接线与 sticky free-gate
...
- forwardGrokResponses 传播 stream/JSON 的 SearchCount 与 ImageCount
- Chat 桥接 SSE/buffered 对 Grok 累计 SearchCount(附加费)
- getSchedulableAccount sticky 应用 free soft-gate
- 无 call_id 时用合成 key 去重,避免 SSE ~2× 超扣
- 单测:JSON/SSE 接线、sticky free-gate、no-id dedup
2026-08-07 18:15:08 +08:00
IanShaw027
d7c9e7167b
fix(grok): 三轮评审 — 流式 Search 去重与调度/计费加固
...
- P0: 直播 SSE SearchCount 跨事件 call_id 去重,避免 ~2× 附加费
- SearchCount/Audio/WebSearchCalls 走 mandatory usage task
- web_search:uuid 等 forced request_id 优先于 client/local
- Sanitize 始终剥离 cookie;ApplyOAuth 清 grok_needs_reauth_at
- free 判定:paid 证据压过陈旧 free 凭据
- Gateway 列表应用 free soft-gate;token/body-read 可 failover
- web_search 重试支持 WaitPlan 获取;周 PeriodEnd 不再回填月 end
2026-08-07 17:58:23 +08:00
IanShaw027
245d069602
fix(grok): 二轮评审残留 — Search 叠加计费与 fail-closed 安全
...
- SearchCost 叠加 token(openai/gateway),未定价 warn
- Token URL 校验失败回落 DefaultTokenURL,禁止 Effective 旁路
- free 判定收窄 paidSignal(仅 plan/月额度),usage% 不否决 free
- web_search: mandatory 计费、uuid request_id、上游 failover 重选账号
- 调度阈值:7d/30d 不跨期 until + 48h stale 可选跳过
- SanitizeStoredCredentials 接入 create/update/bulk/SSO/ApplyOAuth
- ApplyOAuth 成功清除 grok_needs_reauth;SSO 允许 header_override_enabled
- VideoModelPrices 视为媒体定价完整;realtime 正常关闭仍计费
2026-08-07 17:40:21 +08:00
IanShaw027
ccf7ba3ba7
fix(grok): P2 分层清理、主对话 SearchCount 与调度 7d/30d
...
- DoGrokNativeResponsesJSON 去 gin.Context,UA 固定 CLI 身份
- GrokOAuthService 去掉 redis 直依赖,session store 由 wire 注入
- 主对话/流式响应统计 web_search_call/x_search/tool_search 写入 SearchCount
- Grok 调度阈值候选并入官方 weekly/monthly billing %
2026-08-07 17:21:01 +08:00
IanShaw027
7a81468282
fix(grok): 按 review 优先级修复计费漏扣、auth 投影与 free 门禁
...
P0: content 与 status 共用 claim 计费;稳定 grok-video request_id;
auth 热路径投影 video_model_prices。
P1: claim 失败释放可重试;视频绑定 TTL≥24h;SSO 凭据白名单与脱敏;
Token URL 校验;free soft-gate 默认 1M 并统一 free 判定;
Voice 预检余额;STT 抗低报;Realtime 失败不计费;search 未定价告警。
2026-08-07 17:15:43 +08:00
IanShaw027
93a04567d4
style(grok): 清理搜索处理器末尾空行
2026-08-07 17:03:48 +08:00
IanShaw027
918b121878
docs(grok): 补充 personal-dev 能力覆盖矩阵
2026-08-07 17:02:33 +08:00
IanShaw027
be5e4226d4
test(grok): 补齐模型映射与调度设置契约
2026-08-07 17:01:20 +08:00
IanShaw027
5bb206ee99
test(grok): 补齐音频与搜索计价接口契约
2026-08-07 16:56:53 +08:00
IanShaw027
856a96a217
test(grok): 对齐配额模型同步与 CLI 身份断言
2026-08-07 16:55:36 +08:00
IanShaw027
7b93f4a689
docs(grok): 更新完整整合审查与排除清单
2026-08-07 16:47:25 +08:00
IanShaw027
61b975b5dd
test(grok): 对齐跨客户端映射与路由审计契约
2026-08-07 16:45:25 +08:00
IanShaw027
769f1c2def
fix(grok): 防止 OAuth 客户端缺失导致崩溃
2026-08-07 16:38:26 +08:00
IanShaw027
21d0905c78
fix(grok): 按官方 status=done + video.url 计费并对齐字段
...
官方完成响应为 status=done、video.url、video.duration、顶层 model;
分辨率仅在创建请求中声明,status 无此字段故回退 create 快照/默认 480p。
拒绝 completed 等非官方状态与仅 URL 的宽松判定。
2026-08-07 16:36:15 +08:00
IanShaw027
962da308cc
fix(grok): 限制导入探测队列并去重任务
2026-08-07 16:36:12 +08:00
IanShaw027
a3aae134ee
fix(grok): 加固 SSO 凭证与 Cookie 隔离
2026-08-07 16:34:47 +08:00
IanShaw027
e549931cf4
fix(grok): 避免刷新时无效清理重认证标记
2026-08-07 16:31:12 +08:00
IanShaw027
5199a610af
test(grok): 恢复媒体资格失败关闭契约
2026-08-07 16:30:55 +08:00
IanShaw027
b59a3df5b5
fix(grok): 视频在 status 返回 video.url 后再按上游参数计费
...
创建/generations 仅绑定账号并缓存 create-time 定价快照;轮询到
video.url / download_url 等成功 URL 时一次性扣费。时长/分辨率/模型
优先取上游 status 字段,缺失则回退创建快照,再套默认 8s/480p。
Redis SetNX + request_id 去重,避免重复轮询双扣。
2026-08-07 16:29:57 +08:00
IanShaw027
25d2b03e90
fix(grok): 加固 OAuth 会话共享与一次性消费
2026-08-07 16:29:48 +08:00
IanShaw027
a061a758f4
fix(grok): 修复调度阈值初始化与刷新测试回归
2026-08-07 16:10:31 +08:00
IanShaw027
2a256150f7
docs: 补充 channel-monitor v2 摘要并忽略根目录 .vite 缓存
...
落地运维向 CHANNEL_MONITOR_V2_DESIGN.md(完整设计稿仍在 gitignore 的 docs/* 中);
将仓库根 .vite/ 加入忽略,避免 vitest 结果误提交。
2026-08-07 15:56:49 +08:00
IanShaw027
79df1647d4
feat(grok): 账单绝对金额、调度阈值 UI、搜索/Voice 计费与 /v1/web_search
...
- BillingSummary 输出 prepaid/monthly_used/on_demand 绝对金额,并映射官方 7d/30d 进度条
- 账号编辑页支持 credentials.account_scheduling_threshold 覆盖;Settings 文案细化
- groups.search_price_per_1k + 管理端/缓存全链路;SearchCount/AudioUsage 请求级计费
- Voice TTS/STT/Realtime 成功路径 RecordUsage;独立 /v1/web_search 原生 Grok 搜索
2026-08-07 15:52:55 +08:00
IanShaw027
99ad01f6de
feat(grok): 网关 Voice TTS/STT/Realtime 与分组音频定价
...
- 中继 xAI Voice HTTP(/tts /stt /custom-voices)与 Realtime WS(/realtime)
仅 Grok 分组可用;账号选调度沿用 chat 能力,不依赖创作中心
- Voice URL 固定走 api.x.ai(CLI proxy base 自动回落)
- 分组级 audio_realtime / TTS / STT 单价:schema + migration 218 +
admin API + GroupsView 表单与 i18n(无创作中心 UI)
2026-08-07 15:08:39 +08:00
IanShaw027
a397724f69
refactor(grok): 移除未接入的免费恢复状态
2026-08-07 15:03:04 +08:00
IanShaw027
2e20ea4c87
fix(grok): 保持模型级免费额度隔离
2026-08-07 14:55:41 +08:00
IanShaw027
7c62382d04
feat(grok): 吸收调度阈值、配额解析、批量用量与 CLI 身份
...
从 personal-dev 取优并接线到 feat/grok-complete-integration:
- 调度阈值:grok_sched_* 写入、ApplyAccountSchedulingThreshold、
account_scheduling_thresholds 设置与 Settings UI、网关过滤
- 配额头:x-rate-limit 别名、相对秒 reset、tier/entitlement 扩展
- 批量 usage:GetUsageBatch + POST /usage/batch + AccountsView 合并加载
- CLI 身份:xai.cli_identity 统一 pin/UA;service 层 applyGrokCLIHeaders
与 transport 最终改写对齐;media eligibility 模块落地
- UsageCell:月度 cents→USD 与 30d 进度条展示
保留既有 failure taxonomy / sticky / free recovery 等 HEAD cools。
2026-08-07 14:53:18 +08:00