29 Commits
Author SHA1 Message Date
Chenyme f97be4e553 fix: preserve output-loop code across audits and SSE 2026-08-31 20:49:01 +08:00
Chenyme c6acb00e0f Merge branch 'main' into pr/1027
# Conflicts:
#	backend/internal/application/gateway/service_test.go
#	backend/internal/transport/http/inference/handler.go
2026-08-31 18:53:19 +08:00
Chenyme 95722d2992 Merge pull request #1025 from buddhism5080/fix/reasoning-replay-cross-account-no-content-null
fix(cli): share reasoning replay across accounts and omit content:null
2026-08-31 18:19:19 +08:00
buddhism5080 5b3e7efa1f fix(inference): classify output-loop guard as upstream_output_loop
Doom-loop aborts were wrapped as a generic stream read failure, so audits
and SSE trailers reported upstream_stream_interrupted. Keep the sentinel
distinct so a model repeating the same delta is not mixed with a transport
cut.
2026-08-29 20:22:00 +08:00
buddhism5080 2d0b621034 fix(cli): share reasoning replay across accounts and omit content:null
Encrypted reasoning is portable across accounts, so the server cache key
is session+plane only. Injected items drop content:null; xAI treats that
extra key as a modified compaction blob and 400s.
2026-08-29 15:53:01 +08:00
buddhism5080 acc0fb5361 fix(audit): distinguish client vs upstream stream interrupts
After a 2xx SSE handoff, a client hangup is client_stream_interrupted and keeps the upstream status. upstream_stream_interrupted is only for an upstream cut. Pre-header 499 request_canceled is unchanged.
2026-08-29 05:57:47 +08:00
Chenyme d7fca59d68 fix: cool accounts after non-streaming idle responses 2026-08-25 18:10:57 +08:00
Chenyme d76c74f407 feat: record trusted client IPs 2026-08-19 15:06:17 +08:00
Chenyme 7521223143 fix: harden Clash parsing and preserve tunnel ALPN 2026-08-15 10:36:37 +08:00
WuxiVIP 543fb5786e feat(proxy): support VLESS Reality Vision
Encode the Vision flow addon and honor Reality ClientHello fingerprints. Reject presets without X25519 TLS 1.3 key shares and preserve explicit ALPN.
2026-08-14 13:11:03 +08:00
Chenyme 2b1f53ce9f fix: unify safe video download filenames and extensions 2026-08-14 09:58:29 +08:00
Chenyme 90b408841a refactor: enhance proxy configuration and validation 2026-08-13 19:39:57 +08:00
WuxiVIP 4cfa751c0f fix(egress): add real tunnel proxy dialers
Parse and normalize Trojan, VLESS, Shadowsocks, and VMess share links, then route Build, browser, pinned HTTPS, and subscription fetch traffic through embedded dialers. Update validation, UI help, redaction, docs, and protocol coverage tests.

Hysteria and TUIC remain unsupported and are intentionally deferred.
2026-08-10 17:02:22 +08:00
Chenyme 1955803818 Merge branch 'main' into feat/media-image-ingest 2026-08-07 15:50:36 +08:00
Chenyme 44c1bbda31 feat: add transient image staging for reliable video inputs 2026-08-07 15:49:02 +08:00
Chenyme e95a5bc523 feat: add multi-Provider streaming idle timeout protection 2026-08-07 11:29:21 +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 b4c7baabb7 feat: enhance Build account detection with improved error classification and handling 2026-08-03 17:42:42 +08:00
Chenyme cc578d551c fix: make response header timeout hot-reloadable and migration-safe 2026-07-23 02:36:45 +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 9c583fd167 perf: finalize concurrency safety and infrastructure validation 2026-07-23 00:19:22 +08:00
Chenyme 603176c31c feat: implement build bot flag caching and model synchronization improvements 2026-07-18 11:25:54 +08:00
Chenyme c050086530 refactor: update reasoning replay cache configuration 2026-07-18 01:43:52 +08:00
yang 90b5e6b2a3 fix: prevent slice capacity overflow in reasoning replay insert
Address CodeQL high alert on PR #676: guard len(input)+len(replayItems)
before make() with overflow/size bounds check.
2026-07-17 23:28:25 +08:00
yang d55eb6eab7 feat: add server-side reasoning replay cache for multi-turn Grok Build
对齐 CLIProxyAPI 的 xAI Reasoning Replay:在客户端不回传 thinking
signature / encrypted_content 时,由网关代持并注入上一轮可回放 items。

变更摘要:
- 新增 ReasoningReplayRepository 与 Memory/Redis 实现
- 新增 pkg/reasoningreplay:normalize/filter/insert/store/apply/capture
- CLI Adapter:出站前 Apply,成功响应 CaptureBody 写回;compact 清理
- 配置 routing.reasoningReplayEnabled/TTL/maxEntries(默认开启)
- settings 热更新时保留回放配置;补充改造文档与场景单测

不包含:通用 HTTP 响应缓存、Console/Web 路径、管理端 UI 开关。
2026-07-17 18:07:04 +08:00
Chenyme d2eecc4041 feat: Improved gateway multi-Provider routing and runtime concurrency management. 2026-07-15 10:58:25 +08:00
Chenyme 9244306352 fix: separate Grok Build and Web proxy transports 2026-07-13 23:21:07 +08:00
Chenyme d626a26db4 feat: Implement model quota management and enhance routing candidate selection 2026-07-13 22:02:55 +08:00
Chenyme a16837c9ea feat: Refactor the project using Go to support Grok Build & Grok Web. 2026-07-13 15:28:07 +08:00