Skip to content

feat: wire edge HTTP API to message bus - #23

Open
Gavriel-lab wants to merge 2 commits into
Clawland-AI:mainfrom
Gavriel-lab:codex/edge-http-server
Open

feat: wire edge HTTP API to message bus#23
Gavriel-lab wants to merge 2 commits into
Clawland-AI:mainfrom
Gavriel-lab:codex/edge-http-server

Conversation

@Gavriel-lab

Copy link
Copy Markdown

Summary

  • add the bounty-required Edge HTTP API routes: GET /api/health, GET /api/status, POST /api/command, and POST /api/message
  • keep existing /healthz and /api/v1/* routes as compatibility aliases
  • wire accepted commands/messages into the existing pkg/bus.MessageBus instead of only logging inbound requests
  • pass the gateway message bus into the edge server startup path
  • add focused pkg/edge handler tests for health/status, command publishing, message publishing, and invalid JSON
  • document the new API routes in the README

Closes #22

Validation

  • git diff --check passed locally
  • I could not run go test ./pkg/edge in this Windows Codex environment because the Go toolchain is not installed (go / gofmt commands are unavailable). The PR includes focused tests for maintainers/CI to run.

/claim #22

@Gavriel-lab
Gavriel-lab requested a review from Tonyfudecai as a code owner May 31, 2026 15:29
@Gavriel-lab

Copy link
Copy Markdown
Author

Validation update from my Windows workstation:

  • Installed and verified Go go1.26.3 windows/amd64 from the official archive.
  • Ran gofmt on the touched Go files and pushed the formatting cleanup in 6d7665e.
  • Ran the focused package test for this PR:
$ go test ./pkg/edge
ok  	github.com/sipeed/picoclaw/pkg/edge	0.583s

I also checked the broader suite with go test ./.... The new edge package still passed, but the full suite currently fails in the pre-existing, untouched pkg/gene package:

--- FAIL: TestSelectGenes_SortedByScore (0.00s)
    selector_test.go:175: expected highest-scoring gene first, got low
FAIL	github.com/sipeed/picoclaw/pkg/gene	0.573s

This PR only changes README.md, cmd/picoclaw/main.go, pkg/edge/server.go, and pkg/edge/server_test.go; it does not touch pkg/gene.

@Gavriel-lab

Copy link
Copy Markdown
Author

Follow-up on the full-suite validation note: I opened a separate minimal baseline fix for the existing pkg/gene selector ordering failure here:

#26

That PR keeps the fix isolated from this edge API work. Locally, after the gene selector tie-breaker fix, go test ./... passes on the base tree.

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