Commit Graph
637 Commits
Author SHA1 Message Date
li c929ad0788 fix: clone fhttp response headers to prevent mutation aliasing
fromFHTTPResponse returned Header and Trailer maps that aliased the
original fhttp.Response maps. Downstream consumers (e.g. console
adapter calling Header.Del) mutated the shared maps, corrupting the
fhttp response state. Clone all shared data structures (Header,
Trailer, TransferEncoding) to isolate the two responses.
2026-07-14 21:05:45 +08:00
li e376c2219e fix: prevent json_schema's own type field from overwriting response_format type
When normalizeResponseFormat promoted json_schema fields into the
top-level format object, the schema's own "type" key (e.g. "object")
overwrote the format "type" that was just set to "json_schema". The
upstream then received a malformed format specification with
type:"object" instead of type:"json_schema".

Skip the "type" key when copying schema fields to preserve the
correct format type.
2026-07-14 21:05:02 +08:00
li 2b797b5e11 fix: do not delete committed image when temp file cleanup fails
After a successful hard link commits the image to its permanent path,
a failure to remove the temporary file caused the permanent copy to
be deleted — a data loss bug. The leftover temp file is harmless and
will be cleaned up on the next write or restart; the committed image
must not be rolled back for a cleanup failure.
2026-07-14 21:04:23 +08:00
Chenyme b0446afe35 Merge pull request #609 from hamburg888/codex/fix-copy-buttons
fix(frontend): repair copy buttons on non-secure contexts
2026-07-14 15:03:27 +08:00
Chenyme cce221339b refactor: improve client keys dialog and copy button functionality 2026-07-14 15:00:39 +08:00
Chenyme ef87d9e0fc chore: improve repository organization 2026-07-14 14:18:28 +08:00
Chenyme 19ec7812ea chore: Remove Docker workflow file as part of repository cleanup 2026-07-14 14:05:43 +08:00
Chenyme 8a8b8565c1 Merge pull request #611 from chenyme/workflows
chore: Update Docker workflow to enhance pull request handling and image publishing logic
2026-07-14 13:59:10 +08:00
Chenyme dcaeb3f3c2 chore: Update Docker workflow to enhance pull request handling and image publishing logic 2026-07-14 13:56:35 +08:00
hamburg 7c03e43e97 fix(frontend): repair copy buttons on non-secure contexts
All copy buttons silently failed when the app was served over plain HTTP on a LAN IP, because navigator.clipboard.writeText rejects in a non-secure context and the previous code neither awaited the promise nor handled its rejection. Surface a boolean return value from copyToClipboard and fall back to execCommand(copy) with a hidden textarea so copying works regardless of context security.

Extract the duplicated inline CopyButton implementations from the docs, accounts, and client-keys pages into a single shared component that handles the icon toggle, toast notifications, and fallback wiring. Client keys still fetch the secret before copying via the existing mutation, but now surface copy failures through its error handler.

