Repository navigation
Keep only the current WebSocket message in the secrets proxy - #79
Merged
Merged
Conversation
mitmproxy keeps every message of a WebSocket connection for its life, so a long Codex session grows the proxy without bound (DRU-888). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ENMdnx74hgYh4bWfsm44WV
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.
Requested by Paulo · project thread
Before: mitmproxy keeps every message of a WebSocket connection for the connection's life. A long Codex session grows the proxy without a limit (DRU-888).
After: the
websocket_messagehook drops all messages but the current one. The dumper (flow_detail=1) runs after the script addons and readsmessages[-1], so the current message stays.How: one hook in
deploy/proxy/swap.py, one unit test.Local run with mitmproxy 12.2.3, a real
mitmdumpwith this addon, and a WebSocket echo server; 128 round trips of 1 MiB:Text, binary, fragmented and permessage-deflate messages and the close (1000) passed, and every echoed payload was byte-equal. A real Codex call through production is still to do.
Generated by Claude Code