81 Commits
Author SHA1 Message Date
Chenyme 838aca3c8f chore: bump version to v3.1.8 and implement auto-delete feature for unlinked Console accounts 2026-10-21 19:22:41 +08:00
Chenyme 659ee8ca69 refactor: enhance request retry configuration and auto-disable logic; update documentation and tests for clarity 2026-10-15 13:44:11 +08:00
inter 6c19399527 feat(gateway): auto-disable degraded accounts 2026-10-04 22:22:31 +08:00
buddhism5080 f0044b76b6 fix: cap Grok Web free-account video duration before upstream
Free Web accounts 429 when duration exceeds 6s, which then rotates
accounts without changing the payload. Add a Grok Web setting
(freeVideoDurationCap, default 6) and clamp duration for free-tier
accounts at the Web adapter so retries are not wasted.
2026-08-31 16:04:05 +08:00
lij768423-svg f343670fa7 fix: treat short encrypted_content stubs as missing thinking
Non-empty ciphertext is not proof of reasoning. HasThinking now requires
encrypted_content / Anthropic signature to meet max(256B, 4 bytes per
usage reasoning token). A hold-expired short greeting billed as heavy
thinking, or a barely-over-floor flush in under a second, is withheld.

Recommended requestRetry values stay 30s / minOutput 8 / 6 attempts /
fail_closed / 12h / 15m idle, plus the new floor knobs. enabled remains
false so stock installs do not intercept.
2026-08-27 19:03:27 +08:00
Chenyme af5dec368d fix: reconcile stale Grok Console quota after 429 2026-08-24 16:48:13 +08:00
Chenyme 1316ed730b feat: add privacy-safe request diagnostics and bounded retention 2026-08-20 19:45:35 +08:00
Chenyme c07fa0b61e Merge remote-tracking branch 'origin/main' into pr/983
# Conflicts:
#	backend/internal/transport/http/inference/handler.go
2026-08-20 19:40:37 +08:00
Jeik 86010fc55c feat(audit): add response body recording, stream reassembly, and audit log retention settings 2026-08-20 10:36:07 +08:00
lij768423-svg 78c17a83b3 fix: allow clearing account cooldown and configure empty-stream penalty
Empty SSE idle timeouts currently write a hardcoded 24h cooldown via
qualityIdleAccountCooldown. Toggling enabled does not reset health, so a
single-account pool stays on 429 upstream_cooling until the operator
edits sqlite and restarts.

Add POST /api/admin/v1/accounts/:id/clear-cooldown (API + UI) which
zeros failure_count/cooldown_until/last_error. UpdateHealth already
publishes InvalidationAccountHealthChanged, so runtimeStore=memory
selector overlays are replaced.

Expose qualityGuard.requestRetry.idleAccountCooldown (1m–168h, default
24h) independently of missing-thinking accountCooldown. PATCH enabled
while cooling returns enabledDoesNotClearCooldown so the UI can warn.

