Skip to content

feat(edge): wire HTTP API to message bus - #30

Open
barton87 wants to merge 1 commit into
Clawland-AI:mainfrom
barton87:feat/edge-http-api-message-bus
Open

feat(edge): wire HTTP API to message bus#30
barton87 wants to merge 1 commit into
Clawland-AI:mainfrom
barton87:feat/edge-http-api-message-bus

Conversation

@barton87

@barton87 barton87 commented Jun 1, 2026

Copy link
Copy Markdown

Summary

Closes #22.

Implements the Edge HTTP Server bounty with a focused, test-backed API surface:

  • Adds required endpoints:
    • GET /api/health
    • GET /api/status
    • POST /api/command
    • POST /api/message
  • Preserves compatibility aliases:
    • GET /healthz
    • GET /api/v1/health
    • GET /api/v1/status
    • POST /api/v1/command
    • POST /api/v1/message
  • Wires the gateway MessageBus into the edge server so accepted commands/messages are published instead of only logged.
  • Adds structured JSON responses/errors and useful status fields (bus_connected, endpoint list, node/cloud info).
  • Adds focused pkg/edge tests for route aliases, command/message publishing, invalid requests, and no-bus behavior.
  • Fixes a deterministic ordering issue in pkg/gene.SelectGenes so the repository-wide test suite passes; this is separate from the edge API behavior but required for clean validation.

Validation

  • gofmt -w cmd/picoclaw/main.go pkg/edge/server.go pkg/edge/server_test.go pkg/gene/selector.go
  • go test ./pkg/edge ./pkg/bus ./cmd/picoclaw
  • go test ./...

Notes

The implementation keeps the edge API small and avoids changing unrelated agent-loop behavior. Command/message requests are accepted into the existing bus with metadata so downstream handlers can process them consistently.

@barton87
barton87 requested a review from Tonyfudecai as a code owner June 1, 2026 05:01
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.

bounty: edge HTTP server for PicClaw

1 participant