Skip to content

egress-gateway fails to start with locked proxy.py 2.4.10 #15

Open

Description

@MakerFlyFly

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 8899

Both 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 specifies proxy.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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfamily:toolssubstrate:sandboxTool substrate: agent isolation, egress control, settings audit

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions