Skip to content

Extract a swappable networkProxy seam from deployOps #5901

Closed

Description

@ChrisJBurns

Part of #5900.

Goal

Extract a networkProxy interface so the proxy backend is swappable, and re-home the existing Squid logic behind it. Pure refactor — no behavior change, Squid stays the only backend.

What

  • New networkProxy interface with a single SetupProxies(ctx, proxySpec) (proxyResult, error) method, plus proxySpec/proxyResult types.
  • Move the egress/ingress proxy methods off deployOps into a squidProxy implementation.
  • newNetworkProxy factory reads TOOLHIVE_NETWORK_PROXY; ""/"squid" select Squid, unknown values fail loudly at NewClient.
  • SetupProxies is invoked before createMcpContainer so returned env vars can be injected into the workload.

Acceptance criteria

  • networkProxy seam exists; Squid is a backend behind it; deployOps no longer owns proxy methods.
  • No user-visible behavior change; existing isolation tests pass, plus a call-ordering test (SetupProxies before createMcpContainer).
  • newNetworkProxy errors on unknown TOOLHIVE_NETWORK_PROXY values.

Notes

Foundation for the Envoy backend (#5900). ~150 lines of production code; fits PR limits comfortably.

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

    needs-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions