feat(cli): expose gateway serve command#78
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4f9fbba917
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Paperclip <noreply@paperclip.ing>
4f9fbba to
af72cea
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: af72cea86f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Paperclip <noreply@paperclip.ing>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 417723491a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Paperclip <noreply@paperclip.ing>
Closes ANGA-353
Thinking Path
harness-gatewaycrate already owns the Axum WebSocket server,/health, ping/pong, event broadcast, and control-command plumbing.run,eval,memory, andpaperclip.crates/cliavoids touching provider traits, Paperclip API adapter behavior, or gateway wire semantics.anvil gateway serveshould print the actual health and WebSocket URLs so users can verify the selected port, including OS-assigned port0.--emit-hello, preserving the default behavior as a passive local gateway.--emit-helloshould wait until a WebSocket client is subscribed, otherwise the broadcast channel correctly drops the smoke event before any operator can observe it.--event-buffer 0cannot panic inside the broadcast channel.What Changed
gatewaytop-level CLI command andgateway servesubcommand.harness-gatewayintoharness-cliand startsGateway::new(config).start()from the CLI.--port,--event-buffer, and--emit-hellooptions for local gateway startup./healthand/wsURLs after successful bind, including the actual bound address.--emit-hellostartup events until the first WebSocket client has subscribed.--event-buffer 0.Verification
cargo fmt --checkpassescargo test --workspacepassescargo clippy --workspace -- -D warningscleancargo test -p harness-cli --test cli_surfacepassescargo test -p harness-gatewaypassesanvil gateway serve --port 19157;GET /healthreturned{"status":"ok"}and WebSocket{"cmd":"ping"}returned{"kind":"pong"}cargo test --workspace)Risks
Low risk. The change only exposes an existing gateway crate through the CLI, adds argument validation, drains existing control-command traffic, and makes opt-in hello emission wait for a subscribed WebSocket client. The new server command binds to localhost through the existing gateway implementation and does not change provider traits, Paperclip adapter behavior, or gateway wire semantics.
Checklist
cargo fmt