feat(orchestrator): HTTP POST /commands/submit endpoint#51
Merged
Conversation
Adds the controller-facing submission endpoint to the existing HTTP
server (formerly SSE-only). The endpoint accepts a JSON SubmitRequest
{submitter, command}, calls dispatcher.submit, and returns a JSON
SubmitResponse {seq, acks, missing}. Optional — if no dispatcher was
wired in, the endpoint returns 503 Service Unavailable.
This is the wire that the benchmark-controller (in arcane-scaling-
benchmarks) uses to drive the orchestrator over the network.
Routes on a single port:
- GET /telemetry/stream → SSE event-stream (existing)
- POST /commands/submit → dispatcher.submit (new)
API additions:
- serve(addr, source, dispatcher) and serve_bound — the unified server
- serve_sse / serve_sse_bound aliases preserved for backward compat
- SubmitRequest / SubmitResponse pub types for cross-crate consumption
3 e2e tests in tests/controller_submit_e2e.rs spin up the full
orchestrator (driver WS server + HTTP API server) on random ports,
register a synthetic driver, POST a SetPlayers command via the HTTP
endpoint, and verify the ack round-trips back through the wire.
Companion to tests/ws_command_e2e.rs (driver-side wire) and
tests/dashboard_sse.rs (SSE wire).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the controller-facing submission endpoint to the existing HTTP server (formerly SSE-only). This is the wire the benchmark-controller (in arcane-scaling-benchmarks) uses to drive the orchestrator over the network.
Endpoints (unified on one port)
The new endpoint accepts a JSON `SubmitRequest {submitter, command}`, calls `dispatcher.submit`, and returns a JSON `SubmitResponse {seq, acks, missing}`. Optional — if no dispatcher was wired in, the endpoint returns `503 Service Unavailable`.
API surface
Test plan
3 e2e tests in `tests/controller_submit_e2e.rs` spin up the full orchestrator (driver WS server + HTTP API server) on random ports, register a synthetic driver, POST a `SetPlayers` command via the HTTP endpoint, and verify the ack round-trips back through the wire. Covers happy path + 400 (no active drivers) + 503 (no dispatcher).
🤖 Generated with Claude Code