xAI now reports SuperGrokPlus with zero weekly numeric limits, so the
allowlist missed it and Build routing classified those accounts as unknown.
Co-authored-by: Cursor <cursoragent@cursor.com>
A looping upstream stream burns account quota and the client context window
until the response budget is exhausted. Track consecutive identical deltas
and terminate the stream once a channel exceeds its ceiling.
Content and reasoning keep separate counters. high/xhigh effort reasoning
legitimately repeats the same short marker ("so", "hmm", "wait", list
bullets) far more often than visible output does, so a single shared
counter truncates valid deep-thinking responses. Reasoning is therefore
allowed a higher ceiling (256) than visible content (128).
The content ceiling also has to clear legitimate visible repetition:
markdown horizontal rules and ASCII table borders stream as long runs of
an identical single-character delta ("-", "=", "|").
3s hold cuts encrypted thinking that arrives at end-of-stream, which
fills audits with HTTP 200 · error and quality_degraded retries.
Match the production lab defaults: 30s hold, minOutput 8, 12h
missing-thinking cooldown, 15m idle cooldown, grok-4.6 probe model.
requestRetry.enabled stays false in built-in Go defaults so existing
configs do not flip on upgrade; config.example.yaml now recommends it on.
TUI 0.2.93 treats any response.incomplete as fatal max_tokens_truncation,
ignoring incomplete_details.reason, so stream aborts killed the turn.
serde also requires model on response.failed / completed; a missing key
fails deserialization. Always emit response.failed and fill model from
stream metadata or the last seen response event.
Grok TUI tools run locally. The next /v1/responses body already contains
function_call_output; retrying it on another account only regenerates the
model turn and does not re-execute tools. Skipping hold on that body let
0-thinking dumps through on the common agent loop.
TUI 0.2.93 treats any response.incomplete as fatal max_tokens_truncation,
ignoring incomplete_details.reason, so stream aborts killed the turn.
serde also requires model on response.failed / completed; a missing key
fails deserialization. Always emit response.failed and fill model from
stream metadata or the last seen response event.
Grok TUI tools run locally. The next /v1/responses body already contains
function_call_output; retrying it on another account only regenerates the
model turn and does not re-execute tools. Skipping hold on that body let
0-thinking dumps through on the common agent loop.
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
response.completed / [DONE] with zero tokens used to keep the quality
hold in Wait until the idle timeout. The client already had HTTP 200
headers and saw a 50–120s Retrying spinner.
Finish the peek immediately and surface errQualityEmptyStream so the
attempt loop rotates. Open empty hangs still wait for idle and do not
fail-open as HTTP 200.
Grok TUI declares a tools array on every agent request, including the
first thinking turn. Skipping hold on that schema forwarded
missing-thinking streams as HTTP 200.
Keep the replay-safety skip for in-flight tool output
(function_call_output, tool_result, role=tool). Compact skip and
previous_response_id pinning are unchanged.
Grok CLI treats annotations as a required field. A missing key fails
deserialization with "missing field annotations" and the TUI retries
the turn. Keep existing citation arrays untouched.
Usage.reasoning_tokens, empty reasoning items, and the Chat SSE stub
are not proof of thinking. Degraded upstreams fill those fields and
then dump visible tokens, so the hold used to fail-open as 200.
Require reasoning/summary deltas or encrypted_content before delivering.
An empty stub waits until terminal so ciphertext that arrives at the end
is not withheld.
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
response.completed / [DONE] with zero tokens used to keep the quality
hold in Wait until the idle timeout. The client already had HTTP 200
headers and saw a 50–120s Retrying spinner.
Finish the peek immediately and surface errQualityEmptyStream so the
attempt loop rotates. Open empty hangs still wait for idle and do not
fail-open as HTTP 200.
Grok CLI treats annotations as a required field. A missing key fails
deserialization with "missing field annotations" and the TUI retries
the turn. Keep existing citation arrays untouched.
Grok TUI declares a tools array on every agent request, including the
first thinking turn. Skipping hold on that schema forwarded
missing-thinking streams as HTTP 200.
Keep the replay-safety skip for in-flight tool output
(function_call_output, tool_result, role=tool). Compact skip and
previous_response_id pinning are unchanged.
Usage.reasoning_tokens, empty reasoning items, and the Chat SSE stub
are not proof of thinking. Degraded upstreams fill those fields and
then dump visible tokens, so the hold used to fail-open as 200.
Require reasoning/summary deltas or encrypted_content before delivering.
An empty stub waits until terminal so ciphertext that arrives at the end
is not withheld.