Repository navigation
egress-gateway fails to start with locked proxy.py 2.4.10 #15
Description
What's broken
Both the installed egress-gateway command and python -m egress_gateway.cli exit before starting the proxy with the workspace-locked proxy.py 2.4.10.
They raise TypeError: main() takes 0 positional arguments but 1 was given.
--help still works.
Which layer
Python tool: tools/egress-gateway/src/egress_gateway/cli.py, in main().
How to reproduce
From a checkout of Magpie commit e6e5c2e36bcab4d0a09d6da5c26e8060caaea3e2, run:
uv run --frozen --project tools/egress-gateway egress-gateway --port 8899
uv run --frozen --project tools/egress-gateway python -m egress_gateway.cli --port 8899Both commands exit with status 1 at the call to proxy.main([...]):
TypeError: main() takes 0 positional arguments but 1 was given
Expected vs actual
Expected: the documented command starts the forward proxy with the allowlist plugin loaded and waits until shutdown.
Actual: argument binding fails before the proxy can initialize.
In the locked dependency, proxy.main(**opts) accepts only keyword arguments and reads the process arguments itself.
The gateway supplies a positional list instead.
The dependency provides Proxy(input_args=...) as its context manager, with sleep_loop() as the wait loop.
See the proxy.py 2.4.10 implementation.
Surface area (optional)
The existing allowlist-policy tests pass on the affected version but do not exercise CLI startup.
The proposed fix is limited to starting the existing proxy runtime, regression coverage for CLI arguments and lifecycle, and the test-coverage documentation.
Environment (optional)
- Magpie baseline:
e6e5c2e36bcab4d0a09d6da5c26e8060caaea3e2. - Windows x86_64, CPython 3.12.13.
- Also reproduced on Linux (Alpine 3.23, WSL2, CPython 3.12.15) in an isolated test root with native symbolic links.
uv.lock:proxy-py == 2.4.10; the manifest specifiesproxy.py >=2.4,<3.- Reproduced outside an OS sandbox that restricts listening sockets.
Generative AI disclosure: AI-generated report prepared with Codex (GPT-6), published on the contributor's fork for human review.
Draft fix for review
Draft PR #16 contains the implementation, regression tests, and verification results.
Activity
fix(egress-gateway): preserve startup compatibility and lazy help