Repository navigation
Conversation
Contributor
|
This pull request has had no activity for 7 days. It will be closed in 7 days if there is no further activity. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Grok Web requests can remain active without useful generation when the WebSocket keeps sending control frames. Closing a downstream Web response can also leave its producer blocked on the upstream body until a separate timeout fires.
Both failures reproduce against current
mainusing local fixtures, without a Grok account, proxy, CDN, or external network:pongevents for 1.4 seconds and then completes. Currentmaintreats the response as successful because every control frame resets the raw-byte idle timer.Changes
The Web path no longer needs a second raw-byte idle timer around its pipe. A cancellation callback closes the WebSocket even when a read is blocked.
Scope
This is limited to Grok Web text-response lifecycle handling. It does not change configured timeout values, retry limits, account selection policy, credentials, proxy configuration, or downstream heartbeat behavior. It does not claim to repair an upstream search that stops producing useful events.
Build already has semantic idle protection and downstream-backpressure handling in #923 and #1026. #1021 handles audit classification after a client interruption; this PR completes closure propagation in the Web producer. The separate degraded-search-content guard in #1105 addresses a different failure mode.
Validation
main(8535932b0783db2033657f36e2e1a84196c4e151):TestWebNonStreamingControlFramesDoNotResetIdleTestWebStreamCloseReleasesBlockedUpstreamgo test -p 4 ./...passes.go test -race ./internal/infra/provider/web ./internal/infra/provider/streamidle ./internal/pkg/neterrorpasses.go test -race ./internal/application/gateway ./internal/transport/http/inferencepasses.-race.go vet ./internal/infra/provider/webandgit diff --checkpass.Tests cover useful text/reasoning/search activity, duplicate/no-ID search results, control-only stalls, downstream backpressure, explicit cancellation, upstream close idempotency, and absence of egress-health feedback after a client close. Validation used Go 1.27.4; the module's Go requirement is unchanged.