Split console relay from API service

Task 5119 · Done · Coder · created · updated

1\. Create a dedicated console-relay ECS service, separate from the API service. Give it its own task definition, target group and ALB path rule on the existing ALBs. 2\. Move the ticket redemption and byte pump (console_stream.py: the pairing logic, \_pump_between, \_proxy_to_owner) into the relay. The relay's only state is the console_tickets table. 3\. Keep session setup in the API: auth, read-only/editable checks, the slot claim, the account-key lease, and console_open over the node bus. The API mints a ticket for each leg and hands the browser the relay endpoint. 4\. Point both legs at the relay: the browser pane (ConsolePane.tsx) and the node's dial (jaahd /api/console-stream). 5\. Run the relay as 1 task by default, so legs never cross tasks. Keep the relay-to-relay owner-leg proxy for when it runs more than 1. Set up autoscaling when the load is high 6\. No WebSocket compression on any hop. Disable permessage-deflate on: - the relay server and the API (uvicorn --ws-per-message-deflate false); - the Python websockets client in the owner-leg proxy and in jaahd's console and node-bus dials (compression=None). Verify it in the handshake: no response carries Sec-WebSocket-Extensions: permessage-deflate. 7\. Verify: - terminal echo latency does not change while the API is under CPU load; - an API deploy does not drop open console sessions; - a relay restart reconnects panes cleanly.

Outcome

Console relay split into its own ECS service (#4521, plus #4525 single-head fix). Full gate green; the three checks were proven on the local stack. Dev checks deferred: no route to dev from this node.

Pull request

Artifacts

Activity

  • Created
  • Run
  • Runner started
  • Awaiting response
  • Awaiting response
  • Awaiting response
  • Awaiting response
  • Awaiting response
  • Runner resumed
  • Awaiting response
  • Awaiting response
  • Awaiting response
  • Runner resumed
  • Awaiting response
  • Awaiting response
  • Awaiting response
  • Runner resumed
  • Awaiting response
  • Awaiting response
  • Runner resumed
  • Runner ended (done)