Repository navigation
v0.1.34
Release Notes — v0.1.34
Retryable Responses response.failed events are now absorbed instead of streamed
- What you saw. A relay under rate-limit or concurrency pressure returned a Responses SSE whose only terminal was a retryable
response.failed(rate_limit_exceeded,Concurrency limit exceeded, overload). hellogrok streamed that failure to Grok Build immediately, so the turn failed even though a retry seconds later would have succeeded — and the retry then opened a second stream for the same request. - What changed. While nothing has been written to the client, such a failed-only SSE is now withheld inside the absorb window (response headers and early frames stay buffered, up to 32 frames) and replayed with the same exponential backoff and
Retry-Afterhandling as HTTP soft failures. Grok Build keeps its full retry budget; only an exhausted window passes the failure through, still retryable.absorb_retry_max_secs = 0streams the failed event immediately. Deterministicresponse.failedevents (authentication, invalid request/model) still stream through without retry. - Retry classification widened. Concurrency-limit rejections (
concurrency,concurrency limit, plus the corresponding Chinese phrases) now classify as transient, and error envelopes nested underresponse.errorare recognized the same as top-levelerrorobjects.
Client disconnects no longer become stream errors
- What you saw. Closing a Grok Build session mid-stream could leave a
proxy_stream_errorin the log or on a late reader, suggesting an upstream failure that never happened. - What changed. Messages, Chat Completions, native, and Responses streams now distinguish a client abort (failed client write, canceled request context) from an upstream failure: aborts are logged as
aborted by clientand emit no stream error. Truly truncated upstream streams still emitproxy_stream_error.
Strict errors for stream-shape mismatches
- An SSE response to a non-streaming request, or a streaming response to Grok Build's fixed non-streaming WebSearchClient request, now returns a non-retryable
502naming the mismatch instead of forwarding an undecodable body.
Quieter, safer diagnostics
- Upstream HTTP errors and Responses
response.failed/errorevents are logged as structured summaries (type,code,message) with bearer tokens, key assignments, andsk-values redacted and long messages truncated. - Benign upstream-model mismatches log once per channel/protocol/configured/upstream pair; conflicts and invalid declarations always log.
- When Grok Build sends an official catalog name such as
grok-4.6on a non-xAI custom channel, the proxy logs a warning with body size, tool count, and session presence to aid/resumediagnosis. First-partyapi.x.airoutes and custom IDs such asgrok4.6-sevnxare excluded.
Restart both hellogrok executables after upgrading.
发布说明 — v0.1.34
可重试的 Responses response.failed 事件现在会被吸收,而不是直接透传
- 你看到的现象。 中转在限流或并发压力下返回的 Responses SSE,其唯一终态是可重试的
response.failed(rate_limit_exceeded、Concurrency limit exceeded、过载)。此前 hellogrok 会立即把该失败透传给 Grok Build,本轮直接失败——而几秒后重试本可成功;重试还会为同一请求再开一条流。 - 本次变更。 在尚未向客户端写入任何内容时,这类“只有失败终态”的 SSE 现在进入吸收窗口:响应头和早期帧先缓冲(最多 32 帧),并按与 HTTP 软故障相同的指数退避与
Retry-After规则在代理内重放。Grok Build 的重试预算分毫不动;只有窗口耗尽后才以可重试形式透传。absorb_retry_max_secs = 0则直接透传该失败事件。确定性response.failed(鉴权、无效请求或模型)仍直接透传,不重试。 - 重试分类放宽。 并发限制拒绝(
concurrency、concurrency limit及对应中文“并发限制/并发超限”)现在归为瞬态故障;嵌套在response.error下的错误信封与顶层error同等识别。
客户端断开不再被记为流错误
- 你看到的现象。 在流式传输中途关闭 Grok Build 会话,日志或迟到的读取者可能看到
proxy_stream_error,像是上游出了故障,而实际只是客户端已离开。 - 本次变更。 Messages、Chat Completions、原生与 Responses 流现在区分客户端中止(客户端写入失败、请求上下文取消)与上游故障:中止只记录为
aborted by client,不产生流错误。上游真正截断的流仍会产生proxy_stream_error。
流形态不匹配现在明确报错
- 非流式请求收到 SSE 响应,或 Grok Build 固定的非流式 WebSearchClient 请求收到流式响应时,返回不可重试的
502并说明不匹配原因,不再转发无法解码的正文。
更安静、更安全的诊断日志
- 上游 HTTP 错误与 Responses
response.failed/error事件按结构化摘要(type、code、message)记录;bearer 令牌、key 赋值和sk-值会被脱敏,超长消息会被截断。 - 良性上游模型不一致按渠道/协议/配置模型/上游模型组合只记录一次;冲突与无效声明每次都记录。
- 当 Grok Build 在非 xAI 自定义渠道上发送
grok-4.6这类官方目录名时,代理会记录一条警告(含请求体大小、工具数量和会话状态),便于诊断/resume选路。官方api.x.ai路由与grok4.6-sevnx这类自定义 ID 不在警告范围内。
升级后请重启两个 hellogrok 可执行文件。