Repository navigation
fix(egress-gateway): start proxy with explicit arguments - #1774
Open
MakerFlyFly wants to merge 1 commit into
Open
MakerFlyFly wants to merge 1 commit into
MakerFlyFly wants to merge 1 commit into
Conversation
Pass CLI arguments to Proxy(input_args=...) and use its context manager with the zero-argument sleep loop supported by proxy.py 2.4.x. Preserve dependency-free help through lazy package exports, add isolated startup and lifecycle regressions, and document usage and verification. Generated-by: Codex (GPT-6)
Contributor
Author
|
While testing this change I found a few issues in the gateway CLI. They predate this fix (they were unreachable while startup was broken) and are outside its scope. I'll open issues for them later and link them here. |
Comment on lines
+154
to
+155
| "import sys\nsys.modules['proxy'] = None\n" | ||
| "from egress_gateway.cli import main\nmain(['--help'])\n", |
| import pytest | ||
| from proxy.http.proxy import HttpProxyPlugin | ||
|
|
||
| import egress_gateway |
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
The documented egress-gateway command crashes before listening with locked
proxy.py 2.4.10, becauseproxy.main(**opts)does not accept the launcher's positional argument list.Proxy(input_args=...)as a context manager and callproxy.sleep_loop()without arguments, preserving compatibility with older 2.4.x releases.--helpalso works when the proxy dependency is unavailable. Preserve the publichost_allowedexport.The default binding, allowlist policy, dependency bounds, and argument passthrough are unchanged.
The README explains the supported forward-proxy mode and the trust required for additional proxy.py arguments.
Type of change
Test plan
TypeError.pytest -n autowith two workers.prek run --all-files --skip workspace-pytestand the affected-package/dependent test gate pass on the new upstream baseline, including whole-tree links and applicable static checks.zizmor --config .zizmor.yml .and Magpie pre-first-PR checks pass.Live listening checks are local verification, separate from the committed tests.
Earlier startup-contract probes against real proxy.py 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.4, and 2.4.10 passed on Windows and Linux; the runtime source is unchanged from that verification.
RFC-AI-0004 compliance
Linked issues
Closes #1773.
Notes for reviewers
Suggested labels:
bug,family:tools,substrate:sandbox,capability:fix.Generative AI disclosure: Implementation, tests, and documentation were prepared with Codex (GPT-6). The contributor has reviewed and approved the complete change.