Skip to content

docs(runners): tech design of the Go relay service for the interactive tunnel - #796

Merged
NOX73 merged 5 commits into
developfrom
feature/relay-service-design
Nov 19, 2026
Merged

NOX73 merged 5 commits into
developfrom
feature/relay-service-design

Conversation

@NOX73

@NOX73 NOX73 commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

Task #253 (Runners 16a). Design only: docs/design/agent-runtimes/relay-service.md (new), the row 16 split and rows 24 to 27 in DESIGN.md §15 with short notes in §6.1 and §6.9.5, and the docs/index.md entry. No code, no PROTOCOL.md change.

Proposes: the interactive tunnel as a separate Go service (relay/), reached at /runner/v1/tunnel, behind terminal-auth for browsers, built so the ops long-poll and the callback proxy can move into it later and the runner-gateway deployment can go.

Please check:

  1. Runner auth by ticket (§3.1). The gateway mints a 60 s single-use HMAC ticket at POST /runner/v1/tunnel-ticket. The relay never sees the access token, and the check order and Rack::Attack throttles stay in Rails.
  2. Streams are raw TCP (§4, §5). The relay speaks HTTP/WebSocket to the browser. The runner only dials five ports. Credit-based flow control, no stream resumption on reconnect.
  3. Shared code (§2.1). relay/ is its own module and not part of runner/ (which is extracted). The codec is a public package, runner/protocol/tunnel, imported with a replace.
  4. Viewer revocation is stricter than hosted (§6, §8.3). Open streams are re-checked by a 60 s reconcile pass, with Redis pub/sub as the fast path.
  5. Takeover (§10). The relay holds the wait and forwards short wait=0 reads to Rails, so token checks and throttles do not move. The callback proxy is split into a Rails authorization and a relay stream.
  6. The cut (§13): 16b to 16g, then 24 (long-poll), 25 (proxy), 26 (remove runner-gateway), 27 (multi-replica, deferred).

Departures from the task text: PROTOCOL.md is not edited here, because it states that it describes only what is implemented; each task writes its section. aixle-infra was not available to this session, so §2.3 and §16 mark what 16f must reconcile. The docs test needs Ruby, which was not available here.

@github-actions

Copy link
Copy Markdown

Thanks for your pull request! Before we can merge it, we need you to sign our Contributor License Agreement. It is a one-time step and covers all your future contributions.

To sign, reply to this pull request with exactly:


I have read the CLA Document and I hereby sign the CLA


1 out of 2 committers have signed the CLA.
✅ (NOX73)[https://github.com/NOX73]
❌ @Aixle Flow
Aixle Flow seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@NOX73
NOX73 merged commit 6e9fee3 into develop Nov 19, 2026
16 of 17 checks passed
@NOX73
NOX73 deleted the feature/relay-service-design branch November 19, 2026 18:39
artempartos added a commit that referenced this pull request Nov 20, 2026
* origin/docs/session-restore-and-sharing-research:
  feat(sessions): suspend interactive sessions and restore them within 30 days
  docs(design): suspend and restore interactive sessions
  docs(research): restoring an ended session and sharing a live one
  test(workflows): stop counting schema lookups in the step-runs query test (#805)
  chore(agents): raise agent CLI pins for canary #675 (#804)
  docs(runners): tell manual machine owners to block the SCTP module (#803)
  fix(deps): weekly dependency batch — puma 8.1.2 advisories, stripe 21.1, Mantine 9.8.1, jsdom 31 (#799)
  docs(runners): record the second manual runner validation in row 14 (#797)
  docs(runners): tech design of the Go relay service for the interactive tunnel (#796)
  chore(runners): pin aixle-runner 0.4.1 as the recommended version (#795)

# Conflicts:
#	CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant