feat(gateway): harden failover and payload handling

Retry pre-response transport failures across candidates with an explicit stop policy, and propagate end-to-end timing into usage records and UI diagnostics.

Remove legacy body, import, cookie, PII, and tunnel replay caps while preserving optional operator-configured gateway limits.
This commit is contained in:
elky
2026-07-30 01:03:27 +08:00
parent a97acc07fc
commit a04673a90d
80 changed files with 3640 additions and 1236 deletions
@@ -165,7 +165,7 @@ impl UsageBodyCaptureEngine {
apply_usage_body_capture_limit(
UsageBodyField::RequestBody,
"request",
self.policy.max_request_body_bytes,
None,
payload.request_body,
payload.request_body_ref,
payload.request_body_state,
@@ -174,7 +174,7 @@ impl UsageBodyCaptureEngine {
apply_usage_body_capture_limit(
UsageBodyField::ProviderRequestBody,
"provider_request",
self.policy.max_request_body_bytes,
None,
payload.provider_request_body,
payload.provider_request_body_ref,
payload.provider_request_body_state,
@@ -183,7 +183,7 @@ impl UsageBodyCaptureEngine {
apply_usage_body_capture_limit(
UsageBodyField::ResponseBody,
"response",
self.policy.max_response_body_bytes,
None,
payload.response_body,
payload.response_body_ref,
payload.response_body_state,
@@ -192,7 +192,7 @@ impl UsageBodyCaptureEngine {
apply_usage_body_capture_limit(
UsageBodyField::ClientResponseBody,
"client_response",
self.policy.max_response_body_bytes,
None,
payload.client_response_body,
payload.client_response_body_ref,
payload.client_response_body_state,