Connect policy-gated browser review and audit runtime

Assistant: codex
Assistant-Model: gpt-6-astra
Assistant-Session: 01a07ff8-19d0-7820-b4d0-1353833cb7fc
This commit is contained in:
tegwick 2026-09-11 00:31:03 +02:00
parent 2cc32168ac
commit 83849b75d4
35 changed files with 2381 additions and 83 deletions

View file

@ -64,9 +64,18 @@ class JSONTransport:
raise TransportError("upstream redirect refused")
raw = response.read(262145)
if len(raw) > 262144:
if status >= 400:
return status, {} # Refusal status is known; discard the body.
raise TransportError("upstream response too large")
result = json.loads(raw)
try:
result = json.loads(raw)
except (ValueError, UnicodeError):
if status >= 400:
return status, {} # Flex Auth's caller gate uses plain HTTP errors.
raise
if not isinstance(result, dict):
if status >= 400:
return status, {}
raise TransportError("upstream object required")
return status, result
except (URLError, OSError, ValueError, HTTPException):