Closes #976
2026-08-20 02:38:32 +08:00
Chenyme d76c74f407 feat: record trusted client IPs 2026-08-19 15:06:17 +08:00
lij768423-svg 2ef3b0ac2f feat: cool missing-thinking accounts and list them in quality guard
First no-thinking withhold puts the account on a 24h scheduling
cooldown without disabling it. A later miss after that cooldown
expires disables the account. Quality-guard degrade-accounts now
includes quality_degraded retries as missing_thinking so operators
can see the rotated accounts.
2026-08-19 11:42:50 +08:00
Chenyme 43b17d866c Merge branch 'main' into pr/959
# Conflicts:
#	backend/internal/infra/config/config.go
2026-08-18 17:31:09 +08:00
lij768423-svg 506b4e46f9 feat: withhold missing-thinking streams and retry another account
Hold thinking-model SSE until reasoning appears or enough visible
output arrives with none. Do not deliver that first body; switch
accounts up to five more times. After six misses, fail closed with
503 instead of sending a no-thinking reply. Default off.
2026-08-18 09:26:35 +08:00
lij768423-svg ae05b4f749 feat: bound auto-assign share and per-cycle migrations
Add optional routing.autoAssignMaxNodeShare and
autoAssignMaxMigrationShare. Default 0 keeps the historical unbounded
first-pass evacuation and the existing 200-move repair ceiling. Values
in [0.05, 1] cap how many active accounts one healthy node may absorb
and how many already-bound accounts may move in one cycle.
2026-08-17 22:20:01 +08:00
WuxiVIP a2b21c00e7 fix(cli): enforce semantic stream idle timeout 2026-08-14 10:55:18 +08:00
lindahao 6ac4f0b858 feat: add standalone video max attempts for create-phase failover
Video generation often runs long, and frequent 429s during create make a dedicated retry/switch budget more valuable than waiting on a single limited account. Add routing.videoMaxAttempts as a number-or-unlimited setting used only for video create-phase account failover, keep poll pinned after create succeeds, surface real upstream statuses such as 429 in video audits, and mark provider create/poll stages so retries stay safe.
2026-08-13 21:47:40 +08:00
Chenyme bb42745e6d feat: harden Console voice and image/video compatibility 2026-08-13 16:55:29 +08:00
lindahao cf700b3f30 fix: use official grok-stt model id for Console speech-to-text
Official xAI audio catalog exposes grok-stt for STT, not grok-transcribe.
Align catalog, defaults, docs, and creative console fallback accordingly.
2026-08-12 15:50:08 +08:00
lindahao 4fe04ef623 feat: add console image 2.0 and full voice surfaces
Expose Console Imagine Image 2.0 aliases, TTS/STT/realtime/custom-voice
gateway routes, and creative-console voice controls while keeping the
existing web-image-2.0 customizations.
2026-08-12 15:26:00 +08:00
lindahao c93cabbf71 fix: expose Console grok-imagine-video-1.5 for free accounts
Move video 1.5 onto the Console catalog/media path instead of Build free
capability injection. Gateway now forwards the selected upstream video
model, and Console GenerateVideo sends grok-imagine-video-1.5 upstream.
Build free accounts again follow the original Super-only 1.5 rule.
2026-08-12 15:25:48 +08:00
Chenyme 9c1e694a4c Merge remote-tracking branch 'origin/main' into pr/877
# Conflicts:
#	frontend/src/shared/i18n/index.ts
2026-08-07 17:36:54 +08:00
Chenyme 70615cbfd9 fix: harden bot-risk Build scheduling exclusion 2026-08-07 17:33:04 +08:00
Chenyme e95a5bc523 feat: add multi-Provider streaming idle timeout protection 2026-08-07 11:29:21 +08:00
buddhism5080 b8b22d785f fix(accounts): reduce Build available count when excluding bot-risk
When excludeBuildBotFlaggedFromScheduling is on, account summary
available for grok_build subtracts currently schedulable bot-flagged
accounts so the accounts page routable count matches scheduling.
2026-08-06 23:19:34 +08:00
buddhism5080 f99abbe91f feat(accounts): optional exclude bot-risk Build accounts from scheduling
Add an Account maintenance toggle that removes Build accounts with
bot_flag_source/bfs in {1,2} from ProviderBuild candidate selection only.
Linked Web/Console scheduling is unchanged; accounts stay in the pool.
2026-08-06 23:01:15 +08:00
WuxiVIP ea18bb8622 feat: add configurable Grok Build stream idle timeout
Add a streamIdleTimeout setting (default 2m, range 30s–10m) to the Grok
Build runtime settings. When a streaming response goes silent for the
configured duration, the request context is cancelled and the read aborts
with a new upstream_stream_idle_timeout error code — instead of hanging
for ~10 minutes until the caller's context deadline fires.

The idle deadline is enforced via an idleTimeoutReadCloser body wrapper
injected at the egress transport layer, covering both the managed-client
and direct-fallback paths. Each successful Read resets the timer, so a
slow-but-steady stream is never interrupted. The wrapper uses
context.WithCancelCause so the Go transport unblocks the in-flight body
read on timeout.

