Skip to content

feat: add online external runtime channel - #7

Open
pilprod wants to merge 8 commits into
mainfrom
feature/external-runtime-online-channel
Open

feat: add online external runtime channel#7
pilprod wants to merge 8 commits into
mainfrom
feature/external-runtime-online-channel

Conversation

@pilprod

@pilprod pilprod commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • route lifecycle and A2A calls through one explicit persisted runtime backend registry
  • add an authenticated outbound-client reverse HTTPS broker for Codex and Claude slots
  • wire the broker into controller-v2 behind a default-disabled, fail-closed feature gate on a separate device listener
  • require one explicit device identity, file-backed bearer token, and explicit Codex and/or Claude slot IDs
  • fence duplicate device sessions with monotonic generations and distinguish offline-before-dispatch from unknown-outcome-after-dispatch
  • persist immutable backend identity on runtime revisions with migration 000018
  • validate A2A v1 compatibility on Create/Resume and return a typed unsupported-checkpoint result for external runtimes
  • bound paths, bodies, headers, token reads, timeouts, and concurrency while preventing user, Temporal, cookie, tracing, and hop-by-hop headers from crossing to a client device

Feature gate

  • disabled by default with EXTERNAL_GATEWAY_ENABLED=false; token and placement settings are not read
  • enabled mode requires EXTERNAL_GATEWAY_TOKEN_FILE, EXTERNAL_GATEWAY_DEVICE_ID, and at least one slot ID
  • the in-memory broker listens separately on EXTERNAL_GATEWAY_BIND_ADDRESS (default :8085)
  • the controller must remain single-replica until session ownership is externalized

Verification

  • go test -race ./core/cmd/controller-v2 ./core/v2/runtimebackend ./core/v2/externalruntime ./core/v2/externalgateway ./core/v2/a2agateway ./core/v2/agentinstance ./core/v2/checkpoint ./core/v2/substrate
  • go vet ./core/cmd/controller-v2 ./core/v2/runtimebackend ./core/v2/externalruntime ./core/v2/externalgateway ./core/v2/a2agateway ./core/v2/agentinstance ./core/v2/checkpoint ./core/v2/substrate ./core/internal/database
  • go test ./core/pkg/migrations -run '^TestMigrationGuards$'
  • make -C go sqlc-generate
  • git diff --check origin/feature/external-runtime-gateway-v3...HEAD

PostgreSQL-backed migration and database integration tests could not run locally because rootless Docker is not installed on this workstation.

Stack

Depends on #6. This is intentionally an online, single-replica in-memory transport slice. Durable offline dispatch, multi-replica broker coordination, automated device enrollment, and external Harness compilation are not claimed here.

Signed-off-by: Ilya Papou <ilya@papou.email>
Signed-off-by: Ilya Papou <ilya@papou.email>
Signed-off-by: Ilya Papou <ilya@papou.email>
Signed-off-by: Ilya Papou <ilya@papou.email>
Signed-off-by: Ilya Papou <ilya@papou.email>
Signed-off-by: Ilya Papou <ilya@papou.email>
Signed-off-by: Ilya Papou <ilya@papou.email>
…nal-runtime-online-channel

Signed-off-by: Ilya Papou <ilya@papou.email>

# Conflicts:
#	go/core/cmd/controller-v2/main.go
@pilprod
pilprod changed the base branch from feature/external-runtime-gateway-v3 to main August 30, 2026 17:45
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