feat(audit): finalize incomplete http requests - #78
Open
P4ST4S wants to merge 1 commit into
Open
Conversation
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Summary
Complete terminal audit finalization for HTTP requests that do not receive and deliver a normal JSON-RPC response.
Accepted operations now receive one terminal outcome for upstream connection failures, timeouts, malformed or incomplete responses, SSE failures, request cancellation, and client disconnects.
Context
Implements the HTTP portion of #69. Together with #77, this completes the issue scope.
Stacked on #74 only.
Approach
timeout,client_disconnect,cancelled, andupstream_errorfrom context and transport errorsmalformed_upstream_responseupstream_errorForwarding behavior is unchanged. Audit inspection and storage failures remain separately logged and never replace or drop the proxied message.
Test plan
go test -race ./internal/proxy/... ./internal/audit/...go test -race ./...go build ./...go vet ./...All commands pass.
Tests cover connection refusal, upstream timeout, client cancellation, malformed response bodies, incomplete SSE, client write failure, and failed notifications.
Stability impact
No existing field or JSON-RPC error-code semantics change. The additive
outcomeandaudit_operation_idfields introduced by #74 are now populated on HTTP failure paths that previously produced no terminal audit entry.HTTP notifications are now recorded only after the upstream result is known, preventing a false
successaudit event when forwarding fails.Notes for reviewer
The stdio and HTTP work are deliberately separate review units. #77 contains the corresponding stdio lifecycle changes.