Idle-timeout aborts do not degrade account health (the new error code is
excluded from isUpstreamStreamFailure) and are exempt from egress-node
cooldown, matching the existing treatment of response-header timeouts.

Mirrors the full responseHeaderTimeout pipeline: domain constants, config
struct/validation/default, settings service conversions, HTTP DTO, DB
backfill migration, egress manager atomic field + hot-reload + cache-key
fold, CLI adapter Config field, app assembly wiring, and frontend
types/model/UI/i18n.
2026-08-06 21:31:46 +08:00
Chenyme a05e06a20c feat: enhance console provider integration and improve quota handling for media routes 2026-08-05 16:25:25 +08:00
Chenyme 377710f4ae refactor: unify quota refresh handling and introduce console usage migration 2026-08-05 13:32:32 +08:00
Chenyme 0aa728bf95 fix: harden large account pool queries and candidate caching 2026-08-04 20:50:38 +08:00
buddhism5080 42b7556a5f feat(egress): isolate upstream TCP pools by account
Add a hot-reloadable routing switch so different accounts no longer share
the same upstream HTTP/TCP client pool, while the same account keeps
connection reuse. This helps upstream egress load balancers spread
traffic by connection across Build/Web/Console outbound calls.
2026-08-04 16:37:38 +08:00
Chenyme 1d62978af3 Merge remote-tracking branch 'origin/main' into pr/837
# Conflicts:
#	backend/internal/application/gateway/failure_test.go
#	backend/internal/application/gateway/service.go
2026-08-04 14:54:16 +08:00
Chenyme 69e5fdd82f feat: integrate egress quality guard with managed identity and Compose 2026-08-04 14:48:50 +08:00
lij768423-svg 137589c33c feat: add egress recovery and quality guard 2026-08-01 02:24:59 +00:00
night2049 bcc6435f61 feat: improve Build account detection and routing failover 2026-07-30 01:21:27 +08:00
Chenyme f2676e8a18 feat: add client key routing scopes with fail-closed enforcement 2026-07-28 14:43:53 +08:00
Chenyme ed0b5da080 perf: reduce database I/O with deferred credential hydration 2026-07-27 15:58:07 +08:00
put-go 0de70e0fd9 feat: split egress probes by IP family 2026-07-26 11:06:35 +08:00
Chenyme 1a7f0acc59 refactor: update ListRoutingCandidates and related methods to include modelRouteID parameter for improved routing candidate selection 2026-07-25 13:01:23 +08:00
Chenyme 09388e5634 feat: add configurable Grok Build 403 invalidation rules 2026-07-23 14:54:12 +08:00
Chenyme cc578d551c fix: make response header timeout hot-reloadable and migration-safe 2026-07-23 02:36:45 +08:00
Chenyme a4d2111692 perf: harden billing ledger recovery and bound quota refresh memory 2026-07-23 01:42:37 +08:00
Chenyme 87f58a231e Merge remote-tracking branch 'origin/main' into high_concurrency
# Conflicts:
#	backend/internal/infra/egress/manager.go
2026-07-23 01:36:11 +08:00
Chenyme 34afed0a34 feat: implement operations config invalidation and enhance fallback management 2026-07-23 01:24:41 +08:00
Chenyme 413eb39667 perf: reduce cached acquisition contention with immutable snapshots and atomic load tracking 2026-07-23 00:21:50 +08:00
Chenyme 858509b7cb perf: finalize large-pool segmented selection and remove shadow mode 2026-07-23 00:21:03 +08:00
Chenyme 1e709595f9 perf: add typed invalidation and layered candidate caching 2026-07-23 00:21:03 +08:00
Chenyme 8695bb629f perf: batch acknowledged writes and atomic billing settlement 2026-07-23 00:20:03 +08:00
Chenyme 275053700e perf: harden response cleanup, cross-instance model state, and egress cache invalidation 2026-07-23 00:20:03 +08:00
Chenyme 9c583fd167 perf: finalize concurrency safety and infrastructure validation 2026-07-23 00:19:22 +08:00