fix(egress): restart dead daemons and cap inbound scan body size #466

Merged
didericis merged 3 commits from fix/egress-oom-455 into main 2026-07-23 20:15:21 -04:00

3 Commits

Author SHA1 Message Date
didericis-codex 2879dc34cc test(gateway): cover single and simultaneous daemon crashes
tracker-policy-pr / check-pr (pull_request) Successful in 12s
test / integration-docker (pull_request) Successful in 34s
test / unit (pull_request) Successful in 45s
lint / lint (push) Successful in 53s
test / integration-firecracker (pull_request) Successful in 3m13s
test / coverage (pull_request) Successful in 17s
test / publish-infra (pull_request) Has been skipped
2026-07-23 19:33:03 -04:00
didericis-codex 5ded28896d fix(gateway): restart dead children before completion check 2026-07-23 19:33:03 -04:00
didericis-claude 1fd79dda9a fix(egress): restart dead daemons and cap inbound scan body size (#455)
Two complementary fixes for the egress gateway OOM:

1. gateway_init: auto-restart any daemon that dies unexpectedly. The
   supervisor already had restart_daemon()/request_restart() logic; this
   wires it into tick() so an OOM-killed mitmdump is respawned without
   operator intervention. Implements the "eventual" failure policy
   described in the original module docstring.

2. egress_addon: cap response body bytes passed to the DLP inbound scan
   at EGRESS_INBOUND_SCAN_LIMIT_BYTES (default 1 MiB). mitmproxy buffers
   the full response before the hook fires; capping at scan time limits
   the additional amplification from decoded text and regex strings. Bodies
   over the limit emit an egress_scan_truncated log event. Set to 0 to
   disable the cap.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-23 19:33:03 -04:00