Add the common.copyFailed translation key for both locales.
2026-07-14 13:21:06 +08:00
Chenyme 2eb425fcc6 Merge pull request #603 from piexian/feat/grok-console-provider
feat:添加Console渠道
2026-07-14 11:49:19 +08:00
Chenyme 1b5cddca54 refactor: Enhance model routing and provider handling, improve documentation and error messages 2026-07-14 11:43:49 +08:00
Chenyme 99e4e7899b fix: Update Grok Console to support stateless responses and enhance error handling 2026-07-14 01:34:51 +08:00
氕氙 ff380da57c merge: sync upstream main 2026-07-14 00:09:44 +08:00
氕氙 1daa6d060c fix: sync Web SSO accounts to Console 2026-07-14 00:02:10 +08:00
氕氙 10b0a47d20 merge: sync upstream main
# Conflicts:
#	frontend/src/entities/model/model-api.ts
#	frontend/src/features/accounts/accounts-api.ts
#	frontend/src/features/accounts/accounts-page.tsx
2026-07-13 23:47:54 +08:00
Chenyme dd6624cbb1 fix: Enhance web search tool handling and compatibility warnings 2026-07-13 23:40:26 +08:00
Chenyme 9244306352 fix: separate Grok Build and Web proxy transports 2026-07-13 23:21:07 +08:00
氕氙 5cee3d2f9a feat: add Grok Console provider 2026-07-13 22:53:37 +08:00
Chenyme d626a26db4 feat: Implement model quota management and enhance routing candidate selection 2026-07-13 22:02:55 +08:00
Chenyme f524576d01 refactor: Enhance credential refresh logic and improve application startup handling 2026-07-13 20:48:03 +08:00
Chenyme 21b82eecf4 Merge pull request #599 from fengshao1227/fix/settings-revision-zero
fix: 设置保存报 400 — revision=0 被 required 校验拒绝 (#592)
2026-07-13 20:26:46 +08:00
li dce86278d9 fix: 设置保存报 400 — revision=0 被 required 校验拒绝 (#592)
Revision 字段标记了 binding:"required",gin 的 required 校验将
uint64 零值视为"空"而拒绝。新部署的实例 revision 从 0 开始,
因此第一次保存任何设置都会触发 400 "请求参数无效"。

- 去掉 Revision 的 binding:"required"(revision=0 是合法值,
  乐观锁冲突由 Service.Update 通过 ErrConflict 检查)
- ShouldBindJSON 失败时透传具体校验错误而非笼统的"请求参数无效"

Fixes #592
2026-07-13 20:04:13 +08:00
Chenyme ec6e35141f fix: Enhance compatibility and error handling in response processing 2026-07-13 19:50:19 +08:00
Chenyme 2059256782 Merge pull request #598 from fengshao1227/fix/messages-system-role
fix: Messages API 兼容 messages 内联 system role,修复 Claude Code 400 (#595)
2026-07-13 19:41:22 +08:00
li 982e27bc92 fix: Messages API 兼容 messages 内联 system role (Claude Code)
Claude Code 等客户端会在 messages 数组中注入 role="system"
(mid-conversation system instruction),当前 convertAnthropicMessages
直接拒绝,导致 /v1/messages 返回 400,无法在 Claude Code 中使用。

- convertAnthropicMessages: 抽取 messages 中的 system 消息文本,
  与顶层 system 合并到 instructions,而非报错
- anthropicErrorJSON: 透传上游错误的 type/code,
  替代笼统的 "Upstream request failed"
- 新增 3 个单测覆盖内联 system、仅内联 system、未知 role 拒绝

Fixes #595
2026-07-13 19:35:06 +08:00
Chenyme 449b95fa68 Merge branch 'main' of https://github.com/chenyme/grok2api 2026-07-13 18:35:26 +08:00
Chenyme f9e2f91c46 feat: Update Grok Build to version 0.2.99 with enhanced request normalization and improved compatibility for OpenAI function calling. Introduced multi-file credential import functionality and refined user agent handling for egress nodes. 2026-07-13 18:35:20 +08:00
Chenyme f55ca5a0c1 Merge pull request #593 from fengshao1227/fix/clipboard-fallback
fix: clipboard copy fails on non-HTTPS LAN deployments (#591)
2026-07-13 18:00:47 +08:00
li 7a26e9d5eb fix: clipboard copy fails on non-HTTPS LAN deployments
navigator.clipboard API requires a secure context (HTTPS or localhost).
When accessing via LAN IP (e.g. http://192.168.x.x), navigator.clipboard
is undefined, causing "Cannot read properties of undefined (reading
'writeText')" on every copy action.

Add a copyToClipboard() helper that uses navigator.clipboard when
available and falls back to document.execCommand('copy') otherwise.
Replace all 4 direct navigator.clipboard.writeText calls.

Fixes #591
2026-07-13 17:55:23 +08:00
Chenyme 74a2c9d3af Merge pull request #590 from fengshao1227/fix/web-sso-tier-detection
fix: Web SSO Super accounts detected as Free — tier probe, quota sync & model discovery
2026-07-13 17:53:20 +08:00
li bac1b2aa15 fix: resolve merge conflict — adopt upstream multi-provider sync
Upstream already fixed Bug 3 (model sync for Web accounts) by
refactoring syncAllAccounts to iterate both ProviderBuild and
ProviderWeb. Drop our Web-specific sync code in favor of upstream's
generic implementation.

Remaining fixes (Bug 1 & 2):
- quota.go: basic tier re-probe + auto mode secondary detection
- account/service.go: real tier detection instead of hardcoded basic
2026-07-13 17:47:35 +08:00
li 4f347077ca fix: Web SSO tier detection, quota re-probe, and model sync for Web accounts 2026-07-13 17:19:36 +08:00
Chenyme 90c3320638 feat: Enhance account synchronization by supporting both Build and Web providers, and improve progress reporting in the sync pipeline 2026-07-13 17:06:21 +08:00
Chenyme ec6cddca7d docs: Enhance README.md with detailed configuration information and update SQLite connection settings in database.go v3.0.0 2026-07-13 15:34:33 +08:00
Chenyme a16837c9ea feat: Refactor the project using Go to support Grok Build & Grok Web. 2026-07-13 15:28:07 +08:00
Chenyme a393a95ebb Update README.md 2026-07-12 13:05:55 +08:00
Chenyme e1bc5bc5f5 docs: Update README files to announce project discontinuation 2026-06-09 17:17:04 +08:00
Chenyme 5805cbb5a0 Merge pull request #567 from KK1aus/fix/statsig-id-format
fix: correct x-statsig-id format to bypass anti-bot rules
2026-06-03 14:18:02 +08:00
KK1aus 701525856a fix: correct x-statsig-id format to bypass anti-bot rules
The grok.com frontend's fetch interceptor generates x-statsig-id by
running a Statsig SDK evaluation per request. When that evaluation
fails (headless, first paint, etc.), it falls back to:

    btoa("x1:" + error.toString())

The old code used the prefix "e:" instead of "x1:", which Grok's
anti-bot now detects and rejects with HTTP 403.

Verified against 3 SSO tokens — all return 200 on app-chat endpoints.

Fixes #562
2026-06-03 11:23:08 +08:00
Chenyme 64a71f16e0 Merge pull request #521 from chenyme/optimise
feat: Introduce Imagine Public Image Proxy feature
v2.0.4.rc4
2026-04-28 18:04:56 +08:00
Chenyme f063dfc385 refactor: Improve video reference upload handling with better error reporting 2026-04-28 18:01:07 +08:00
Chenyme 0afce0e9d2 feat: Introduce Imagine Public Image Proxy feature 2026-04-28 17:51:34 +08:00
Chenyme b45511f563 Merge pull request #518 from chenyme/ban_bench
feat: Add batch token disable and restore functionality
2026-04-28 14:34:51 +08:00
Chenyme f9576cce17 feat: Add batch token disable and restore functionality 2026-04-28 14:31:20 +08:00
Chenyme 65a735b227 Merge pull request #515 from Yi-Long-Zhang/main
feat: Increase image-to-video reference image limit from 5 to 7
2026-04-28 14:23:11 +08:00
Chenyme f6003825a9 Merge pull request #517 from chenyme/basic_adjust
refactor: Update account refresh interval and adjust model tiers
2026-04-28 14:19:00 +08:00
Chenyme 1c38f340c3 refactor: Update basic account refresh interval to 86400 seconds and adjust model tiers to use super instead of basic 2026-04-28 14:17:32 +08:00
grimpeur 75ec98c45d Increase image-to-video reference image limit from 5 to 7
- update /v1/videos multipart input_reference[] handling
- update chat-based video reference extraction
- sync Chinese and English docs
2026-04-25 00:28:41 +08:00
Chenyme ae9b5b979d Merge pull request #513 from Huan-zhaojun/pr/fix/remove-unreviewed-pr473-code
fix: 移除 PR #473 夹带的未审查代码(3 项已确认缺陷)
2026-04-24 22:29:40 +08:00