Skip to content

Model path: per-run gateway, gateway-proxy and the hetzner2 tunnel #6

Closed

Description

@jerryfane

Parent: #2

Part of the epic. Owner: gitmoot-pipe.

Change

  • Run gateway (inside stagehand serve on hetzner2)
    • Listens on 127.0.0.1:<host-port> (43293) only while an agent stage runs.
    • Accepts only the current per-run random token (Bearer or x-api-key), strips it, and reverse-proxies to the upstream (127.0.0.1:43294).
    • Streaming (SSE) is passed through without buffering.
    • The token dies with the attempt.
  • stagehand gateway-proxy (fleet host)
    • Listens on 127.0.0.1:43295, reads the omp auth-gateway token from a 0600 file, sets Authorization: Bearer <token>, and reverse-proxies to 127.0.0.1:4011.
    • Loopback only. Logs requests without credentials.
  • stagehand-model-tunnel.service (fleet host), modeled on phobos-sandbox-hetzner2-tunnel.service: ssh -N -R 127.0.0.1:43294:127.0.0.1:43295 root@hetzner2, with the same hardening.
  • Units: stagehand-gateway-proxy.service and stagehand-model-tunnel.service.

Acceptance

  • Tests: a request with a wrong or old token is rejected. The token never reaches upstream. SSE streams through.
  • A real request from hetzner2 through the tunnel reaches the auth-gateway and gets a model reply.
  • The gateway token file never leaves the fleet host.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions